svn commit: samba r20725 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-13 Thread vlendec
Author: vlendec
Date: 2007-01-13 10:40:09 + (Sat, 13 Jan 2007)
New Revision: 20725

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20725

Log:
Get rid of a bool passed down -- gd, please check
Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c2007-01-13 
02:34:43 UTC (rev 20724)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c2007-01-13 
10:40:09 UTC (rev 20725)
@@ -280,7 +280,6 @@
time_t create_time, 
time_t ticket_end, 
time_t renew_until, 
-   BOOL schedule_refresh_event,
BOOL postponed_request)
 {
struct WINBINDD_CCACHE_ENTRY *entry = NULL;
@@ -348,7 +347,7 @@
entry-uid = uid;
entry-ref_count = 1;
 
-   if (schedule_refresh_event  renew_until  0) {
+   if (lp_winbind_refresh_tickets()  renew_until  0) {
if (postponed_request) {
entry-event = add_timed_event(entry,
timeval_current_ofs(MAX(30, 
lp_winbind_cache_time()), 0),

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2007-01-13 02:34:43 UTC 
(rev 20724)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2007-01-13 10:40:09 UTC 
(rev 20725)
@@ -608,7 +608,6 @@
time(NULL),
ticket_lifetime,
renewal_until, 
-   lp_winbind_refresh_tickets(),
False);
 
if (!NT_STATUS_IS_OK(result)) {
@@ -884,7 +883,6 @@
time(NULL),
time(NULL) + 
lp_winbind_cache_time(),
time(NULL) + 
WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
-   
lp_winbind_refresh_tickets(),
True);
 
if (!NT_STATUS_IS_OK(result)) {



svn commit: samba r20726 - in branches/SAMBA_4_0/source/dsdb: repl samdb samdb/ldb_modules

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 10:53:12 + (Sat, 13 Jan 2007)
New Revision: 20726

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20726

Log:
- only add the rdn attribute and it's meta_data when the 'name' attribute is 
there
- add the values for objectGUID and whenChanged inside the ldb module,
  so that the ldb module has only replicated attributes as input

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
   branches/SAMBA_4_0/source/dsdb/samdb/samdb.h


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
===
--- branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c2007-01-13 
10:40:09 UTC (rev 20725)
+++ branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c2007-01-13 
10:53:12 UTC (rev 20726)
@@ -44,13 +44,13 @@
NTTIME whenChanged = 0;
time_t whenChanged_t;
const char *whenChanged_s;
-   const char *rdn_name;
-   const struct ldb_val *rdn_value;
-   const struct dsdb_attribute *rdn_attr;
+   const char *rdn_name = NULL;
+   const struct ldb_val *rdn_value = NULL;
+   const struct dsdb_attribute *rdn_attr = NULL;
uint32_t rdn_attid;
-   struct drsuapi_DsReplicaAttribute *name_a;
-   struct drsuapi_DsReplicaMetaData *name_d;
-   struct replPropertyMetaData1 *rdn_m;
+   struct drsuapi_DsReplicaAttribute *name_a = NULL;
+   struct drsuapi_DsReplicaMetaData *name_d = NULL;
+   struct replPropertyMetaData1 *rdn_m = NULL;
int ret;
 
if (!in-object.identifier) {
@@ -134,44 +134,36 @@
}
}
 
-   if (!name_d) {
-   return WERR_FOOBAR;
-   }
+   if (rdn_m) {
+   ret = ldb_msg_add_value(msg, rdn_attr-lDAPDisplayName, 
rdn_value, NULL);
+   if (ret != LDB_SUCCESS) {
+   return WERR_FOOBAR;
+   }
 
-   ret = ldb_msg_add_value(msg, rdn_attr-lDAPDisplayName, rdn_value, 
NULL);
-   if (ret != LDB_SUCCESS) {
-   return WERR_FOOBAR;
+   rdn_m-attid= rdn_attid;
+   rdn_m-version  = name_d-version;
+   rdn_m-orginating_time  = 
name_d-orginating_time;
+   rdn_m-orginating_invocation_id = 
name_d-orginating_invocation_id;
+   rdn_m-orginating_usn   = 
name_d-orginating_usn;
+   rdn_m-local_usn= 0;
+   md-ctr.ctr1.count++;
+
}
 
+   whenChanged_t = nt_time_to_unix(whenChanged);
+   whenChanged_s = ldb_timestring(msg, whenChanged_t);
+   W_ERROR_HAVE_NO_MEMORY(whenChanged_s);
+
nt_status = ndr_push_struct_blob(guid_value, msg, 
in-object.identifier-guid,
 (ndr_push_flags_fn_t)ndr_push_GUID);
if (!NT_STATUS_IS_OK(nt_status)) {
return ntstatus_to_werror(nt_status);
}
-   ret = ldb_msg_add_value(msg, objectGUID, guid_value, NULL);
-   if (ret != LDB_SUCCESS) {
-   return WERR_FOOBAR;
-   }
 
-   whenChanged_t = nt_time_to_unix(whenChanged);
-   whenChanged_s = ldb_timestring(msg, whenChanged_t);
-   W_ERROR_HAVE_NO_MEMORY(whenChanged_s);
-   ret = ldb_msg_add_string(msg, whenChanged, whenChanged_s);
-   if (ret != LDB_SUCCESS) {
-   return WERR_FOOBAR;
-   }
-
-   rdn_m-attid= rdn_attid;
-   rdn_m-version  = name_d-version;
-   rdn_m-orginating_time  = name_d-orginating_time;
-   rdn_m-orginating_invocation_id = 
name_d-orginating_invocation_id;
-   rdn_m-orginating_usn   = name_d-orginating_usn;
-   rdn_m-local_usn= 0;
-   md-ctr.ctr1.count++;
-
-   out-msg= msg;
-   out-guid_value = guid_value;
-   out-meta_data  = md;
+   out-msg= msg;
+   out-guid_value = guid_value;
+   out-when_changed   = whenChanged_s;
+   out-meta_data  = md;
return WERR_OK;
 }
 

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 10:40:09 UTC (rev 20725)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 10:53:12 UTC (rev 20726)
@@ -446,6 +446,15 @@
uint64_t seq_num;
int ret;
 
+   /*
+* TODO: check if the parent object exist
+*/
+
+   /*
+* TODO: handle the conflict case where an object with the
+*   same name exist
+*/
+
msg = 

svn commit: samba r20727 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 11:17:27 + (Sat, 13 Jan 2007)
New Revision: 20727

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20727

Log:
implement basic merging of replicated objects when it already exist
in the ldb

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 10:53:12 UTC (rev 20726)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 11:17:27 UTC (rev 20727)
@@ -526,15 +526,257 @@
 #endif
 }
 
+static int replmd_replPropertyMetaData1_attid_compare(struct 
replPropertyMetaData1 *m1,
+ struct 
replPropertyMetaData1 *m2)
+{
+   return m1-attid - m2-attid;
+}
+
+static int replmd_replPropertyMetaData1_conflict_compare(struct 
replPropertyMetaData1 *m1,
+struct 
replPropertyMetaData1 *m2)
+{
+   int ret;
+
+   if (m1-version != m2-version) {
+   return m1-version - m2-version;
+   }
+
+   if (m1-orginating_time != m2-orginating_time) {
+   return m1-orginating_time - m2-orginating_time;
+   }
+
+   ret = GUID_compare(m1-orginating_invocation_id, 
m2-orginating_invocation_id);
+   if (ret != 0) {
+   return ret;
+   }
+
+   return m1-orginating_usn - m2-orginating_usn;
+}
+
+static int replmd_replicated_apply_merge_callback(struct ldb_context *ldb,
+ void *private_data,
+ struct ldb_reply *ares)
+{
+#ifdef REPLMD_FULL_ASYNC /* TODO: active this code when ldb support full async 
code */ 
+   struct replmd_replicated_request *ar = talloc_get_type(private_data,
+  struct 
replmd_replicated_request);
+
+   ret = ldb_next_request(ar-module, ar-sub.change_req);
+   if (ret != LDB_SUCCESS) return replmd_replicated_request_error(ar, ret);
+
+   ar-sub.change_ret = ldb_wait(ar-sub.search_req-handle, LDB_WAIT_ALL);
+   if (ar-sub.change_ret != LDB_SUCCESS) {
+   return replmd_replicated_request_error(ar, ar-sub.change_ret);
+   }
+
+   talloc_free(ar-sub.mem_ctx);
+   ZERO_STRUCT(ar-sub);
+
+   ar-index_current++;
+
+   return LDB_SUCCESS;
+#else
+   return LDB_SUCCESS;
+#endif
+}
+
 static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
 {
+   NTSTATUS nt_status;
+   struct ldb_message *msg;
+   struct replPropertyMetaDataBlob *rmd;
+   struct replPropertyMetaDataBlob omd;
+   const struct ldb_val *omd_value;
+   struct replPropertyMetaDataBlob nmd;
+   struct ldb_val nmd_value;
+   uint32_t i,j,ni=0;
+   uint32_t removed_attrs = 0;
+   uint64_t seq_num;
+   int ret;
+
+   msg = ar-objs-objects[ar-index_current].msg;
+   rmd = ar-objs-objects[ar-index_current].meta_data;
+   ZERO_STRUCT(omd);
+   omd.version = 1;
+
+   /*
+* TODO: add rename conflict handling
+*/
+   if (ldb_dn_compare(msg-dn, ar-sub.search_msg-dn) != 0) {
+   ldb_debug(ar-module-ldb, LDB_DEBUG_FATAL, 
replmd_replicated_apply_merge[%u]: rename not supported,
+ ar-index_current);
+   ldb_debug(ar-module-ldb, LDB_DEBUG_FATAL, %s = %s\n,
+ ldb_dn_get_linearized(ar-sub.search_msg-dn),
+ ldb_dn_get_linearized(msg-dn));
+   return replmd_replicated_request_werror(ar, WERR_NOT_SUPPORTED);
+   }
+
+   ret = ldb_sequence_number(ar-module-ldb, LDB_SEQ_NEXT, seq_num);
+   if (ret != LDB_SUCCESS) {
+   return replmd_replicated_request_error(ar, ret);
+   }
+
+   /* find existing meta data */
+   omd_value = ldb_msg_find_ldb_val(ar-sub.search_msg, 
replPropertyMetaData);
+   if (omd_value) {
+   nt_status = ndr_pull_struct_blob(omd_value, ar-sub.mem_ctx, 
omd,
+
(ndr_pull_flags_fn_t)ndr_pull_replPropertyMetaDataBlob);
+   if (!NT_STATUS_IS_OK(nt_status)) {
+   return replmd_replicated_request_werror(ar, 
ntstatus_to_werror(nt_status));
+   }
+
+   if (omd.version != 1) {
+   return replmd_replicated_request_werror(ar, 
WERR_DS_DRA_INTERNAL_ERROR);
+   }
+   }
+
+   ZERO_STRUCT(nmd);
+   nmd.version = 1;
+   nmd.ctr.ctr1.count = omd.ctr.ctr1.count + rmd-ctr.ctr1.count;
+   nmd.ctr.ctr1.array = talloc_array(ar-sub.mem_ctx,
+ struct replPropertyMetaData1,
+ 

svn commit: samba r20729 - in branches/SAMBA_4_0/source/dsdb: repl samdb samdb/ldb_modules

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 11:37:13 + (Sat, 13 Jan 2007)
New Revision: 20729

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20729

Log:
add a version number to struct dsdb_extended_replicated_objects

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
   branches/SAMBA_4_0/source/dsdb/samdb/samdb.h


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
===
--- branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c2007-01-13 
11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c2007-01-13 
11:37:13 UTC (rev 20729)
@@ -192,8 +192,9 @@
 
out = talloc_zero(mem_ctx, struct dsdb_extended_replicated_objects);
W_ERROR_HAVE_NO_MEMORY(out);
+   out-version= DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION;
 
-   out-partition_dn = ldb_dn_new(out, ldb, partition_dn);
+   out-partition_dn   = ldb_dn_new(out, ldb, partition_dn);
W_ERROR_HAVE_NO_MEMORY(out-partition_dn);
 
out-source_dsa = source_dsa;

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
2007-01-13 11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/partition.c
2007-01-13 11:37:13 UTC (rev 20729)
@@ -571,9 +571,16 @@
 
ext = talloc_get_type(req-op.extended.data, struct 
dsdb_extended_replicated_objects);
if (!ext) {
-   return LDB_ERR_OTHER;
+   ldb_debug(module-ldb, LDB_DEBUG_FATAL, 
partition_extended_replicated_objects: invalid extended data\n);
+   return LDB_ERR_PROTOCOL_ERROR;
}
 
+   if (ext-version != DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION) {
+   ldb_debug(module-ldb, LDB_DEBUG_FATAL, 
partition_extended_replicated_objects: extended data invalid version [%u != 
%u]\n,
+ ext-version, 
DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION);
+   return LDB_ERR_PROTOCOL_ERROR;
+   }
+
return partition_replicate(module, req, ext-partition_dn);
 }
 

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 11:24:39 UTC (rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 11:37:13 UTC (rev 20729)
@@ -1272,9 +1272,16 @@
 
objs = talloc_get_type(req-op.extended.data, struct 
dsdb_extended_replicated_objects);
if (!objs) {
+   ldb_debug(module-ldb, LDB_DEBUG_FATAL, 
replmd_extended_replicated_objects: invalid extended data\n);
return LDB_ERR_PROTOCOL_ERROR;
}
 
+   if (objs-version != DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION) {
+   ldb_debug(module-ldb, LDB_DEBUG_FATAL, 
replmd_extended_replicated_objects: extended data invalid version [%u != 
%u]\n,
+ objs-version, 
DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION);
+   return LDB_ERR_PROTOCOL_ERROR;
+   }
+
ar = replmd_replicated_init_handle(module, req, objs);
if (!ar) {
return LDB_ERR_OPERATIONS_ERROR;

Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb.h
===
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb.h2007-01-13 11:24:39 UTC 
(rev 20728)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb.h2007-01-13 11:37:13 UTC 
(rev 20729)
@@ -44,6 +44,13 @@
 };
 
 struct dsdb_extended_replicated_objects {
+   /* 
+* this is the version of the dsdb_extended_replicated_objects
+* version 0: initial implementation
+*/
+#define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 0
+   uint32_t version;
+
struct ldb_dn *partition_dn;
 
const struct repsFromTo1 *source_dsa;



svn commit: samba r20728 - in branches/SAMBA_4_0/source: dsdb/samdb dsdb/samdb/ldb_modules setup

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 11:24:39 + (Sat, 13 Jan 2007)
New Revision: 20728

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20728

Log:
the DSDB_CONTROL_REPLICATED_OBJECT_OID control isn't used anymore
because we now use DSDB_EXTENDED_REPLICATED_OBJECTS_OID extended operation

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
   branches/SAMBA_4_0/source/dsdb/samdb/samdb.h
   branches/SAMBA_4_0/source/setup/schema_samba4.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 11:17:27 UTC (rev 20727)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/repl_meta_data.c   
2007-01-13 11:24:39 UTC (rev 20728)
@@ -168,23 +168,6 @@
return 0;
 }
 
-static int replmd_add_replicated(struct ldb_module *module, struct ldb_request 
*req, struct ldb_control *ctrl)
-{
-   struct ldb_control **saved_ctrls;
-   int ret;
-
-   ldb_debug(module-ldb, LDB_DEBUG_TRACE, replmd_add_replicated\n);
-
-   if (!save_controls(ctrl, req, saved_ctrls)) {
-   return LDB_ERR_OPERATIONS_ERROR;
-   }
-
-   ret = ldb_next_request(module, req);
-   req-controls = saved_ctrls;
-
-   return ret;
-}
-
 static int replmd_add_originating(struct ldb_module *module, struct 
ldb_request *req)
 {
struct ldb_request *down_req;
@@ -265,39 +248,14 @@
 
 static int replmd_add(struct ldb_module *module, struct ldb_request *req)
 {
-   struct ldb_control *ctrl;
-
/* do not manipulate our control entries */
if (ldb_dn_is_special(req-op.add.message-dn)) {
return ldb_next_request(module, req);
}
 
-   ctrl = get_control_from_list(req-controls, 
DSDB_CONTROL_REPLICATED_OBJECT_OID);
-   if (ctrl) {
-   /* handle replicated objects different */
-   return replmd_add_replicated(module, req, ctrl);
-   }
-
return replmd_add_originating(module, req);
 }
 
-static int replmd_modify_replicated(struct ldb_module *module, struct 
ldb_request *req, struct ldb_control *ctrl)
-{
-   struct ldb_control **saved_ctrls;
-   int ret;
-
-   ldb_debug(module-ldb, LDB_DEBUG_TRACE, replmd_modify_replicated\n);
-
-   if (!save_controls(ctrl, req, saved_ctrls)) {
-   return LDB_ERR_OPERATIONS_ERROR;
-   }
-
-   ret = ldb_next_request(module, req);
-   req-controls = saved_ctrls;
-
-   return ret;
-}
-
 static int replmd_modify_originating(struct ldb_module *module, struct 
ldb_request *req)
 {
struct ldb_request *down_req;
@@ -352,19 +310,11 @@
 
 static int replmd_modify(struct ldb_module *module, struct ldb_request *req)
 {
-   struct ldb_control *ctrl;
-
/* do not manipulate our control entries */
if (ldb_dn_is_special(req-op.mod.message-dn)) {
return ldb_next_request(module, req);
}
 
-   ctrl = get_control_from_list(req-controls, 
DSDB_CONTROL_REPLICATED_OBJECT_OID);
-   if (ctrl) {
-   /* handle replicated objects different */
-   return replmd_modify_replicated(module, req, ctrl);
-   }
-
return replmd_modify_originating(module, req);
 }
 

Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c   2007-01-13 
11:17:27 UTC (rev 20727)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c   2007-01-13 
11:24:39 UTC (rev 20728)
@@ -680,11 +680,6 @@
return ldb_next_request(module, req);
}
 
-   if (get_control_from_list(req-controls, 
DSDB_CONTROL_REPLICATED_OBJECT_OID)) {
-   /* if it's a replicated object we have nothing to do */
-   return ldb_next_request(module, req);
-   }
-
/* is user or computer? */
if ((samdb_find_attribute(module-ldb, msg, objectclass, user) != 
NULL) ||
(samdb_find_attribute(module-ldb, msg, objectclass, computer) 
!= NULL)) {

Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb.h
===
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb.h2007-01-13 11:17:27 UTC 
(rev 20727)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb.h2007-01-13 11:24:39 UTC 
(rev 20728)
@@ -35,11 +35,6 @@
 #include dsdb/schema/schema.h
 #include dsdb/samdb/samdb_proto.h
 
-#define DSDB_CONTROL_REPLICATED_OBJECT_OID 1.3.6.1.4.1.7165.4.3.1
-struct dsdb_control_replicated_object {
-   uint8_t __dummy;
-};
-
 #define DSDB_EXTENDED_REPLICATED_OBJECTS_OID 1.3.6.1.4.1.7165.4.4.1
 struct dsdb_extended_replicated_object {
struct ldb_message *msg;

Modified: 

svn commit: samba r20730 - in branches/SAMBA_4_0/source/lib/util: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:01:39 + (Sat, 13 Jan 2007)
New Revision: 20730

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20730

Log:
this can be const

metze
Modified:
   branches/SAMBA_4_0/source/lib/util/data_blob.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/data_blob.c
===
--- branches/SAMBA_4_0/source/lib/util/data_blob.c  2007-01-13 11:37:13 UTC 
(rev 20729)
+++ branches/SAMBA_4_0/source/lib/util/data_blob.c  2007-01-13 15:01:39 UTC 
(rev 20730)
@@ -150,7 +150,7 @@
 /**
 print the data_blob as hex string
 **/
-_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, DATA_BLOB *blob)
+_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob)
 {
int i;
char *hex_string;



svn commit: samba r20731 - in branches/SAMBA_4_0/source/lib/ldb/common: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:03:00 + (Sat, 13 Jan 2007)
New Revision: 20731

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20731

Log:
we need the complex memmove() handling for removing an attribute only in one 
place

metze
Modified:
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c  2007-01-13 15:01:39 UTC 
(rev 20730)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c  2007-01-13 15:03:00 UTC 
(rev 20731)
@@ -728,23 +728,7 @@
return ldb_msg_rename_attr(msg, attr, replace);
 }
 
-
 /*
-  remove the specified attribute in a search result
-*/
-void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr)
-{
-   struct ldb_message_element *el = ldb_msg_find_element(msg, attr);
-   if (el) {
-   int n = (el - msg-elements);
-   if (n != msg-num_elements-1) {
-   memmove(el, el+1, ((msg-num_elements-1) - 
n)*sizeof(*el));
-   }
-   msg-num_elements--;
-   }
-}
-
-/*
   remove the specified element in a search result
 */
 void ldb_msg_remove_element(struct ldb_message *msg, struct 
ldb_message_element *el)
@@ -756,7 +740,19 @@
msg-num_elements--;
 }
 
+
 /*
+  remove the specified attribute in a search result
+*/
+void ldb_msg_remove_attr(struct ldb_message *msg, const char *attr)
+{
+   struct ldb_message_element *el = ldb_msg_find_element(msg, attr);
+   if (el) {
+   ldb_msg_remove_element(msg, el);
+   }
+}
+
+/*
   return a LDAP formatted GeneralizedTime string
 */
 char *ldb_timestring(TALLOC_CTX *mem_ctx, time_t t)



svn commit: samba r20732 - in branches/SAMBA_4_0/source/librpc/idl: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:28:24 + (Sat, 13 Jan 2007)
New Revision: 20732

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20732

Log:
add idl for storing the prefixMap attribute
as w2k3 doesn't return it when you ask for we don't know
the exact format, but we assume that it starts with a uint32 version

and as this attribute is not replicated we can chosse our own version...

metze
Modified:
   branches/SAMBA_4_0/source/librpc/idl/drsblobs.idl
   branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/drsblobs.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/drsblobs.idl   2007-01-13 15:03:00 UTC 
(rev 20731)
+++ branches/SAMBA_4_0/source/librpc/idl/drsblobs.idl   2007-01-13 15:28:24 UTC 
(rev 20732)
@@ -144,6 +144,37 @@
[in] partialAttributeSetBlob blob
);
 
+   /*
+* prefixMap
+* w2k  unknown
+* w2k3 unknown
+* samba4 uses 0x4452 'DSDB'
+*
+* as we windows don't return the prefixMap attribute when you ask for
+* we don't know the format, but the attribute is not replicated
+* so that we can choose our own format...
+*/
+   typedef [v1_enum] enum {
+   PREFIX_MAP_VERSION_DSDB = 0x4452
+   } prefixMapVersion;
+
+   typedef [nodiscriminant] union {
+   [case(PREFIX_MAP_VERSION_DSDB)] drsuapi_DsReplicaOIDMapping_Ctr 
dsdb;
+   } prefixMapCtr;
+
+   typedef [public] struct {
+   prefixMapVersion version;
+   uint32 reserved;
+   [switch_is(version)] prefixMapCtr ctr;
+   } prefixMapBlob;
+
+   void decode_prefixMap(
+   [in] prefixMapBlob blob
+   );
+
+   /*
+* the cookie for the LDAP dirsync control
+*/
typedef [nodiscriminant,gensize] union {
[case(0)];
[default] replUpToDateVectorBlob uptodateness_vector;

Modified: branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl2007-01-13 15:03:00 UTC 
(rev 20731)
+++ branches/SAMBA_4_0/source/librpc/idl/drsuapi.idl2007-01-13 15:28:24 UTC 
(rev 20732)
@@ -336,7 +336,7 @@
drsuapi_DsReplicaOID oid;
} drsuapi_DsReplicaOIDMapping;
 
-   typedef struct {
+   typedef [public] struct {
[range(0,0x10)] uint32 num_mappings;
[size_is(num_mappings)] drsuapi_DsReplicaOIDMapping *mappings;
} drsuapi_DsReplicaOIDMapping_Ctr;



svn commit: samba r20733 - in branches/SAMBA_4_0/source: dsdb/repl dsdb/schema torture/libnet

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:29:47 + (Sat, 13 Jan 2007)
New Revision: 20733

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20733

Log:
add a function to load the oid mappings from ldb_val's 

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
   branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
   branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c
===
--- branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c2007-01-13 
15:28:24 UTC (rev 20732)
+++ branches/SAMBA_4_0/source/dsdb/repl/replicated_objects.c2007-01-13 
15:29:47 UTC (rev 20733)
@@ -187,7 +187,7 @@
uint32_t i;
int ret;
 
-   status = dsdb_verify_oid_mappings(schema, mapping_ctr);
+   status = dsdb_verify_oid_mappings_drsuapi(schema, mapping_ctr);
W_ERROR_NOT_OK_RETURN(status);
 
out = talloc_zero(mem_ctx, struct dsdb_extended_replicated_objects);

Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
===
--- branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2007-01-13 15:28:24 UTC 
(rev 20732)
+++ branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2007-01-13 15:29:47 UTC 
(rev 20733)
@@ -26,8 +26,9 @@
 #include lib/util/dlinklist.h
 #include librpc/gen_ndr/ndr_misc.h
 #include librpc/gen_ndr/ndr_drsuapi.h
+#include librpc/gen_ndr/ndr_drsblobs.h
 
-WERROR dsdb_load_oid_mappings(struct dsdb_schema *schema, const struct 
drsuapi_DsReplicaOIDMapping_Ctr *ctr)
+WERROR dsdb_load_oid_mappings_drsuapi(struct dsdb_schema *schema, const struct 
drsuapi_DsReplicaOIDMapping_Ctr *ctr)
 {
uint32_t i,j;
 
@@ -74,8 +75,52 @@
return WERR_OK;
 }
 
-WERROR dsdb_verify_oid_mappings(const struct dsdb_schema *schema, const struct 
drsuapi_DsReplicaOIDMapping_Ctr *ctr)
+WERROR dsdb_load_oid_mappings_ldb(struct dsdb_schema *schema,
+ const struct ldb_val *prefixMap,
+ const struct ldb_val *schemaInfo)
 {
+   WERROR status;
+   NTSTATUS nt_status;
+   struct prefixMapBlob pfm;
+   char *schema_info;
+
+   nt_status = ndr_pull_struct_blob(prefixMap, schema, pfm,
+
(ndr_pull_flags_fn_t)ndr_pull_prefixMapBlob);
+   if (!NT_STATUS_IS_OK(nt_status)) {
+   return ntstatus_to_werror(nt_status);
+   }
+
+   if (pfm.version != PREFIX_MAP_VERSION_DSDB) {
+   return WERR_FOOBAR;
+   }
+
+   if (schemaInfo-length != 21  schemaInfo-data[0] == 0xFF) {
+   return WERR_FOOBAR;
+   }
+
+   /* append the schema info as last element */
+   pfm.ctr.dsdb.num_mappings++;
+   pfm.ctr.dsdb.mappings = talloc_realloc(schema, pfm.ctr.dsdb.mappings,
+  struct 
drsuapi_DsReplicaOIDMapping,
+  pfm.ctr.dsdb.num_mappings);
+   W_ERROR_HAVE_NO_MEMORY(pfm.ctr.dsdb.mappings);
+
+   schema_info = data_blob_hex_string(pfm.ctr.dsdb.mappings, schemaInfo);
+   W_ERROR_HAVE_NO_MEMORY(schema_info);
+
+   pfm.ctr.dsdb.mappings[pfm.ctr.dsdb.num_mappings - 1].id_prefix  = 0;
+   pfm.ctr.dsdb.mappings[pfm.ctr.dsdb.num_mappings - 1].oid.oid= 
schema_info;
+
+   /* call the drsuapi version */
+   status = dsdb_load_oid_mappings_drsuapi(schema, pfm.ctr.dsdb);
+   talloc_free(pfm.ctr.dsdb.mappings);
+   W_ERROR_NOT_OK_RETURN(status);
+
+   return WERR_OK;
+}
+
+WERROR dsdb_verify_oid_mappings_drsuapi(const struct dsdb_schema *schema, 
const struct drsuapi_DsReplicaOIDMapping_Ctr *ctr)
+{
uint32_t i,j;
 
for (i=0; i  ctr-num_mappings; i++) {

Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c
===
--- branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c  2007-01-13 
15:28:24 UTC (rev 20732)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c  2007-01-13 
15:29:47 UTC (rev 20733)
@@ -456,12 +456,12 @@
s-schema = talloc_zero(s, struct dsdb_schema);
NT_STATUS_HAVE_NO_MEMORY(s-schema);
 
-   status = dsdb_load_oid_mappings(s-schema, mapping_ctr);
+   status = dsdb_load_oid_mappings_drsuapi(s-schema, mapping_ctr);
if (!W_ERROR_IS_OK(status)) {
return werror_to_ntstatus(status);
}
} else {
-   status = dsdb_verify_oid_mappings(s-schema, mapping_ctr);
+   status = dsdb_verify_oid_mappings_drsuapi(s-schema, 
mapping_ctr);
if (!W_ERROR_IS_OK(status)) {
return werror_to_ntstatus(status);
}



svn commit: samba r20734 - in branches/SAMBA_4_0/source/lib/util: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:39:49 + (Sat, 13 Jan 2007)
New Revision: 20734

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20734

Log:
always terminate the string... so that an empty data_blob
gets '\0' as  string

metze
Modified:
   branches/SAMBA_4_0/source/lib/util/data_blob.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/util/data_blob.c
===
--- branches/SAMBA_4_0/source/lib/util/data_blob.c  2007-01-13 15:29:47 UTC 
(rev 20733)
+++ branches/SAMBA_4_0/source/lib/util/data_blob.c  2007-01-13 15:39:49 UTC 
(rev 20734)
@@ -163,6 +163,7 @@
for (i = 0; i  blob-length; i++)
slprintf(hex_string[i*2], 3, %02X, blob-data[i]);
 
+   hex_string[(blob-length*2)] = '\0';
return hex_string;
 }
 



svn commit: samba r20735 - in branches/SAMBA_4_0/source/torture/ldap: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:40:33 + (Sat, 13 Jan 2007)
New Revision: 20735

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20735

Log:
print out a headline and the oMObjectClass

metze
Modified:
   branches/SAMBA_4_0/source/torture/ldap/schema.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/ldap/schema.c
===
--- branches/SAMBA_4_0/source/torture/ldap/schema.c 2007-01-13 15:39:49 UTC 
(rev 20734)
+++ branches/SAMBA_4_0/source/torture/ldap/schema.c 2007-01-13 15:40:33 UTC 
(rev 20735)
@@ -339,12 +339,23 @@
2.5.5.17
};
 
+   d_printf(Dumping attribute syntaxes\n);
+
for (i=0; i  ARRAY_SIZE(syntaxes); i++) {
for (a=schema-attributes; a; a = a-next) {
+   char *om_hex;
+
if (strcmp(syntaxes[i], a-attributeSyntax_oid) != 0) 
continue;
-   d_printf(attr[%4u]: %s %u '%s'\n, a_i++,
+
+   om_hex = data_blob_hex_string(ldb, a-oMObjectClass);
+   if (!om_hex) {
+   return False;
+   }
+
+   d_printf(attr[%4u]: %s %u '%s' '%s'\n, a_i++,
 a-attributeSyntax_oid, a-oMSyntax,
-a-lDAPDisplayName);
+om_hex, a-lDAPDisplayName);
+   talloc_free(om_hex);
}
}
 



svn commit: samba r20736 - in branches/SAMBA_4_0/source/torture/nbt: .

2007-01-13 Thread metze
Author: metze
Date: 2007-01-13 15:49:32 + (Sat, 13 Jan 2007)
New Revision: 20736

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20736

Log:
skip the NBT-WINSREPLICATION-OWNED test in make quicktest

metze
Modified:
   branches/SAMBA_4_0/source/torture/nbt/winsreplication.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
===
--- branches/SAMBA_4_0/source/torture/nbt/winsreplication.c 2007-01-13 
15:40:33 UTC (rev 20735)
+++ branches/SAMBA_4_0/source/torture/nbt/winsreplication.c 2007-01-13 
15:49:32 UTC (rev 20736)
@@ -9652,6 +9652,11 @@
bool ret = true;
struct test_wrepl_conflict_conn *ctx;
 
+   if (lp_parm_bool(-1, torture, quick, False)) {
+   printf(skip NBT-WINSREPLICATION-OWNED test in quick test 
mode\n);
+   return true;
+   }
+
if (!torture_nbt_get_name(tctx, name, address))
return false;
 



svn commit: samba r20737 - in branches/SAMBA_4_0/source/script/tests: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-13 16:08:58 + (Sat, 13 Jan 2007)
New Revision: 20737

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20737

Log:
Add option parsing.

Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.pl


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl
===
--- branches/SAMBA_4_0/source/script/tests/selftest.pl  2007-01-13 15:49:32 UTC 
(rev 20736)
+++ branches/SAMBA_4_0/source/script/tests/selftest.pl  2007-01-13 16:08:58 UTC 
(rev 20737)
@@ -7,6 +7,7 @@
 
 use FindBin qw($RealBin $Script);
 use File::Spec;
+use Getopt::Long;
 use POSIX;
 use Cwd;
 
@@ -91,8 +92,36 @@
exit $failed;
 }
 
-die(Usage: $Script PREFIX TESTS [SOCKET_WRAPPER]) if ( $#ARGV == -1);
+sub ShowHelp()
+{
+   print Samba test runner
+Copyright (C) Jelmer Vernooij [EMAIL PROTECTED]
 
+Usage: $Script PREFIX TESTS [SOCKET_WRAPPER]
+
+Generic options:
+ --help this help page
+ --target=samba4|samba3 Samba version to target
+
+;
+   exit(0);
+}
+
+my $opt_help = 0;
+my $opt_target = samba4;
+
+my $result = GetOptions (
+   'help|h|?' = \$opt_help,
+   'target' = \$opt_target
+   );
+
+if (not $result) {
+   exit(1);
+}
+
+ShowHelp() if ($opt_help);
+ShowHelp() if ($#ARGV = 0);
+
 my $prefix = shift;
 my $tests = shift;
 my $socket_wrapper = shift;
@@ -160,14 +189,14 @@
print NOT USING SOCKET_WRAPPER\n;
 }
 
-#Start slapd before smbd
+# Start slapd before smbd
 if ($ldap) {
 slapd_start($ENV{SLAPD_CONF}, $ENV{LDAPI_ESCAPE}) or die(couldn't start 
slapd);
 print LDAP PROVISIONING...;
 system($bindir/smbscript $setupdir/provision $ENV{PROVISION_OPTIONS} 
--ldap-backend=$ENV{LDAPI}) or
die(LDAP PROVISIONING failed: $bindir/smbscript 
$setupdir/provision $ENV{PROVISION_OPTIONS} --ldap-backend=$ENV{LDAPI});
 
-#LDAP is slow
+# LDAP is slow
$torture_maxtime *= 2;
 }
 
@@ -189,7 +218,7 @@
 my @torture_options = (--option=interfaces=$ENV{TORTURE_INTERFACES} 
$ENV{CONFIGURATION});
 # ensure any one smbtorture call doesn't run too long
 push (@torture_options, --maximum-runtime=$torture_maxtime);
-push (@torture_options, --target=samba4);
+push (@torture_options, --target=$opt_target);
 push (@torture_options, --option=torture:progress=no) 
if (defined($ENV{RUN_FROM_BUILD_FARM}) and $ENV{RUN_FROM_BUILD_FARM} eq 
yes);
 



svn commit: samba r20738 - in branches/SAMBA_3_0/source/nsswitch: .

2007-01-13 Thread vlendec
Author: vlendec
Date: 2007-01-13 19:55:37 + (Sat, 13 Jan 2007)
New Revision: 20738

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20738

Log:
Remove unused variable
Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h   2007-01-13 16:08:58 UTC 
(rev 20737)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h   2007-01-13 19:55:37 UTC 
(rev 20738)
@@ -485,7 +485,6 @@
uid_t uid;
time_t create_time;
time_t renew_until;
-   BOOL refresh_tgt;
time_t refresh_time;
struct timed_event *event;
 };



Rev 11142: Ignore some more files. in file:///home/jelmer/bzr.samba/4.0-regwrite/

2007-01-13 Thread Jelmer Vernooij

revno: 11142
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: 4.0-regwrite
timestamp: Sat 2007-01-13 20:54:31 +0100
message:
  Ignore some more files.
modified:
  .bzrignore svn-v2:[EMAIL PROTECTED]
=== modified file '.bzrignore'
--- a/.bzrignore2006-10-29 17:40:19 +
+++ b/.bzrignore2007-01-13 19:54:31 +
@@ -132,3 +132,16 @@
 source/winbind/wb_proto.h
 source/wrepl_server/wrepl_server_proto.h
 tags
+webapps/swat/build
+webapps/qooxdoo-0.6.3-sdk/frontend/framework/.cache
+source/torture/rap/proto.h
+*_asn1.h
+*_asn1_files
+*_proto.h
+source/heimdal/lib/hx509/asn1_*.c
+*_err.h
+*_err.c
+source/smbd/pidfile.h
+source/ntvfs/cifs_posix_cli/proto.h
+source/lib/util/util_tdb.h
+source/lib/cmdline/popt_credentials.h



Rev 11141: Initial work on .adm file parser by Wilco Baan Hofman [EMAIL PROTECTED] and me. in file:///home/jelmer/bzr.samba/4.0-regwrite/

2007-01-13 Thread Jelmer Vernooij

revno: 11141
revision-id: [EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: 4.0-regwrite
timestamp: Sat 2007-01-13 20:50:19 +0100
message:
  Initial work on .adm file parser by Wilco Baan Hofman [EMAIL PROTECTED] and 
me.
added:
  source/lib/policy/ policy-20070113165253-mfj7irct13ujxegu-1
  source/lib/policy/config.mkconfig.mk-20070113165302-5amgbz764f0myhw9-1
  source/lib/policy/dumpadm.cdumpadm.c-20070113165302-5amgbz764f0myhw9-2
  source/lib/policy/lex.llex.l-20070113165302-5amgbz764f0myhw9-3
  source/lib/policy/parse_adm.y  parse_adm.y-20070113165302-5amgbz764f0myhw9-4
modified:
  source/lib/basic.mksvn-v2:[EMAIL PROTECTED]
  source/script/lex_compile.sh   svn-v2:[EMAIL PROTECTED]
=== added directory 'source/lib/policy'
=== added file 'source/lib/policy/config.mk'
--- a/source/lib/policy/config.mk   1970-01-01 00:00:00 +
+++ b/source/lib/policy/config.mk   2007-01-13 19:50:19 +
@@ -0,0 +1,11 @@
+[LIBRARY::LIBPOLICY]
+CFLAGS = -Iheimdal/lib/roken
+OBJ_FILES = lex.o parse_adm.o
+
+lib/policy/lex.c: lib/policy/lex.l
+   @echo Building $ with $(LEX)
+   @-$(srcdir)/script/lex_compile.sh $(LEX) $ $@ -i
+
+[BINARY::dumpadm]
+OBJ_FILES = dumpadm.o
+PRIVATE_DEPENDENCIES = LIBPOLICY

=== added file 'source/lib/policy/dumpadm.c'
--- a/source/lib/policy/dumpadm.c   1970-01-01 00:00:00 +
+++ b/source/lib/policy/dumpadm.c   2007-01-13 19:50:19 +
@@ -0,0 +1,35 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Copyright (C) 2006 Wilco Baan Hofman [EMAIL PROTECTED]
+   Copyright (C) 2006 Jelmer Vernooij [EMAIL PROTECTED]
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include includes.h
+#include lib/policy/parse_adm.h
+
+extern FILE *yyin;
+
+extern void yyparse(void);
+
+int main(int argc, char **argv) 
+{
+   yyin = fopen(foo.adm, r);
+   if (yyin == NULL)
+   return -1;
+
+   yyparse();
+}

=== added file 'source/lib/policy/lex.l'
--- a/source/lib/policy/lex.l   1970-01-01 00:00:00 +
+++ b/source/lib/policy/lex.l   2007-01-13 19:50:19 +
@@ -0,0 +1,143 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Copyright (C) 2006 Wilco Baan Hofman [EMAIL PROTECTED]
+   Copyright (C) 2006 Jelmer Vernooij [EMAIL PROTECTED]
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+
+%{
+#include includes.h
+#include lib/policy/parse_adm.h
+#include lex.h
+void error_message (const char *format, ...);
+int yyparse (void);
+
+static int lineno = 1;
+static bool utf16 = false;
+
+#define YY_INPUT(buf,result,max_size) \
+{ \
+   if (utf16) { \
+   uint16_t v; \
+   if (fread(v, 2, 1, yyin)  1) \
+   result = YY_NULL; \
+   else \
+   result = push_codepoint(buf, v); \
+   } else { \
+   int c = getc(yyin); \
+   result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
+   } \
+}
+
+%}
+
+%%
+
+ACTIONLIST { return ACTIONLIST; }
+CATEGORY { return CATEGORY; }
+CHECKBOX { return CHECKBOX; }
+CLASS { return CLASS; }
+DELETE { return DEL; }
+DEFAULT { return DEFAULT; }
+DROPDOWNLIST { return DROPDOWNLIST; }
+EDITTEXT { return EDITTEXT; }
+END { return END; }
+EXPLAIN { return EXPLAIN; }
+ITEMLIST { return ITEMLIST; }
+KEYNAME { return KEYNAME; }
+MACHINE { return MACHINE; }
+MIN { return MINIMUM; }
+MAX { return MAXIMUM; }
+NAME { return NAME; }
+NUMERIC { return NUMERIC; }
+PART { return PART; }
+POLICY { return POLICY; }
+REQUIRED { return REQUIRED; }
+SPIN { return SPIN; }
+SUPPORTED { 

svn commit: samba r20740 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_24/source/smbd

2007-01-13 Thread vlendec
Author: vlendec
Date: 2007-01-13 20:26:53 + (Sat, 13 Jan 2007)
New Revision: 20740

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20740

Log:
Get rid of some if-statements
Modified:
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0_24/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-13 20:02:10 UTC (rev 
20739)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-13 20:26:53 UTC (rev 
20740)
@@ -45,18 +45,16 @@
 /
 
 NTSTATUS check_path_syntax_internal(pstring destname,
-   const pstring srcname,
-   BOOL windows_path, BOOL
-   *p_last_component_contains_wcard)
+   const pstring srcname,
+   BOOL windows_path,
+   BOOL *p_last_component_contains_wcard)
 {
char *d = destname;
const char *s = srcname;
NTSTATUS ret = NT_STATUS_OK;
BOOL start_of_name_component = True;
 
-   if (p_last_component_contains_wcard) {
-   *p_last_component_contains_wcard = False;
-   }
+   *p_last_component_contains_wcard = False;
 
while (*s) {
if (IS_DIRECTORY_SEP(*s)) {
@@ -74,9 +72,7 @@
 
start_of_name_component = True;
/* New component. */
-   if (p_last_component_contains_wcard) {
-   *p_last_component_contains_wcard = False;
-   }
+   *p_last_component_contains_wcard = False;
continue;
}
 
@@ -132,9 +128,7 @@
case '':
case '':
case '':
-   if 
(p_last_component_contains_wcard) {
-   
*p_last_component_contains_wcard = True;
-   }
+   
*p_last_component_contains_wcard = True;
break;
default:
break;
@@ -181,7 +175,8 @@
 
 NTSTATUS check_path_syntax(pstring destname, const pstring srcname)
 {
-   return check_path_syntax_internal(destname, srcname, True, NULL);
+   BOOL ignore;
+   return check_path_syntax_internal(destname, srcname, True, ignore);
 }
 
 /
@@ -203,7 +198,8 @@
 
 static NTSTATUS check_path_syntax_posix(pstring destname, const pstring 
srcname)
 {
-   return check_path_syntax_internal(destname, srcname, False, NULL);
+   BOOL ignore;
+   return check_path_syntax_internal(destname, srcname, False, ignore);
 }
 
 /

Modified: branches/SAMBA_3_0_24/source/smbd/reply.c
===
--- branches/SAMBA_3_0_24/source/smbd/reply.c   2007-01-13 20:02:10 UTC (rev 
20739)
+++ branches/SAMBA_3_0_24/source/smbd/reply.c   2007-01-13 20:26:53 UTC (rev 
20740)
@@ -45,18 +45,16 @@
 /
 
 NTSTATUS check_path_syntax_internal(pstring destname,
-   const pstring srcname,
-   BOOL windows_path, BOOL
-   *p_last_component_contains_wcard)
+   const pstring srcname,
+   BOOL windows_path,
+   BOOL *p_last_component_contains_wcard)
 {
char *d = destname;
const char *s = srcname;
NTSTATUS ret = NT_STATUS_OK;
BOOL start_of_name_component = True;
 
-   if (p_last_component_contains_wcard) {
-   *p_last_component_contains_wcard = False;
-   }
+   *p_last_component_contains_wcard = False;
 
while (*s) {
if (IS_DIRECTORY_SEP(*s)) {
@@ -74,9 +72,7 @@
 
start_of_name_component = True;
/* New component. */
-   if (p_last_component_contains_wcard) {
-   *p_last_component_contains_wcard = False;
-   }
+   *p_last_component_contains_wcard = False;
continue;
}
 
@@ -132,9 +128,7 @@
case '':
   

svn commit: samba r20741 - in branches/SAMBA_3_0_24/source/nsswitch: .

2007-01-13 Thread jra
Author: jra
Date: 2007-01-13 20:44:59 + (Sat, 13 Jan 2007)
New Revision: 20741

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20741

Log:
Janitor for Volker, it's unused here as well :-).
Jeremy.

Modified:
   branches/SAMBA_3_0_24/source/nsswitch/winbindd_nss.h


Changeset:
Modified: branches/SAMBA_3_0_24/source/nsswitch/winbindd_nss.h
===
--- branches/SAMBA_3_0_24/source/nsswitch/winbindd_nss.h2007-01-13 
20:26:53 UTC (rev 20740)
+++ branches/SAMBA_3_0_24/source/nsswitch/winbindd_nss.h2007-01-13 
20:44:59 UTC (rev 20741)
@@ -479,7 +479,6 @@
uid_t uid;
time_t create_time;
time_t renew_until;
-   BOOL refresh_tgt;
time_t refresh_time;
struct timed_event *event;
 };



svn commit: samba r20742 - in branches: SAMBA_3_0/source/include SAMBA_3_0/source/smbd SAMBA_3_0_24/source/include SAMBA_3_0_24/source/smbd

2007-01-13 Thread jra
Author: jra
Date: 2007-01-13 22:10:18 + (Sat, 13 Jan 2007)
New Revision: 20742

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20742

Log:
Rename chkpth - checkpath for sanity's sake :-).
Start removing unneeded BOOL ok from this reply.c
(this logic is old, old, old. :-).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/include/smb.h
   branches/SAMBA_3_0/source/include/smbprofile.h
   branches/SAMBA_3_0/source/smbd/process.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0_24/source/include/smb.h
   branches/SAMBA_3_0_24/source/include/smbprofile.h
   branches/SAMBA_3_0_24/source/smbd/process.c
   branches/SAMBA_3_0_24/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/smb.h
===
--- branches/SAMBA_3_0/source/include/smb.h 2007-01-13 20:44:59 UTC (rev 
20741)
+++ branches/SAMBA_3_0/source/include/smb.h 2007-01-13 22:10:18 UTC (rev 
20742)
@@ -943,7 +943,7 @@
 #define SMBunlock 0x0D   /* unlock byte range */
 #define SMBctemp  0x0E   /* create temporary file */
 #define SMBmknew  0x0F   /* make new file */
-#define SMBchkpth 0x10   /* check directory path */
+#define SMBcheckpath  0x10   /* check directory path */
 #define SMBexit   0x11   /* process exit */
 #define SMBlseek  0x12   /* seek */
 #define SMBtcon   0x70   /* tree connect */

Modified: branches/SAMBA_3_0/source/include/smbprofile.h
===
--- branches/SAMBA_3_0/source/include/smbprofile.h  2007-01-13 20:44:59 UTC 
(rev 20741)
+++ branches/SAMBA_3_0/source/include/smbprofile.h  2007-01-13 22:10:18 UTC 
(rev 20742)
@@ -266,9 +266,9 @@
 #define SMBmknew_count __profile_stats_value(PR_VALUE_SMBMKNEW, count)
 #define SMBmknew_time __profile_stats_value(PR_VALUE_SMBMKNEW, time)
 
-   PR_VALUE_SMBCHKPTH,
-#define SMBchkpth_count __profile_stats_value(PR_VALUE_SMBCHKPTH, count)
-#define SMBchkpth_time __profile_stats_value(PR_VALUE_SMBCHKPTH, time)
+   PR_VALUE_SMBCHECKPATH,
+#define SMBcheckpath_count __profile_stats_value(PR_VALUE_SMBCHECKPATH, count)
+#define SMBcheckpath_time __profile_stats_value(PR_VALUE_SMBCHECKPATH, time)
 
PR_VALUE_SMBEXIT,
 #define SMBexit_count __profile_stats_value(PR_VALUE_SMBEXIT, count)

Modified: branches/SAMBA_3_0/source/smbd/process.c
===
--- branches/SAMBA_3_0/source/smbd/process.c2007-01-13 20:44:59 UTC (rev 
20741)
+++ branches/SAMBA_3_0/source/smbd/process.c2007-01-13 22:10:18 UTC (rev 
20742)
@@ -620,7 +620,7 @@
 /* 0x0d */ { SMBunlock,reply_unlock,AS_USER},
 /* 0x0e */ { SMBctemp,reply_ctemp,AS_USER },
 /* 0x0f */ { SMBmknew,reply_mknew,AS_USER}, 
-/* 0x10 */ { SMBchkpth,reply_chkpth,AS_USER},
+/* 0x10 */ { SMBcheckpath,reply_checkpath,AS_USER},
 /* 0x11 */ { SMBexit,reply_exit,DO_CHDIR},
 /* 0x12 */ { SMBlseek,reply_lseek,AS_USER},
 /* 0x13 */ { SMBlockread,reply_lockread,AS_USER},

Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-13 20:44:59 UTC (rev 
20741)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-13 22:10:18 UTC (rev 
20742)
@@ -596,57 +596,58 @@
 }
 
 /
- Reply to a chkpth.
+ Strange checkpath NTSTATUS mapping.
 /
 
-int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int 
dum_size, int dum_buffsize)
+static NTSTATUS map_checkpath_error(const char *inbuf, NTSTATUS status)
 {
+   /* Strange DOS error code semantics only for checkpath... */
+   if (!(SVAL(inbuf,smb_flg2)  FLAGS2_32_BIT_ERROR_CODES)) {
+   if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,status)) {
+   /* We need to map to ERRbadpath */
+   return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+   }
+   }
+   return status;
+}
+   
+/
+ Reply to a checkpath.
+/
+
+int reply_checkpath(connection_struct *conn, char *inbuf,char *outbuf, int 
dum_size, int dum_buffsize)
+{
int outsize = 0;
pstring name;
-   BOOL ok = False;
SMB_STRUCT_STAT sbuf;
NTSTATUS status;
 
-   START_PROFILE(SMBchkpth);
+   START_PROFILE(SMBcheckpath);
 
srvstr_get_path(inbuf, name, smb_buf(inbuf) + 1, sizeof(name), 0, 
STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
-   END_PROFILE(SMBchkpth);
-
-   /* Strange DOS error code semantics only for chkpth... */
-   if (!(SVAL(inbuf,smb_flg2)  FLAGS2_32_BIT_ERROR_CODES)) {
- 

svn commit: samba r20743 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_24/source/smbd

2007-01-13 Thread jra
Author: jra
Date: 2007-01-13 22:22:32 + (Sat, 13 Jan 2007)
New Revision: 20743

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20743

Log:
Remove another BOOL ok from reply_getatr.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0_24/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===
--- branches/SAMBA_3_0/source/smbd/reply.c  2007-01-13 22:10:18 UTC (rev 
20742)
+++ branches/SAMBA_3_0/source/smbd/reply.c  2007-01-13 22:22:32 UTC (rev 
20743)
@@ -684,7 +684,6 @@
pstring fname;
int outsize = 0;
SMB_STRUCT_STAT sbuf;
-   BOOL ok = False;
int mode=0;
SMB_OFF_T size=0;
time_t mtime=0;
@@ -704,38 +703,34 @@
   
/* dos smetimes asks for a stat of  - it returns a hidden directory
under WfWg - weird! */
-   if (! (*fname)) {
+   if (*fname == '\0') {
mode = aHIDDEN | aDIR;
-   if (!CAN_WRITE(conn))
+   if (!CAN_WRITE(conn)) {
mode |= aRONLY;
+   }
size = 0;
mtime = 0;
-   ok = True;
} else {
status = unix_convert(conn, fname, False, NULL,sbuf);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBgetatr);
return ERROR_NT(status);
}
-   if (check_name(fname,conn)) {
-   if (VALID_STAT(sbuf) || SMB_VFS_STAT(conn,fname,sbuf) 
== 0) {
-   mode = dos_mode(conn,fname,sbuf);
-   size = sbuf.st_size;
-   mtime = sbuf.st_mtime;
-   if (mode  aDIR)
-   size = 0;
-   ok = True;
-   } else {
-   DEBUG(3,(stat of %s failed 
(%s)\n,fname,strerror(errno)));
+   if (check_name(fname,conn) 
+   (VALID_STAT(sbuf) || 
SMB_VFS_STAT(conn,fname,sbuf) == 0)) {
+   mode = dos_mode(conn,fname,sbuf);
+   size = sbuf.st_size;
+   mtime = sbuf.st_mtime;
+   if (mode  aDIR) {
+   size = 0;
}
+   } else {
+   DEBUG(3,(reply_getatr: stat of %s failed 
(%s)\n,fname,strerror(errno)));
+   END_PROFILE(SMBgetatr);
+   return UNIXERROR(ERRDOS,ERRbadfile);
}
}
   
-   if (!ok) {
-   END_PROFILE(SMBgetatr);
-   return UNIXERROR(ERRDOS,ERRbadfile);
-   }
- 
outsize = set_message(outbuf,10,0,True);
 
SSVAL(outbuf,smb_vwv0,mode);
@@ -750,7 +745,7 @@
SSVAL(outbuf,smb_flg2,SVAL(outbuf, smb_flg2) | 
FLAGS2_IS_LONG_NAME);
}
   
-   DEBUG( 3, ( getatr name=%s mode=%d size=%d\n, fname, mode, 
(uint32)size ) );
+   DEBUG(3,(reply_getatr: name=%s mode=%d size=%u\n, fname, mode, 
(unsigned int)size ) );
   
END_PROFILE(SMBgetatr);
return(outsize);

Modified: branches/SAMBA_3_0_24/source/smbd/reply.c
===
--- branches/SAMBA_3_0_24/source/smbd/reply.c   2007-01-13 22:10:18 UTC (rev 
20742)
+++ branches/SAMBA_3_0_24/source/smbd/reply.c   2007-01-13 22:22:32 UTC (rev 
20743)
@@ -684,7 +684,6 @@
pstring fname;
int outsize = 0;
SMB_STRUCT_STAT sbuf;
-   BOOL ok = False;
int mode=0;
SMB_OFF_T size=0;
time_t mtime=0;
@@ -704,38 +703,34 @@
   
/* dos smetimes asks for a stat of  - it returns a hidden directory
under WfWg - weird! */
-   if (! (*fname)) {
+   if (*fname == '\0') {
mode = aHIDDEN | aDIR;
-   if (!CAN_WRITE(conn))
+   if (!CAN_WRITE(conn)) {
mode |= aRONLY;
+   }
size = 0;
mtime = 0;
-   ok = True;
} else {
status = unix_convert(conn, fname, False, NULL,sbuf);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBgetatr);
return ERROR_NT(status);
}
-   if (check_name(fname,conn)) {
-   if (VALID_STAT(sbuf) || SMB_VFS_STAT(conn,fname,sbuf) 
== 0) {
-   mode = dos_mode(conn,fname,sbuf);
-   size = sbuf.st_size;
-   mtime = sbuf.st_mtime;
-   if (mode  aDIR)
-   size = 0;
-   ok = True;
-   } else {
-   

svn commit: samba r20744 - in branches: SAMBA_3_0/source/libsmb SAMBA_3_0/source/profile SAMBA_3_0/source/utils SAMBA_3_0_24/source/libsmb SAMBA_3_0_24/source/profile SAMBA_3_0_24/source/utils

2007-01-13 Thread jra
Author: jra
Date: 2007-01-13 22:26:46 + (Sat, 13 Jan 2007)
New Revision: 20744

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20744

Log:
Fix the build (I missed some chkpth - checkpath renames).
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libsmb/clifile.c
   branches/SAMBA_3_0/source/profile/profile.c
   branches/SAMBA_3_0/source/utils/status_profile.c
   branches/SAMBA_3_0_24/source/libsmb/clifile.c
   branches/SAMBA_3_0_24/source/profile/profile.c
   branches/SAMBA_3_0_24/source/utils/status_profile.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/clifile.c
===
--- branches/SAMBA_3_0/source/libsmb/clifile.c  2007-01-13 22:22:32 UTC (rev 
20743)
+++ branches/SAMBA_3_0/source/libsmb/clifile.c  2007-01-13 22:26:46 UTC (rev 
20744)
@@ -1372,7 +1372,7 @@

memset(cli-outbuf,'\0',smb_size);
set_message(cli-outbuf,0,0,True);
-   SCVAL(cli-outbuf,smb_com,SMBchkpth);
+   SCVAL(cli-outbuf,smb_com,SMBcheckpath);
SSVAL(cli-outbuf,smb_tid,cli-cnum);
cli_setup_packet(cli);
p = smb_buf(cli-outbuf);

Modified: branches/SAMBA_3_0/source/profile/profile.c
===
--- branches/SAMBA_3_0/source/profile/profile.c 2007-01-13 22:22:32 UTC (rev 
20743)
+++ branches/SAMBA_3_0/source/profile/profile.c 2007-01-13 22:26:46 UTC (rev 
20744)
@@ -312,7 +312,7 @@
SMBunlock,/* PR_VALUE_SMBUNLOCK */
SMBctemp, /* PR_VALUE_SMBCTEMP */
SMBmknew, /* PR_VALUE_SMBMKNEW */
-   SMBchkpth,/* PR_VALUE_SMBCHKPTH */
+   SMBcheckpath, /* PR_VALUE_SMBCHECKPATH */
SMBexit,  /* PR_VALUE_SMBEXIT */
SMBlseek, /* PR_VALUE_SMBLSEEK */
SMBlockread,  /* PR_VALUE_SMBLOCKREAD */

Modified: branches/SAMBA_3_0/source/utils/status_profile.c
===
--- branches/SAMBA_3_0/source/utils/status_profile.c2007-01-13 22:22:32 UTC 
(rev 20743)
+++ branches/SAMBA_3_0/source/utils/status_profile.c2007-01-13 22:26:46 UTC 
(rev 20744)
@@ -181,8 +181,8 @@
d_printf(ctemp_time: %u\n, 
profile_p-SMBctemp_time);
d_printf(mknew_count:%u\n, 
profile_p-SMBmknew_count);
d_printf(mknew_time: %u\n, 
profile_p-SMBmknew_time);
-   d_printf(chkpth_count:   %u\n, 
profile_p-SMBchkpth_count);
-   d_printf(chkpth_time:%u\n, 
profile_p-SMBchkpth_time);
+   d_printf(checkpath_count:%u\n, 
profile_p-SMBcheckpath_count);
+   d_printf(checkpath_time: %u\n, 
profile_p-SMBcheckpath_time);
d_printf(exit_count: %u\n, 
profile_p-SMBexit_count);
d_printf(exit_time:  %u\n, 
profile_p-SMBexit_time);
d_printf(lseek_count:%u\n, 
profile_p-SMBlseek_count);

Modified: branches/SAMBA_3_0_24/source/libsmb/clifile.c
===
--- branches/SAMBA_3_0_24/source/libsmb/clifile.c   2007-01-13 22:22:32 UTC 
(rev 20743)
+++ branches/SAMBA_3_0_24/source/libsmb/clifile.c   2007-01-13 22:26:46 UTC 
(rev 20744)
@@ -1381,7 +1381,7 @@

memset(cli-outbuf,'\0',smb_size);
set_message(cli-outbuf,0,0,True);
-   SCVAL(cli-outbuf,smb_com,SMBchkpth);
+   SCVAL(cli-outbuf,smb_com,SMBcheckpath);
SSVAL(cli-outbuf,smb_tid,cli-cnum);
cli_setup_packet(cli);
p = smb_buf(cli-outbuf);

Modified: branches/SAMBA_3_0_24/source/profile/profile.c
===
--- branches/SAMBA_3_0_24/source/profile/profile.c  2007-01-13 22:22:32 UTC 
(rev 20743)
+++ branches/SAMBA_3_0_24/source/profile/profile.c  2007-01-13 22:26:46 UTC 
(rev 20744)
@@ -312,7 +312,7 @@
SMBunlock,/* PR_VALUE_SMBUNLOCK */
SMBctemp, /* PR_VALUE_SMBCTEMP */
SMBmknew, /* PR_VALUE_SMBMKNEW */
-   SMBchkpth,/* PR_VALUE_SMBCHKPTH */
+   SMBcheckpath, /* PR_VALUE_SMBCHECKPATH */
SMBexit,  /* PR_VALUE_SMBEXIT */
SMBlseek, /* PR_VALUE_SMBLSEEK */
SMBlockread,  /* PR_VALUE_SMBLOCKREAD */

Modified: branches/SAMBA_3_0_24/source/utils/status_profile.c
===
--- branches/SAMBA_3_0_24/source/utils/status_profile.c 2007-01-13 22:22:32 UTC 
(rev 20743)
+++ branches/SAMBA_3_0_24/source/utils/status_profile.c 2007-01-13 22:26:46 UTC 
(rev 20744)
@@ -181,8 +181,8 @@
d_printf(ctemp_time: %u\n, 
profile_p-SMBctemp_time);
d_printf(mknew_count:%u\n, 

Build status as of Sun Jan 14 00:00:02 2007

2007-01-13 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-01-13 
00:00:51.0 +
+++ /home/build/master/cache/broken_results.txt 2007-01-14 00:00:48.0 
+
@@ -1,4 +1,4 @@
-Build status as of Sat Jan 13 00:00:03 2007
+Build status as of Sun Jan 14 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -7,16 +7,16 @@
 ccache   35 7  0 
 ctdb 0  0  0 
 distcc   2  0  0 
-ldb  34 2  0 
+ldb  33 3  0 
 libreplace   32 2  0 
-lorikeet-heimdal 31 18 0 
-ppp  17 0  0 
+lorikeet-heimdal 31 17 0 
+ppp  16 0  0 
 rsync35 3  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   33 14 0 
-samba_3_035 9  0 
+samba4   32 13 0 
+samba_3_034 30 0 
 smb-build32 2  0 
 talloc   35 0  0 
-tdb  33 2  0 
+tdb  34 2  0 
 


svn commit: samba r20745 - in branches/SAMBA_3_0: packaging/Solaris source/po

2007-01-13 Thread idra
Author: idra
Date: 2007-01-14 00:08:31 + (Sun, 14 Jan 2007)
New Revision: 20745

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20745

Log:

Commit Finnish transalation of SWAT after review


Added:
   branches/SAMBA_3_0/source/po/fi.msg
Modified:
   branches/SAMBA_3_0/packaging/Solaris/makepkg.sh


Changeset:
Sorry, the patch is too large (630 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20745


svn commit: samba r20746 - in branches/SAMBA_4_0: source/pidl/lib/Parse/Pidl source/script/tests testprogs testprogs/blackbox

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 01:33:16 + (Sun, 14 Jan 2007)
New Revision: 20746

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20746

Log:
Don't report each individual test in test_smbclient as a single testsuite. 
Create separate directory for blackbox tests.

Added:
   branches/SAMBA_4_0/testprogs/blackbox/
   branches/SAMBA_4_0/testprogs/blackbox/test_smbclient.sh
Removed:
   branches/SAMBA_4_0/source/script/tests/test_smbclient.sh
Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Expr.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/IDL.pm
   branches/SAMBA_4_0/source/script/tests/tests_all.sh


Changeset:
Sorry, the patch is too large (1089 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20746


svn commit: samba r20747 - in branches/SAMBA_4_0: source/script/tests testprogs/blackbox

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 01:39:34 + (Sun, 14 Jan 2007)
New Revision: 20747

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20747

Log:
Move cifsdd to blackbox section
Added:
   branches/SAMBA_4_0/testprogs/blackbox/test_cifsdd.sh
Removed:
   branches/SAMBA_4_0/source/script/tests/test_cifsdd.sh
Modified:
   branches/SAMBA_4_0/source/script/tests/tests_all.sh


Changeset:
Deleted: branches/SAMBA_4_0/source/script/tests/test_cifsdd.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_cifsdd.sh   2007-01-14 
01:33:16 UTC (rev 20746)
+++ branches/SAMBA_4_0/source/script/tests/test_cifsdd.sh   2007-01-14 
01:39:34 UTC (rev 20747)
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# Basic script to make sure that cifsdd can do both local and remote I/O.
-
-if [ $# -lt 4 ]; then
-cat EOF
-Usage: test_cifsdd.sh SERVER USERNAME PASSWORD DOMAIN
-EOF
-exit 1;
-fi
-
-SERVER=$1
-USERNAME=$2
-PASSWORD=$3
-DOMAIN=$4
-
-DD=bin/cifsdd
-
-SHARE=tmp
-DEBUGLEVEL=1
-
-failed=0
-
-failtest() {
-   failed=`expr $failed + 1`
-}
-
-runcopy() {
-   message=$1
-   shift
-   
-   testit $message $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL 
-W $DOMAIN -U $USERNAME%$PASSWORD \
-   $@
-}
-
-compare() {
-cmp $1 $2
-}
-
-incdir=`dirname $0`
-. $incdir/test_functions.sh
-
-sourcepath=tempfile.src.$$
-destpath=tempfile.dst.$$
-
-# Create a source file with arbitrary contents
-dd if=$DD of=$sourcepath bs=1024 count=50  /dev/null
-
-ls -l $sourcepath
-
-for bs in 512 4k 48k ; do
-
-echo Testing $bs block size ...
-
-# Check whether we can do local IO
-runcopy Testing local - local copy if=$sourcepath of=$destpath bs=$bs || 
failtest
-compare $sourcepath $destpath || failtest
-
-# Check whether we can do a round trip
-runcopy Testing local - remote copy \
-   if=$sourcepath of=//$SERVER/$SHARE/$sourcepath bs=$bs || failtest
-runcopy Testing remote - local copy \
-   if=//$SERVER/$SHARE/$sourcepath of=$destpath bs=$bs || failtest
-compare $sourcepath $destpath || failtest
-
-# Check that copying within the remote server works
-runcopy Testing local - remote copy \
-   if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$sourcepath 
bs=$bs || failtest
-runcopy Testing remote - remote copy \
-   if=//$SERVER/$SHARE/$sourcepath of=//$SERVER/$SHARE/$destpath 
bs=$bs || failtest
-runcopy Testing remote - local copy \
-   if=//$SERVER/$SHARE/$destpath of=$destpath bs=$bs || failtest
-compare $sourcepath $destpath || failtest
-
-done
-
-rm -f $sourcepath $destpath
-
-testok $0 $failed

Modified: branches/SAMBA_4_0/source/script/tests/tests_all.sh
===
--- branches/SAMBA_4_0/source/script/tests/tests_all.sh 2007-01-14 01:33:16 UTC 
(rev 20746)
+++ branches/SAMBA_4_0/source/script/tests/tests_all.sh 2007-01-14 01:39:34 UTC 
(rev 20747)
@@ -10,7 +10,6 @@
  $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN || 
totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD  || 
totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_local.sh || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_pidl.sh || totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN 
$PREFIX || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_cifsdd.sh $SERVER $USERNAME $PASSWORD $DOMAIN || 
totalfailed=`expr $totalfailed + $?`
+ $SRCDIR/script/tests/test_pidl.sh || totalfailed=`expr $totalfailed + $?`
  $SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD  
|| totalfailed=`expr $totalfailed + $?`

Copied: branches/SAMBA_4_0/testprogs/blackbox/test_cifsdd.sh (from rev 20745, 
branches/SAMBA_4_0/source/script/tests/test_cifsdd.sh)
===
--- branches/SAMBA_4_0/source/script/tests/test_cifsdd.sh   2007-01-14 
00:08:31 UTC (rev 20745)
+++ branches/SAMBA_4_0/testprogs/blackbox/test_cifsdd.sh2007-01-14 
01:39:34 UTC (rev 20747)
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# Basic script to make sure that cifsdd can do both local and remote I/O.
+
+if [ $# -lt 4 ]; then
+cat EOF
+Usage: test_cifsdd.sh SERVER USERNAME PASSWORD DOMAIN
+EOF
+exit 1;
+fi
+
+SERVER=$1
+USERNAME=$2
+PASSWORD=$3
+DOMAIN=$4
+
+DD=bin/cifsdd
+
+SHARE=tmp
+DEBUGLEVEL=1
+
+failed=0
+
+testit() {
+   name=$1
+   shift
+   cmdline=$*
+   echo test: $name
+   $cmdline
+   status=$?
+   if [ x$status = x0 ]; then
+   echo success: $name
+   else
+   echo failure: $name
+   failed=`expr $failed + 1`
+   fi
+   return $status
+}
+
+
+
+runcopy() {
+   message=$1
+   shift
+   
+   testit $message $VALGRIND $DD $CONFIGURATION --debuglevel=$DEBUGLEVEL 
-W 

svn commit: samba r20748 - in branches/SAMBA_4_0/source/script/tests: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 01:42:07 + (Sun, 14 Jan 2007)
New Revision: 20748

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20748

Log:
Add file I forgot to commit
Added:
   branches/SAMBA_4_0/source/script/tests/test_blackbox.sh


Changeset:
Added: branches/SAMBA_4_0/source/script/tests/test_blackbox.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_blackbox.sh 2007-01-14 
01:39:34 UTC (rev 20747)
+++ branches/SAMBA_4_0/source/script/tests/test_blackbox.sh 2007-01-14 
01:42:07 UTC (rev 20748)
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# this runs tests that interact directly with the command-line tools rather 
than using the API
+
+if [ $# -lt 5 ]; then
+cat EOF
+Usage: test_blackbox.sh SERVER USERNAME PASSWORD DOMAIN PREFIX [...]
+EOF
+exit 1;
+fi
+
+SERVER=$1
+USERNAME=$2
+PASSWORD=$3
+DOMAIN=$4
+PREFIX=$5
+shift 5
+ADDARGS=$@
+
+incdir=`dirname $0`
+. $incdir/test_functions.sh
+
+testit smbclient $incdir/../../../testprogs/blackbox/test_smbclient.sh 
$SERVER $USERNAME $PASSWORD $DOMAIN $PREFIX $ADDARGS
+testit cifsdd $incdir/../../../testprogs/blackbox/test_cifsdd.sh $SERVER 
$USERNAME $PASSWORD $DOMAIN $ADDARGS
+
+testok $0 $failed


Property changes on: branches/SAMBA_4_0/source/script/tests/test_blackbox.sh
___
Name: svn:executable
   + *



svn commit: samba r20749 - in branches/SAMBA_4_0/webapps: qooxdoo-0.6.3-sdk/frontend/framework qooxdoo-0.6.3-sdk/frontend/framework/tool/modules swat

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 01:44:24 + (Sun, 14 Jan 2007)
New Revision: 20749

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20749

Log:
Ignore autogenerated files.
Modified:
   branches/SAMBA_4_0/webapps/qooxdoo-0.6.3-sdk/frontend/framework/
   branches/SAMBA_4_0/webapps/qooxdoo-0.6.3-sdk/frontend/framework/tool/modules/
   branches/SAMBA_4_0/webapps/swat/


Changeset:

Property changes on: 
branches/SAMBA_4_0/webapps/qooxdoo-0.6.3-sdk/frontend/framework
___
Name: svn:ignore
   + .cache



Property changes on: 
branches/SAMBA_4_0/webapps/qooxdoo-0.6.3-sdk/frontend/framework/tool/modules
___
Name: svn:ignore
   + *.pyc



Property changes on: branches/SAMBA_4_0/webapps/swat
___
Name: svn:ignore
   + build




svn commit: samba r20750 - in branches/SAMBA_4_0/source/script/tests: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 02:02:06 + (Sun, 14 Jan 2007)
New Revision: 20750

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20750

Log:
Use files in script/tests to build a recipe rather than running the tests 
immediately.

Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.sh
   branches/SAMBA_4_0/source/script/tests/test_functions.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_4_0/source/script/tests/selftest.sh  2007-01-14 01:44:24 UTC 
(rev 20749)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh  2007-01-14 02:02:06 UTC 
(rev 20750)
@@ -104,6 +104,107 @@
TORTURE_OPTIONS=$TORTURE_OPTIONS --option=torture:progress=no
 fi
 
+ runtest() {
+   if [ -z $PREFIX ]; then
+   PREFIX=test_prefix
+   mkdir -p $PREFIX
+   fi
+   name=$1
+   shift 1
+   cmdline=$*
+
+   SMBD_IS_UP=no
+
+   shname=`echo $name | \
+   sed -e 
's%[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\-]%_%g'`
+
+   UNIQUE_PID=`/bin/sh -c 'echo $$'`
+   TEST_LOG=$PREFIX/test_log.${UNIQUE_PID}
+   TEST_PCAP=$PREFIX/test_${shname}_${UNIQUE_PID}.pcap
+   trap rm -f $TEST_LOG $TEST_PCAP EXIT
+
+if [ -n $SMBD_TEST_LOG -a -z $smbd_log_size ]; then
+   smbd_log_size=`wc -l  $SMBD_TEST_LOG`;
+   fi
+
+   if [ x$RUN_FROM_BUILD_FARM = xyes ];then
+   echo --==--==--==--==--==--==--==--==--==--==--
+   echo Running test $name (level 0 stdout)
+   echo --==--==--==--==--==--==--==--==--==--==--
+   date
+   echo Testing $name
+   else
+   nf=`expr $failed + $totalfailed`;
+   if [ $nf = 0 ]; then 
+   echo Testing $name
+   else 
+   echo Testing $name ($nf tests failed so far)
+   fi
+   fi
+
+   smbd_check_only  SMBD_IS_UP=yes
+   if [ x$SMBD_IS_UP != xyes ];then
+   if [ x$RUN_FROM_BUILD_FARM = xyes ];then
+   echo SMBD is down! Skipping: $cmdline
+   echo ==
+   echo TEST SKIPPED: $name (reason SMBD is down)
+   echo ==
+   else
+   echo TEST SKIPPED: $name (reason SMBD is down)
+   fi
+   return 1
+   fi
+
+   if [ x$MAKE_TEST_ENABLE_PCAP = xyes ];then
+   SOCKET_WRAPPER_PCAP_FILE=$TEST_PCAP
+   export SOCKET_WRAPPER_PCAP_FILE
+   fi
+
+   ( $cmdline  $TEST_LOG 21 )
+   status=$?
+   # show any additional output from smbd that has happened in this test
+   smbd_have_test_log  { 
+   new_log_size=`wc -l  $SMBD_TEST_LOG`;
+   test $new_log_size = $smbd_log_size || {
+   echo SMBD OUTPUT:;
+   incr_log_size=`expr $new_log_size - $smbd_log_size`;
+   tail -$incr_log_size $SMBD_TEST_LOG;
+   smbd_log_size=$new_log_size;
+   }
+   }
+   if [ x$status != x0 ]; then
+   echo TEST OUTPUT:
+   cat $TEST_LOG;
+   rm -f $TEST_LOG;
+   if [ x$MAKE_TEST_ENABLE_PCAP = xyes ];then
+   echo TEST PCAP: $TEST_PCAP
+   fi
+   if [ x$RUN_FROM_BUILD_FARM = xyes ];then
+   echo ==
+   echo TEST FAILED: $name (status $status)
+   echo ==
+   else
+   echo TEST FAILED: $cmdline (status $status)
+   fi
+   trap  EXIT
+   return 1;
+   fi
+   rm -f $TEST_LOG;
+   if [ x$MAKE_TEST_KEEP_PCAP = xyes ];then
+   echo TEST PCAP: $TEST_PCAP
+   else
+   rm -f $TEST_PCAP;
+   fi
+   if [ x$RUN_FROM_BUILD_FARM = xyes ];then
+   echo ALL OK: $cmdline
+   echo ==
+   echo TEST PASSED: $name
+   echo ==
+   fi
+   trap  EXIT
+   return 0;
+}
+
 START=`date`
 (
  # give time for nbt server to register its names
@@ -123,7 +224,19 @@
 totalfailed=0
 export totalfailed
 
- . script/tests/tests_$TESTS.sh
+. script/tests/tests_$TESTS.sh | (
+   while read LINE
+   do
+   if [ $LINE = -- TEST -- ]; then
+   read NAME
+   read CMDLINE
+   runtest $NAME $CMDLINE
+   else
+   echo $LINE
+   fi
+ done
+)
+
  exit $totalfailed
 ) 9$SMBD_TEST_FIFO
 failed=$?

Modified: 

svn commit: samba r20751 - in branches/SAMBA_4_0/webapps/swat/source/class/swat/main: .

2007-01-13 Thread derrell
Author: derrell
Date: 2007-01-14 02:54:41 + (Sun, 14 Jan 2007)
New Revision: 20751

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20751

Log:
It's unlikely that even 1 in 1000 users of SWAT will be running IE.  That not
withstanding, although many web sites ignore Gecko and work properly only when
accessed via IE, we should strive to a higher standard.

This check-in makes the Samba4 Web Application Framework work in IE as well.

Modified:
   branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js
   branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Gui.js
   branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Main.js
   branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Module.js


Changeset:
Modified: 
branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js
===
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js
2007-01-14 02:02:06 UTC (rev 20750)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/main/AbstractModule.js
2007-01-14 02:54:41 UTC (rev 20751)
@@ -84,16 +84,6 @@
   ontransition :
 function(fsm, event)
 {
-  // Make the Loading message go away.  (We need to learn how to
-  // remove it entirely.  Just doing canvas.removeAll() leaves
-  // something in the widget queue and we get spurious error
-  // messages.)
-  var children = module.canvas.getVisibleChildren();
-  for (var child in children)
-  {
-children[child].hide();
-  }
-
   // Call the module's initialAppear function to build FSM and GUI.
   // That function should *replace* this state, State_Idle, to which
   // we'll transition.
@@ -126,8 +116,7 @@
 /**
  * Build the initial graphical user interface.
  *
- * In order to prevent long load times, as minimal as possible of an initial
- * GUI should be created.  Generally, this is just a Loading... message.
+ * Generally, this is a no-op.
  *
  * @param module {Object}
  *   An object containing at least the following properties:
@@ -138,20 +127,13 @@
  *   The canvas on which to create the gui for this module
  * name -
  *   The name of this module
- * class -
+ * clazz -
  *   The class for this module
  *
  */
 qx.Proto.buildInitialGui = function(module)
 {
-  // For now, just create the Loading text
-  var o = new qx.ui.basic.Label(Loading module ' + module.name + '...);
-  o.set({
-top: 12,
-left: 20
-});
-  o.setFont(bold);
-  module.canvas.add(o);
+  // nothing to do
 };
 
 qx.Proto.finalize = function(module)

Modified: branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Gui.js
===
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Gui.js   
2007-01-14 02:02:06 UTC (rev 20750)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Gui.js   
2007-01-14 02:54:41 UTC (rev 20751)
@@ -175,7 +175,6 @@
// Set the browser title as well
document.title =
  Swat:  + this.moduleName;
-
  }
});
 

Modified: branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Main.js
===
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Main.js  
2007-01-14 02:02:06 UTC (rev 20750)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Main.js  
2007-01-14 02:54:41 UTC (rev 20751)
@@ -60,7 +60,7 @@
   for (moduleName in moduleList)
   {
 // ... call the module's buildInitialFsm() function
-var module = moduleList[moduleName][class].getInstance();
+var module = moduleList[moduleName][clazz].getInstance();
 module.buildInitialFsm(moduleList[moduleName]);
   }
 };
@@ -77,7 +77,7 @@
   for (moduleName in moduleList)
   {
 // ... call the module's buildInitialGui() function
-var module = moduleList[moduleName][class].getInstance();
+var module = moduleList[moduleName][clazz].getInstance();
 module.buildInitialGui(moduleList[moduleName]);
   }
 };
@@ -89,7 +89,7 @@
   var moduleList = swat.main.Module.getList();
   for (moduleName in moduleList)
   {
-var module = moduleList[moduleName][class].getInstance();
+var module = moduleList[moduleName][clazz].getInstance();
 module.finalize(moduleList[moduleName]);
   }
 };

Modified: branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Module.js
===
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Module.js
2007-01-14 02:02:06 UTC (rev 20750)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/main/Module.js
2007-01-14 02:54:41 UTC (rev 20751)
@@ -30,7 +30,7 @@
  *   The name of the module 

svn commit: samba r20752 - in branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics: .

2007-01-13 Thread derrell
Author: derrell
Date: 2007-01-14 02:56:09 + (Sun, 14 Jan 2007)
New Revision: 20752

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20752

Log:
There's no reason to wait 5 seconds before the first Status and Statistics
report is generated.  Upon appear events, set timer expiry to 0 seconds for
the first timeout.

Modified:
   branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js


Changeset:
Modified: 
branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js
===
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js  
2007-01-14 02:54:41 UTC (rev 20751)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js  
2007-01-14 02:56:09 UTC (rev 20752)
@@ -17,19 +17,35 @@
 });
 
 
-qx.Class._startTimer = function(fsm)
+/**
+ * Start the redisplay timer.
+ *
+ * @param fsm {qx.util.fsm.FiniteStateMachine}
+ *   The finite state machine in use by this module
+ *
+ * @param msInterval {Integer}
+ *   The number of milliseconds before the timer should expire
+ */
+qx.Class._startTimer = function(fsm, msInterval)
 {
+
   // First, for good house keeping, ensure no timer exists
   swat.module.statistics.Fsm._stopTimer(fsm);
 
   // Create a timer instance to expire in a few seconds
-  var timer = new qx.client.Timer(5000);
+  var timer = new qx.client.Timer(msInterval);
   timer.addEventListener(interval, fsm.eventListener, fsm);
   fsm.addObject(timer, timer);
   timer.start();
 };
 
 
+/**
+ * Stop the redisplay timer.
+ *
+ * @param fsm {qx.util.fsm.FiniteStateMachine}
+ *   The finite state machine in use by this module
+ */
 qx.Class._stopTimer = function(fsm)
 {
   // ... then stop the timer.  Get the timer object.
@@ -84,7 +100,8 @@
 // Restart the timer.
 if (_module.visible)
 {
-  swat.module.statistics.Fsm._startTimer(fsm);
+  // Give it a reasonable interval before we redisplay
+  swat.module.statistics.Fsm._startTimer(fsm, 5000);
 }
   }
 },
@@ -172,7 +189,9 @@
 function(fsm, event)
 {
   _module.visible = true;
-  swat.module.statistics.Fsm._startTimer(fsm);
+
+  // Redisplay immediately
+  swat.module.statistics.Fsm._startTimer(fsm, 0);
 }
 });
   state.addTransition(trans);



svn commit: samba r20753 - in branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics: .

2007-01-13 Thread derrell
Author: derrell
Date: 2007-01-14 03:03:40 + (Sun, 14 Jan 2007)
New Revision: 20753

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20753

Log:
editorial change
Modified:
   branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js


Changeset:
Modified: 
branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js
===
--- branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js  
2007-01-14 02:56:09 UTC (rev 20752)
+++ branches/SAMBA_4_0/webapps/swat/source/class/swat/module/statistics/Fsm.js  
2007-01-14 03:03:40 UTC (rev 20753)
@@ -32,7 +32,7 @@
   // First, for good house keeping, ensure no timer exists
   swat.module.statistics.Fsm._stopTimer(fsm);
 
-  // Create a timer instance to expire in a few seconds
+  // Create a timer instance to expire in the specified amount of time
   var timer = new qx.client.Timer(msInterval);
   timer.addEventListener(interval, fsm.eventListener, fsm);
   fsm.addObject(timer, timer);



svn commit: samba r20754 - in branches/SAMBA_4_0/source/script/tests: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 03:18:04 + (Sun, 14 Jan 2007)
New Revision: 20754

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20754

Log:
Simplify code for calculating total number of failed tests.

Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.sh
   branches/SAMBA_4_0/source/script/tests/tests_all.sh
   branches/SAMBA_4_0/source/script/tests/tests_quick.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_4_0/source/script/tests/selftest.sh  2007-01-14 03:03:40 UTC 
(rev 20753)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh  2007-01-14 03:18:04 UTC 
(rev 20754)
@@ -230,7 +230,7 @@
if [ $LINE = -- TEST -- ]; then
read NAME
read CMDLINE
-   runtest $NAME $CMDLINE
+   runtest $NAME $CMDLINE || totalfailed=`expr 
$totalfailed + $?`
else
echo $LINE
fi

Modified: branches/SAMBA_4_0/source/script/tests/tests_all.sh
===
--- branches/SAMBA_4_0/source/script/tests/tests_all.sh 2007-01-14 03:03:40 UTC 
(rev 20753)
+++ branches/SAMBA_4_0/source/script/tests/tests_all.sh 2007-01-14 03:18:04 UTC 
(rev 20754)
@@ -1,15 +1,15 @@
 #!/bin/sh
- $SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_nbt.sh $SERVER || totalfailed=`expr $totalfailed + 
$?`
- $SRCDIR/script/tests/test_quick.sh //$SERVER/cifs $USERNAME $PASSWORD  || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_rpc.sh $SERVER $USERNAME $PASSWORD $DOMAIN || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_net.sh $SERVER $USERNAME $PASSWORD $DOMAIN || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_session_key.sh $SERVER $USERNAME $PASSWORD $DOMAIN 
$NETBIOSNAME || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_binding_string.sh $SERVER $USERNAME $PASSWORD 
$DOMAIN || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD  || 
totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_local.sh || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN 
$PREFIX || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_pidl.sh || totalfailed=`expr $totalfailed + $?`
- $SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD  
|| totalfailed=`expr $totalfailed + $?`
+ $SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD
+ $SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD
+ $SRCDIR/script/tests/test_nbt.sh $SERVER
+ $SRCDIR/script/tests/test_quick.sh //$SERVER/cifs $USERNAME $PASSWORD 
+ $SRCDIR/script/tests/test_rpc.sh $SERVER $USERNAME $PASSWORD $DOMAIN
+ $SRCDIR/script/tests/test_net.sh $SERVER $USERNAME $PASSWORD $DOMAIN
+ $SRCDIR/script/tests/test_session_key.sh $SERVER $USERNAME $PASSWORD $DOMAIN 
$NETBIOSNAME
+ $SRCDIR/script/tests/test_binding_string.sh $SERVER $USERNAME $PASSWORD 
$DOMAIN
+ $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN
+ $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD 
+ $SRCDIR/script/tests/test_local.sh
+ $SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN 
$PREFIX
+ $SRCDIR/script/tests/test_pidl.sh
+ $SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD 

Modified: branches/SAMBA_4_0/source/script/tests/tests_quick.sh
===
--- branches/SAMBA_4_0/source/script/tests/tests_quick.sh   2007-01-14 
03:03:40 UTC (rev 20753)
+++ branches/SAMBA_4_0/source/script/tests/tests_quick.sh   2007-01-14 
03:18:04 UTC (rev 20754)
@@ -4,9 +4,9 @@
 TORTURE_QUICK=yes
 export TORTURE_QUICK
 
-$SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD || 
totalfailed=`expr $totalfailed + $?`
-$SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD || 
totalfailed=`expr $totalfailed + $?`
-$SRCDIR/script/tests/test_nbt.sh $SERVER || totalfailed=`expr $totalfailed + 
$?`
-$SRCDIR/script/tests/test_quick.sh //$SERVER/cifs $USERNAME $PASSWORD  || 
totalfailed=`expr $totalfailed + $?`
-$SRCDIR/script/tests/test_rpc_quick.sh $SERVER $USERNAME $PASSWORD $DOMAIN || 
totalfailed=`expr $totalfailed + $?`
+$SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD
+$SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD
+$SRCDIR/script/tests/test_nbt.sh $SERVER
+$SRCDIR/script/tests/test_quick.sh 

svn commit: samba r20755 - in branches/SAMBA_4_0/source/script/tests: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 03:38:56 + (Sun, 14 Jan 2007)
New Revision: 20755

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20755

Log:
Add progress indicator to test runner
Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_4_0/source/script/tests/selftest.sh  2007-01-14 03:18:04 UTC 
(rev 20754)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh  2007-01-14 03:38:56 UTC 
(rev 20755)
@@ -136,9 +136,9 @@
else
nf=`expr $failed + $totalfailed`;
if [ $nf = 0 ]; then 
-   echo Testing $name
+   echo [$current/$total] Testing $name
else 
-   echo Testing $name ($nf tests failed so far)
+   echo [$current/$total, $nf failures] Testing $name
fi
fi
 
@@ -224,12 +224,16 @@
 totalfailed=0
 export totalfailed
 
-. script/tests/tests_$TESTS.sh | (
+. script/tests/tests_$TESTS.sh  $PREFIX/recipe
+total=`grep TEST -- $PREFIX/recipe | wc -l`
+current=0
+cat $PREFIX/recipe | (
while read LINE
do
if [ $LINE = -- TEST -- ]; then
read NAME
read CMDLINE
+   current=`expr $current + 1`
runtest $NAME $CMDLINE || totalfailed=`expr 
$totalfailed + $?`
else
echo $LINE



svn commit: samba r20756 - in branches/SAMBA_4_0/source/script/tests: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 04:32:11 + (Sun, 14 Jan 2007)
New Revision: 20756

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20756

Log:
Update to use generated recipes.

Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.pl


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl
===
--- branches/SAMBA_4_0/source/script/tests/selftest.pl  2007-01-14 03:38:56 UTC 
(rev 20755)
+++ branches/SAMBA_4_0/source/script/tests/selftest.pl  2007-01-14 04:32:11 UTC 
(rev 20756)
@@ -104,7 +104,7 @@
  --target=samba4|samba3|win Samba version to target
  --socket-wrapper   enable socket wrapper
  --quickrun quick overall test
-
+ --one  abort when the first test fails
 ;
exit(0);
 }
@@ -113,12 +113,14 @@
 my $opt_target = samba4;
 my $opt_quick = 0;
 my $opt_socket_wrapper = 0;
+my $opt_one = 0;
 
 my $result = GetOptions (
'help|h|?' = \$opt_help,
'target' = \$opt_target,
'socket-wrapper' = \$opt_socket_wrapper,
-   'quick' = \$opt_quick
+   'quick' = \$opt_quick,
+   'one' = \$opt_one
);
 
 if (not $result) {
@@ -263,16 +265,50 @@
 
 # start off with 0 failures
 $ENV{failed} = 0;
-$ENV{totalfailed} = 0;
+my $totalfailed = 0;
 
+my @todo = ();
+
 if ($opt_target eq win) {
system($testsdir/test_win.sh);
-} elsif ($opt_quick) {
-   system($testsdir/tests_quick.sh);
-} else {
-   system($testsdir/tests_all.sh);
+} else { 
+   if ($opt_quick) {
+   open(IN, $testsdir/tests_quick.sh|);
+   } else {
+   open(IN, $testsdir/tests_all.sh|);
+   }
+   while (IN) {
+   if ($_ eq -- TEST --\n) {
+   my $name = IN;
+   $name =~ s/\n//g;
+   my $cmdline = IN;
+   $cmdline =~ s/\n//g;
+   push (@todo, [$name, $cmdline]);
+   } else {
+   print;
+   }
+   }
+   close(IN);
 }
 
+my $total = $#todo + 1;
+my $i = 0;
+$| = 1;
+
+foreach (@todo) {
+   $i = $i + 1;
+   my $err = ;
+   if ($totalfailed  0) { $err = , $totalfailed errors; }
+   printf [$i/$total in  . (time() - $start).s$err] $$_[0]\n;
+   my $ret = system($$_[1] /dev/null 2/dev/null);
+   if ($ret != 0) {
+   $totalfailed++;
+   exit(1) if ($opt_one);
+   }
+}
+
+print \n;
+
 close(DATA);
 
 my $failed = $?  8;
@@ -291,6 +327,7 @@
 
 my $end=time();
 print DURATION:  . ($end-$start).  seconds\n;
+print $totalfailed failures\n;
 
 # if there were any valgrind failures, show them
 foreach ($prefix/valgrind.log*) {



svn commit: samba r20757 - in branches/SAMBA_4_0/source/torture: .

2007-01-13 Thread jelmer
Author: jelmer
Date: 2007-01-14 05:06:50 + (Sun, 14 Jan 2007)
New Revision: 20757

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=20757

Log:
Strip recipe functionality (should be one layer up)
Modified:
   branches/SAMBA_4_0/source/torture/smbtorture.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===
--- branches/SAMBA_4_0/source/torture/smbtorture.c  2007-01-14 04:32:11 UTC 
(rev 20756)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c  2007-01-14 05:06:50 UTC 
(rev 20757)
@@ -423,33 +423,6 @@
.test_result = quiet_test_result
 };
 
-void run_recipe(struct torture_context *tctx, const char *recipe)
-{
-   int numlines, i, ret;
-   char **lines;
-
-   lines = file_lines_load(recipe, numlines, NULL);
-   if (lines == NULL) {
-   fprintf(stderr, Unable to load file %s\n, recipe);
-   return;
-   }
-
-   for (i = 0; i  numlines; i++) {
-   int argc;
-   const char **argv;
-
-   ret = poptParseArgvString(lines[i], argc, argv);
-   if (ret != 0) {
-   fprintf(stderr, Error parsing line\n);
-   continue;
-   }
-
-   run_test(tctx, argv[0]);
-   }
-
-   talloc_free(lines);
-}
-
 void run_shell(struct torture_context *tctx)
 {
char *cline;
@@ -686,9 +659,7 @@
double rate;
int unexpected_failures;
for (i=2;iargc_new;i++) {
-   if (argv_new[i][0] == '@') {
-   run_recipe(torture, argv_new[i]+1);
-   } else if (!run_test(torture, argv_new[i])) {
+   if (!run_test(torture, argv_new[i])) {
correct = false;
}
}