[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-371-g5b4ba4b

2007-11-26 Thread Volker Lendecke
The branch, v3-2-test has been updated
   via  5b4ba4bfc54e2fa468abe15383e5b33eb5bd1324 (commit)
   via  9bf5ead4b2be57fa84e5b3137bfa0305a916f10f (commit)
  from  102a247df99967f25dbaf40c9be2d48a8e15c64c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 5b4ba4bfc54e2fa468abe15383e5b33eb5bd1324
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Mon Nov 26 14:30:50 2007 +0100

Improve debug message

Fix bug 5056, thanks to debian package maintainer

commit 9bf5ead4b2be57fa84e5b3137bfa0305a916f10f
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Mon Nov 26 11:55:55 2007 +0100

Fix a C++ warning

---

Summary of changes:
 source/lib/debug.c   |2 +-
 source/passdb/pdb_ldap.c |3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/debug.c b/source/lib/debug.c
index 49ec40a..4afc953 100644
--- a/source/lib/debug.c
+++ b/source/lib/debug.c
@@ -537,7 +537,7 @@ void debug_init(void)
for(p = default_classname_table; *p; p++) {
debug_add_class(*p);
}
-   format_bufr = SMB_MALLOC(FORMAT_BUFR_SIZE);
+   format_bufr = (char *)SMB_MALLOC(FORMAT_BUFR_SIZE);
if (!format_bufr) {
smb_panic(debug_init: unable to create buffer);
}
diff --git a/source/passdb/pdb_ldap.c b/source/passdb/pdb_ldap.c
index a3637bf..215cd3c 100644
--- a/source/passdb/pdb_ldap.c
+++ b/source/passdb/pdb_ldap.c
@@ -2536,7 +2536,8 @@ static NTSTATUS ldapsam_getgroup(struct pdb_methods 
*methods,
count = ldap_count_entries(priv2ld(ldap_state), result);
 
if (count  1) {
-   DEBUG(4, (ldapsam_getgroup: Did not find group\n));
+   DEBUG(4, (ldapsam_getgroup: Did not find group, filter was 
+ %s\n, filter));
ldap_msgfree(result);
return NT_STATUS_NO_SUCH_GROUP;
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-372-g8bcd2df

2007-11-26 Thread Volker Lendecke
The branch, v3-2-test has been updated
   via  8bcd2df841bae63e7d58c35d4728b7d853471697 (commit)
  from  5b4ba4bfc54e2fa468abe15383e5b33eb5bd1324 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 8bcd2df841bae63e7d58c35d4728b7d853471697
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Mon Nov 26 15:28:13 2007 +0100

Fix bug 5055

---

Summary of changes:
 source/lib/ldb/common/ldb_dn.c |2 +-
 source/lib/replace/replace.c   |2 +-
 source/passdb/pdb_ldap.c   |2 +-
 source/smbd/lanman.c   |2 +-
 source/smbd/trans2.c   |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/ldb/common/ldb_dn.c b/source/lib/ldb/common/ldb_dn.c
index 155c485..7ef3c38 100644
--- a/source/lib/ldb/common/ldb_dn.c
+++ b/source/lib/ldb/common/ldb_dn.c
@@ -26,7 +26,7 @@
  *
  *  Component: ldb dn explode and utility functions
  *
- *  Description: - explode a dn into it's own basic elements
+ *  Description: - explode a dn into its own basic elements
  * and put them in a structure
  *   - manipulate ldb_dn structures
  *
diff --git a/source/lib/replace/replace.c b/source/lib/replace/replace.c
index cec158b..b2a240e 100644
--- a/source/lib/replace/replace.c
+++ b/source/lib/replace/replace.c
@@ -218,7 +218,7 @@ long nap(long milliseconds) {
 #ifndef HAVE_MEMMOVE
 /***
 safely copies memory, ensuring no overlap problems.
-this is only used if the machine does not have it's own memmove().
+this is only used if the machine does not have its own memmove().
 this is not the fastest algorithm in town, but it will do for our
 needs.
 /
diff --git a/source/passdb/pdb_ldap.c b/source/passdb/pdb_ldap.c
index 215cd3c..707e3f3 100644
--- a/source/passdb/pdb_ldap.c
+++ b/source/passdb/pdb_ldap.c
@@ -5623,7 +5623,7 @@ static NTSTATUS ldapsam_change_groupmem(struct 
pdb_methods *my_methods,
}
 
if (user_gid == group_gid) {
-   DEBUG (3, (ldapsam_change_groupmem: can't remove user 
from it's own primary group!\n));
+   DEBUG (3, (ldapsam_change_groupmem: can't remove user 
from its own primary group!\n));
return NT_STATUS_MEMBERS_PRIMARY_GROUP;
}
}
diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c
index b2e435e..17ab891 100644
--- a/source/smbd/lanman.c
+++ b/source/smbd/lanman.c
@@ -1380,7 +1380,7 @@ static bool api_RNetServerEnum(connection_struct *conn, 
uint16 vuid,
}
 
/* If someone sets SV_TYPE_LOCAL_LIST_ONLY but hasn't set
-  any other bit (they may just set this bit on it's own) they 
+  any other bit (they may just set this bit on its own) they 
   want all the locally seen servers. However this bit can be 
   set on its own so set the requested servers to be 
   ALL - DOMAIN_ENUM. */
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 323d78c..e37f6ff 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -3279,7 +3279,7 @@ static char *store_file_unix_basic(connection_struct 
*conn,
  *
  * XXX: this really should be behind the VFS interface. To do this, we would
  * need to alter SMB_STRUCT_STAT so that it included a flags and a mask field.
- * Each VFS module could then implement it's own mapping as appropriate for the
+ * Each VFS module could then implement its own mapping as appropriate for the
  * platform. We would then pass the SMB flags into SMB_VFS_CHFLAGS.
  */
 static const struct {unsigned stat_fflag; unsigned smb_fflag;}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-373-g3088bc7

2007-11-26 Thread Volker Lendecke
The branch, v3-2-test has been updated
   via  3088bc76f1ceffecaa5aea039be79973c9876f0c (commit)
  from  8bcd2df841bae63e7d58c35d4728b7d853471697 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 3088bc76f1ceffecaa5aea039be79973c9876f0c
Author: Volker Lendecke [EMAIL PROTECTED]
Date:   Sat Nov 24 17:27:19 2007 +0100

Remove a global

---

Summary of changes:
 source/libads/ads_status.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libads/ads_status.c b/source/libads/ads_status.c
index 3f0ab57..ecef9d2 100644
--- a/source/libads/ads_status.c
+++ b/source/libads/ads_status.c
@@ -99,10 +99,6 @@ NTSTATUS ads_ntstatus(ADS_STATUS status)
 */
 const char *ads_errstr(ADS_STATUS status)
 {
-   static char *ret;
-
-   SAFE_FREE(ret);
-
switch (status.error_type) {
case ENUM_ADS_ERROR_SYSTEM:
return strerror(status.err.rc);
@@ -117,6 +113,7 @@ const char *ads_errstr(ADS_STATUS status)
 #ifdef HAVE_GSSAPI
case ENUM_ADS_ERROR_GSS:
{
+   char *ret;
uint32 msg_ctx;
uint32 minor;
gss_buffer_desc msg1, msg2;
@@ -129,7 +126,9 @@ const char *ads_errstr(ADS_STATUS status)
   GSS_C_NULL_OID, msg_ctx, msg1);
gss_display_status(minor, status.minor_status, GSS_C_MECH_CODE,
   GSS_C_NULL_OID, msg_ctx, msg2);
-   asprintf(ret, %s : %s, (char *)msg1.value, (char 
*)msg2.value);
+   ret = talloc_asprintf(talloc_tos(), %s : %s,
+ (char *)msg1.value, (char *)msg2.value);
+   SMB_ASSERT(ret != NULL);
gss_release_buffer(minor, msg1);
gss_release_buffer(minor, msg2);
return ret;


-- 
Samba Shared Repository


svn commit: samba r26132 - in branches/SAMBA_4_0/source/lib: crypto nss_wrapper

2007-11-26 Thread jelmer
Author: jelmer
Date: 2007-11-26 21:12:01 + (Mon, 26 Nov 2007)
New Revision: 26132

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

Log:
Update ignores.
Modified:
   branches/SAMBA_4_0/source/lib/crypto/
   branches/SAMBA_4_0/source/lib/nss_wrapper/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/crypto
___
Name: svn:ignore
   - .sconsign
*.d
*.po

   + test_proto.h
.sconsign
*.d
*.po



Property changes on: branches/SAMBA_4_0/source/lib/nss_wrapper
___
Name: svn:ignore
   + *.pc




svn commit: samba r26133 - in branches/SAMBA_4_0/source/libcli/util: .

2007-11-26 Thread gd
Author: gd
Date: 2007-11-26 23:58:39 + (Mon, 26 Nov 2007)
New Revision: 26133

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

Log:
Add some more error codes from wkssvc testing.

Guenther

Modified:
   branches/SAMBA_4_0/source/libcli/util/doserr.c
   branches/SAMBA_4_0/source/libcli/util/werror.h


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/util/doserr.c
===
--- branches/SAMBA_4_0/source/libcli/util/doserr.c  2007-11-26 21:12:01 UTC 
(rev 26132)
+++ branches/SAMBA_4_0/source/libcli/util/doserr.c  2007-11-26 23:58:39 UTC 
(rev 26133)
@@ -41,6 +41,7 @@
{ WERR_FILE_EXISTS, WERR_FILE_EXISTS },
{ WERR_INVALID_PARAM, WERR_INVALID_PARAM },
{ WERR_NOT_SUPPORTED, WERR_NOT_SUPPORTED },
+   { WERR_DUP_NAME, WERR_DUP_NAME },
{ WERR_BAD_PASSWORD, WERR_BAD_PASSWORD },
{ WERR_NOMEM, WERR_NOMEM },
{ WERR_INVALID_NAME, WERR_INVALID_NAME },
@@ -62,6 +63,7 @@
{ WERR_DEST_NOT_FOUND, WERR_DEST_NOT_FOUND },
{ WERR_NOT_LOCAL_DOMAIN, WERR_NOT_LOCAL_DOMAIN },
{ WERR_DOMAIN_CONTROLLER_NOT_FOUND, WERR_DOMAIN_CONTROLLER_NOT_FOUND 
},
+   { WERR_TIME_DIFF_AT_DC, WERR_TIME_DIFF_AT_DC },
{ WERR_SETUP_NOT_JOINED, WERR_SETUP_NOT_JOINED },
{ WERR_SETUP_ALREADY_JOINED, WERR_SETUP_ALREADY_JOINED },
{ WERR_SETUP_DOMAIN_CONTROLLER, WERR_SETUP_DOMAIN_CONTROLLER },
@@ -84,6 +86,7 @@
{ WERR_INVALID_COMPUTERNAME, WERR_INVALID_COMPUTERNAME },
{ WERR_INVALID_DOMAINNAME, WERR_INVALID_DOMAINNAME },
{ WERR_NO_LOGON_SERVERS, WERR_NO_LOGON_SERVERS },
+   { WERR_NO_SUCH_LOGON_SESSION, WERR_NO_SUCH_LOGON_SESSION },
{ WERR_NO_SUCH_PRIVILEGE, WERR_NO_SUCH_PRIVILEGE },
{ WERR_PRIVILEGE_NOT_HELD, WERR_PRIVILEGE_NOT_HELD },
{ WERR_NO_SUCH_USER, WERR_NO_SUCH_USER },
@@ -128,6 +131,8 @@
{ WERR_FRS_INVALID_SERVICE_PARAMETER, 
WERR_FRS_INVALID_SERVICE_PARAMETER },
{ WERR_FRS_SYSVOL_IS_BUSY, WERR_FRS_SYSVOL_IS_BUSY },
{ WERR_FRS_INSUFFICIENT_PRIV, WERR_FRS_INSUFFICIENT_PRIV },
+   { WERR_RPC_E_REMOTE_DISABLED, WERR_RPC_E_REMOTE_DISABLED },
+   { WERR_NOT_CONNECTED, WERR_NOT_CONNECTED },
{ NULL, W_ERROR(0) }
 };
 

Modified: branches/SAMBA_4_0/source/libcli/util/werror.h
===
--- branches/SAMBA_4_0/source/libcli/util/werror.h  2007-11-26 21:12:01 UTC 
(rev 26132)
+++ branches/SAMBA_4_0/source/libcli/util/werror.h  2007-11-26 23:58:39 UTC 
(rev 26133)
@@ -70,6 +70,7 @@
 #define WERR_NOMEM W_ERROR(8)
 #define WERR_GENERAL_FAILURE W_ERROR(31)
 #define WERR_NOT_SUPPORTED W_ERROR(50)
+#define WERR_DUP_NAME W_ERROR(52)
 #define WERR_BAD_NETPATH W_ERROR(53)
 #define WERR_BAD_NET_RESP W_ERROR(58)
 #define WERR_UNEXP_NET_ERR W_ERROR(59)
@@ -97,6 +98,7 @@
 #define WERR_REVISION_MISMATCH W_ERROR(1306)
 #define WERR_INVALID_OWNER W_ERROR(1307)
 #define WERR_NO_LOGON_SERVERS W_ERROR(1311)
+#define WERR_NO_SUCH_LOGON_SESSION W_ERROR(1312)
 #define WERR_NO_SUCH_PRIVILEGE W_ERROR(1313)
 #define WERR_PRIVILEGE_NOT_HELD W_ERROR(1314)
 #define WERR_NO_SUCH_USER W_ERROR(1317)
@@ -112,10 +114,12 @@
 #define WERR_BUF_TOO_SMALL W_ERROR(2123)
 #define WERR_JOB_NOT_FOUND W_ERROR(2151)
 #define WERR_DEST_NOT_FOUND W_ERROR(2152)
+#define WERR_NOT_CONNECTED W_ERROR(2250)
 #define WERR_SESSION_NOT_FOUND W_ERROR(2312)
 #define WERR_FID_NOT_FOUND W_ERROR(2314)
 #define WERR_NOT_LOCAL_DOMAIN W_ERROR(2320)
 #define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(2453)
+#define WERR_TIME_DIFF_AT_DC W_ERROR(2457)
 
 #define WERR_SETUP_ALREADY_JOINED W_ERROR(2691)
 #define WERR_SETUP_NOT_JOINED W_ERROR(2692)
@@ -189,6 +193,10 @@
 #define WERR_FRS_SYSVOL_IS_BUSY W_ERROR(FRS_ERR_BASE+15)
 #define WERR_FRS_INVALID_SERVICE_PARAMETER W_ERROR(FRS_ERR_BASE+17)
 
+/* RPC errors */
+#define WERR_RPC_E_INVALID_HEADER  W_ERROR(0x80010111)
+#define WERR_RPC_E_REMOTE_DISABLED W_ERROR(0x8001011c)
+
 /* SEC errors */
 #define WERR_SEC_E_ENCRYPT_FAILURE W_ERROR(0x80090329)
 #define WERR_SEC_E_DECRYPT_FAILURE W_ERROR(0x80090330)



Build status as of Tue Nov 27 00:00:01 2007

2007-11-26 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-11-26 
00:00:58.0 +
+++ /home/build/master/cache/broken_results.txt 2007-11-27 00:00:40.0 
+
@@ -1,4 +1,4 @@
-Build status as of Mon Nov 26 00:00:01 2007
+Build status as of Tue Nov 27 00:00:01 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -16,10 +16,10 @@
 rsync28 12 0 
 samba-docs   0  0  0 
 samba-gtk4  4  0 
-samba4   25 22 0 
+samba4   25 16 0 
 samba_3_20  0  0 
 samba_3_2_test 28 17 0 
 smb-build27 26 0 
 talloc   28 7  0 
-tdb  28 5  0 
+tdb  27 5  0 
 


svn commit: samba r26134 - in branches/SAMBA_4_0/source/auth: .

2007-11-26 Thread jelmer
Author: jelmer
Date: 2007-11-27 01:14:54 + (Tue, 27 Nov 2007)
New Revision: 26134

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

Log:
Avoid using samdb-dependent functions in auth_system_session.
Modified:
   branches/SAMBA_4_0/source/auth/config.mk
   branches/SAMBA_4_0/source/auth/system_session.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/config.mk
===
--- branches/SAMBA_4_0/source/auth/config.mk2007-11-26 23:58:39 UTC (rev 
26133)
+++ branches/SAMBA_4_0/source/auth/config.mk2007-11-27 01:14:54 UTC (rev 
26134)
@@ -11,6 +11,7 @@
 [SUBSYSTEM::auth_system_session]
 OBJ_FILES = system_session.o
 PUBLIC_PROTO_HEADER = system_session_proto.h
+PRIVATE_DEPENDENCIES = auth_session
 
 [SUBSYSTEM::auth_sam]
 PRIVATE_PROTO_HEADER = auth_sam.h

Modified: branches/SAMBA_4_0/source/auth/system_session.c
===
--- branches/SAMBA_4_0/source/auth/system_session.c 2007-11-26 23:58:39 UTC 
(rev 26133)
+++ branches/SAMBA_4_0/source/auth/system_session.c 2007-11-27 01:14:54 UTC 
(rev 26134)
@@ -24,7 +24,6 @@
 #include includes.h
 #include libcli/security/security.h
 #include libcli/auth/libcli_auth.h
-#include dsdb/samdb/samdb.h
 #include auth/credentials/credentials.h
 #include param/param.h
 #include auth/auth.h /* for auth_serversupplied_info */
@@ -32,6 +31,123 @@
 #include auth/system_session_proto.h
 
 /**
+ * Create the SID list for this user. 
+ *
+ * @note Specialised version for system sessions that doesn't use the SAM.
+ */
+static NTSTATUS create_token(TALLOC_CTX *mem_ctx, 
+  struct dom_sid *user_sid,
+  struct dom_sid *group_sid, 
+  int n_groupSIDs,
+  struct dom_sid **groupSIDs, 
+  bool is_authenticated,
+  struct security_token **token)
+{
+   struct security_token *ptoken;
+   int i;
+
+   ptoken = security_token_initialise(mem_ctx);
+   NT_STATUS_HAVE_NO_MEMORY(ptoken);
+
+   ptoken-sids = talloc_array(ptoken, struct dom_sid *, n_groupSIDs + 5);
+   NT_STATUS_HAVE_NO_MEMORY(ptoken-sids);
+
+   ptoken-user_sid = talloc_reference(ptoken, user_sid);
+   ptoken-group_sid = talloc_reference(ptoken, group_sid);
+   ptoken-privilege_mask = 0;
+
+   ptoken-sids[0] = ptoken-user_sid;
+   ptoken-sids[1] = ptoken-group_sid;
+
+   /*
+* Finally add the standard SIDs.
+* The only difference between guest and anonymous
+* is the addition of Authenticated_Users.
+*/
+   ptoken-sids[2] = dom_sid_parse_talloc(ptoken-sids, SID_WORLD);
+   NT_STATUS_HAVE_NO_MEMORY(ptoken-sids[2]);
+   ptoken-sids[3] = dom_sid_parse_talloc(ptoken-sids, SID_NT_NETWORK);
+   NT_STATUS_HAVE_NO_MEMORY(ptoken-sids[3]);
+   ptoken-num_sids = 4;
+
+   if (is_authenticated) {
+   ptoken-sids[4] = dom_sid_parse_talloc(ptoken-sids, 
SID_NT_AUTHENTICATED_USERS);
+   NT_STATUS_HAVE_NO_MEMORY(ptoken-sids[4]);
+   ptoken-num_sids++;
+   }
+
+   for (i = 0; i  n_groupSIDs; i++) {
+   size_t check_sid_idx;
+   for (check_sid_idx = 1; 
+check_sid_idx  ptoken-num_sids; 
+check_sid_idx++) {
+   if (dom_sid_equal(ptoken-sids[check_sid_idx], 
groupSIDs[i])) {
+   break;
+   }
+   }
+
+   if (check_sid_idx == ptoken-num_sids) {
+   ptoken-sids[ptoken-num_sids++] = 
talloc_reference(ptoken-sids, groupSIDs[i]);
+   }
+   }
+
+   *token = ptoken;
+
+   /* Shortcuts to prevent recursion and avoid lookups */
+   if (ptoken-user_sid == NULL) {
+   ptoken-privilege_mask = 0;
+   return NT_STATUS_OK;
+   } 
+   
+   if (security_token_is_system(ptoken)) {
+   ptoken-privilege_mask = ~0;
+   return NT_STATUS_OK;
+   } 
+   
+   if (security_token_is_anonymous(ptoken)) {
+   ptoken-privilege_mask = 0;
+   return NT_STATUS_OK;
+   }
+
+   DEBUG(0, (Created token was not system or anonymous token!));
+   *token = NULL;
+   return NT_STATUS_INTERNAL_ERROR;
+}
+
+static NTSTATUS generate_session_info(TALLOC_CTX *mem_ctx, 
+   struct auth_serversupplied_info 
*server_info, 
+   struct auth_session_info **_session_info) 
+{
+   struct auth_session_info *session_info;
+   NTSTATUS nt_status;
+
+   session_info = talloc(mem_ctx, struct auth_session_info);
+   NT_STATUS_HAVE_NO_MEMORY(session_info);
+
+   session_info-server_info = talloc_reference(session_info, server_info);
+
+   /* 

[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-374-g331c0d6

2007-11-26 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  331c0d6216e1a1607a49ed7eb4078e10138ec16a (commit)
  from  3088bc76f1ceffecaa5aea039be79973c9876f0c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 331c0d6216e1a1607a49ed7eb4078e10138ec16a
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Mon Nov 26 17:24:56 2007 -0800

Remove pstrings from nsswitch/ and registry/
Jeremy.

---

Summary of changes:
 source/nsswitch/wb_common.c |   41 ++--
 source/registry/reg_cachehook.c |   26 ++-
 source/registry/reg_db.c|  443 ++
 source/registry/reg_dynamic.c   |   43 +++--
 source/registry/reg_eventlog.c  |  151 --
 source/registry/reg_objects.c   |   10 +-
 source/registry/reg_perfcount.c |   50 +++--
 source/registry/reg_printing.c  |  393 ++
 source/registry/reg_util.c  |  138 +++--
 9 files changed, 723 insertions(+), 572 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/nsswitch/wb_common.c b/source/nsswitch/wb_common.c
index 2ae85dc..49a2935 100644
--- a/source/nsswitch/wb_common.c
+++ b/source/nsswitch/wb_common.c
@@ -168,54 +168,51 @@ static int winbind_named_pipe_sock(const char *dir)
 {
struct sockaddr_un sunaddr;
struct stat st;
-   pstring path;
+   char *path = NULL;
int fd;
int wait_time;
int slept;
-   
+
/* Check permissions on unix socket directory */
-   
+
if (lstat(dir, st) == -1) {
return -1;
}
-   
-   if (!S_ISDIR(st.st_mode) || 
+
+   if (!S_ISDIR(st.st_mode) ||
(st.st_uid != 0  st.st_uid != geteuid())) {
return -1;
}
-   
+
/* Connect to socket */
-   
-   strncpy(path, dir, sizeof(path) - 1);
-   path[sizeof(path) - 1] = '\0';
-   
-   strncat(path, /, sizeof(path) - 1 - strlen(path));
-   path[sizeof(path) - 1] = '\0';
-   
-   strncat(path, WINBINDD_SOCKET_NAME, sizeof(path) - 1 - strlen(path));
-   path[sizeof(path) - 1] = '\0';
-   
+
+   if (asprintf(path, %s/%s, dir, WINBINDD_SOCKET_NAME)  0) {
+   return -1;
+   }
+
ZERO_STRUCT(sunaddr);
sunaddr.sun_family = AF_UNIX;
strncpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path) - 1);
-   
+
/* If socket file doesn't exist, don't bother trying to connect
   with retry.  This is an attempt to make the system usable when
   the winbindd daemon is not running. */
 
if (lstat(path, st) == -1) {
+   SAFE_FREE(path);
return -1;
}
-   
+
+   SAFE_FREE(path);
/* Check permissions on unix socket file */
-   
-   if (!S_ISSOCK(st.st_mode) || 
+
+   if (!S_ISSOCK(st.st_mode) ||
(st.st_uid != 0  st.st_uid != geteuid())) {
return -1;
}
-   
+
/* Connect to socket */
-   
+
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
return -1;
}
diff --git a/source/registry/reg_cachehook.c b/source/registry/reg_cachehook.c
index 739faca..289d4e5 100644
--- a/source/registry/reg_cachehook.c
+++ b/source/registry/reg_cachehook.c
@@ -47,18 +47,24 @@ bool reghook_cache_init( void )
 
 bool reghook_cache_add( REGISTRY_HOOK *hook )
 {
-   pstring key;
-   
-   if ( !hook )
-   return False;
-   
-   pstrcpy( key, \\);
-   pstrcat( key, hook-keyname );  
-   
-   pstring_sub( key, \\, / );
+   TALLOC_CTX *ctx = talloc_tos();
+   char *key = NULL;
+
+   if (!hook) {
+   return false;
+   }
+
+   key = talloc_asprintf(ctx, //%s, hook-keyname);
+   if (!key) {
+   return false;
+   }
+   key = talloc_string_sub(ctx, key, \\, /);
+   if (!key) {
+   return false;
+   }
 
DEBUG(10,(reghook_cache_add: Adding key [%s]\n, key));
-   
+
return pathtree_add( cache_tree, key, hook );
 }
 
diff --git a/source/registry/reg_db.c b/source/registry/reg_db.c
index 4947b2a..7c4ea18 100644
--- a/source/registry/reg_db.c
+++ b/source/registry/reg_db.c
@@ -82,10 +82,13 @@ static struct builtin_regkey_value 
builtin_registry_values[] = {
 /***
  Open the registry data in the tdb
  ***/
- 
+
 static bool init_registry_data( void )
 {
-   pstring path, base, remaining;
+   char *path = NULL;
+   char *base = NULL;
+   char *remaining = NULL;
+   TALLOC_CTX *ctx = talloc_tos();
fstring keyname, subkeyname;
REGSUBKEY_CTR *subkeys;
REGVAL_CTR *values;

svn commit: samba r26135 - in branches/SAMBA_4_0/source: dsdb/samdb libnet ntptr/simple_ldb rpc_server/drsuapi rpc_server/lsa rpc_server/samr

2007-11-26 Thread abartlet
Author: abartlet
Date: 2007-11-27 01:25:11 + (Tue, 27 Nov 2007)
New Revision: 26135

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

Log:
Remove samdb_add(), samdb_delete() and samdb_modify(), which were just
wrappers to ldb_add() etc.  samdb_replace() remains, as it sets flags on
all entries as 'replace'.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
   branches/SAMBA_4_0/source/libnet/libnet_join.c
   branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c
   branches/SAMBA_4_0/source/ntptr/simple_ldb/ntptr_simple_ldb.c
   branches/SAMBA_4_0/source/rpc_server/drsuapi/dcesrv_drsuapi.c
   branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c
   branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb.c2007-11-27 01:14:54 UTC 
(rev 26134)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb.c2007-11-27 01:25:11 UTC 
(rev 26135)
@@ -1022,30 +1022,6 @@
 }
 
 /*
-  add a record
-*/
-int samdb_add(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct 
ldb_message *msg)
-{
-   return ldb_add(sam_ldb, msg);
-}
-
-/*
-  delete a record
-*/
-int samdb_delete(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct 
ldb_dn *dn)
-{
-   return ldb_delete(sam_ldb, dn);
-}
-
-/*
-  modify a record
-*/
-int samdb_modify(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct 
ldb_message *msg)
-{
-   return ldb_modify(sam_ldb, msg);
-}
-
-/*
   replace elements in a record
 */
 int samdb_replace(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct 
ldb_message *msg)
@@ -1058,7 +1034,7 @@
}
 
/* modify the samdb record */
-   return samdb_modify(sam_ldb, mem_ctx, msg);
+   return ldb_modify(sam_ldb, msg);
 }
 
 /*
@@ -1992,7 +1968,7 @@
 foreignSecurityPrincipal);

/* create the alias */
-   ret = samdb_add(sam_ctx, mem_ctx, msg);
+   ret = ldb_add(sam_ctx, msg);
if (ret != 0) {
DEBUG(0,(Failed to create foreignSecurityPrincipal 
 record %s: %s\n, 

Modified: branches/SAMBA_4_0/source/libnet/libnet_join.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_join.c  2007-11-27 01:14:54 UTC 
(rev 26134)
+++ branches/SAMBA_4_0/source/libnet/libnet_join.c  2007-11-27 01:25:11 UTC 
(rev 26135)
@@ -1136,7 +1136,7 @@
}
 
/* create the secret */
-   ret = samdb_add(ldb, tmp_mem, msg);
+   ret = ldb_add(ldb, msg);
if (ret != 0) {
r-out.error_string = talloc_asprintf(mem_ctx, Failed to 
create secret record %s, 
  
ldb_dn_get_linearized(msg-dn));

Modified: branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c   2007-11-27 
01:14:54 UTC (rev 26134)
+++ branches/SAMBA_4_0/source/libnet/libnet_samsync_ldb.c   2007-11-27 
01:25:11 UTC (rev 26135)
@@ -101,7 +101,7 @@
*fsp_dn = msg-dn;
 
/* create the alias */
-   ret = samdb_add(state-sam_ldb, mem_ctx, msg);
+   ret = ldb_add(state-sam_ldb, msg);
if (ret != 0) {
*error_string = talloc_asprintf(mem_ctx, Failed to create 
foreignSecurityPrincipal 
record %s: %s,
@@ -429,7 +429,7 @@
}
}
 
-   ret = samdb_add(state-sam_ldb, mem_ctx, msg);
+   ret = ldb_add(state-sam_ldb, msg);
if (ret != 0) {
struct ldb_dn *first_try_dn = msg-dn;
/* Try again with the default DN */
@@ -440,7 +440,7 @@
return NT_STATUS_INTERNAL_DB_CORRUPTION;
} else {
msg-dn = talloc_steal(msg, remote_msgs[0]-dn);
-   ret = samdb_add(state-sam_ldb, mem_ctx, msg);
+   ret = ldb_add(state-sam_ldb, msg);
if (ret != 0) {
*error_string = 
talloc_asprintf(mem_ctx, Failed to create user record.  Tried both %s and %s: 
%s,

ldb_dn_get_linearized(first_try_dn),
@@ -493,7 +493,7 @@
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
 
-   ret = samdb_delete(state-sam_ldb, mem_ctx, msgs[0]-dn);
+   ret = ldb_delete(state-sam_ldb, msgs[0]-dn);
if (ret != 0) {
*error_string = talloc_asprintf(mem_ctx, Failed to delete user 
record %s: %s,


svn commit: samba r26136 - in branches/SAMBA_4_0/source: auth auth/gensec auth/ntlmssp dsdb ldap_server libcli libcli/ldap ntvfs

2007-11-26 Thread jelmer
Author: jelmer
Date: 2007-11-27 02:04:38 + (Tue, 27 Nov 2007)
New Revision: 26136

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

Log:
Attempt to fix dependencies for auth.
Modified:
   branches/SAMBA_4_0/source/auth/config.mk
   branches/SAMBA_4_0/source/auth/gensec/config.mk
   branches/SAMBA_4_0/source/auth/ntlmssp/config.mk
   branches/SAMBA_4_0/source/dsdb/config.mk
   branches/SAMBA_4_0/source/ldap_server/config.mk
   branches/SAMBA_4_0/source/libcli/config.mk
   branches/SAMBA_4_0/source/libcli/ldap/config.mk
   branches/SAMBA_4_0/source/ntvfs/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/auth/config.mk
===
--- branches/SAMBA_4_0/source/auth/config.mk2007-11-27 01:25:11 UTC (rev 
26135)
+++ branches/SAMBA_4_0/source/auth/config.mk2007-11-27 02:04:38 UTC (rev 
26136)
@@ -80,7 +80,6 @@
auth_util.o \
auth_simple.o
 PUBLIC_DEPENDENCIES = LIBSECURITY SAMDB CREDENTIALS
-PRIVATE_DEPENDENCIES = auth_session auth_system_session
 # End SUBSYSTEM auth
 ###
 

Modified: branches/SAMBA_4_0/source/auth/gensec/config.mk
===
--- branches/SAMBA_4_0/source/auth/gensec/config.mk 2007-11-27 01:25:11 UTC 
(rev 26135)
+++ branches/SAMBA_4_0/source/auth/gensec/config.mk 2007-11-27 02:04:38 UTC 
(rev 26136)
@@ -28,7 +28,7 @@
 SUBSYSTEM = gensec
 INIT_FUNCTION = gensec_gssapi_init
 OBJ_FILES = gensec_gssapi.o 
-PRIVATE_DEPENDENCIES = HEIMDAL_GSSAPI CREDENTIALS_KRB5 KERBEROS auth
+PRIVATE_DEPENDENCIES = HEIMDAL_GSSAPI CREDENTIALS_KRB5 KERBEROS 
 # End MODULE gensec_gssapi
 
 
@@ -38,7 +38,7 @@
 SUBSYSTEM = gensec
 INIT_FUNCTION = gensec_sasl_init
 OBJ_FILES = cyrus_sasl.o 
-PRIVATE_DEPENDENCIES = CREDENTIALS SASL auth
+PRIVATE_DEPENDENCIES = CREDENTIALS SASL 
 # End MODULE cyrus_sasl
 
 
@@ -61,7 +61,7 @@
 INIT_FUNCTION = gensec_schannel_init
 OBJ_FILES = schannel.o \
schannel_sign.o
-PRIVATE_DEPENDENCIES = auth SCHANNELDB NDR_SCHANNEL CREDENTIALS
+PRIVATE_DEPENDENCIES = SCHANNELDB NDR_SCHANNEL CREDENTIALS
 OUTPUT_TYPE = INTEGRATED
 # End MODULE gensec_schannel
 

Modified: branches/SAMBA_4_0/source/auth/ntlmssp/config.mk
===
--- branches/SAMBA_4_0/source/auth/ntlmssp/config.mk2007-11-27 01:25:11 UTC 
(rev 26135)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/config.mk2007-11-27 02:04:38 UTC 
(rev 26136)
@@ -12,7 +12,7 @@
ntlmssp_sign.o \
ntlmssp_client.o \
ntlmssp_server.o
-PRIVATE_DEPENDENCIES = auth MSRPC_PARSE
+PRIVATE_DEPENDENCIES = MSRPC_PARSE
 OUTPUT_TYPE = INTEGRATED
 # End MODULE gensec_ntlmssp
 

Modified: branches/SAMBA_4_0/source/dsdb/config.mk
===
--- branches/SAMBA_4_0/source/dsdb/config.mk2007-11-27 01:25:11 UTC (rev 
26135)
+++ branches/SAMBA_4_0/source/dsdb/config.mk2007-11-27 02:04:38 UTC (rev 
26136)
@@ -8,7 +8,8 @@
 PUBLIC_PROTO_HEADER = samdb/samdb_proto.h
 PUBLIC_HEADERS = samdb/samdb.h
 PUBLIC_DEPENDENCIES = LIBCLI_LDAP HEIMDAL_KRB5 
-PRIVATE_DEPENDENCIES = LIBNDR NDR_MISC NDR_DRSUAPI NDR_DRSBLOBS NSS_WRAPPER
+PRIVATE_DEPENDENCIES = LIBNDR NDR_MISC NDR_DRSUAPI NDR_DRSBLOBS NSS_WRAPPER \
+  auth_system_session
 OBJ_FILES = \
samdb/samdb.o \
samdb/samdb_privilege.o \

Modified: branches/SAMBA_4_0/source/ldap_server/config.mk
===
--- branches/SAMBA_4_0/source/ldap_server/config.mk 2007-11-27 01:25:11 UTC 
(rev 26135)
+++ branches/SAMBA_4_0/source/ldap_server/config.mk 2007-11-27 02:04:38 UTC 
(rev 26136)
@@ -13,7 +13,7 @@
ldap_extended.o
 PRIVATE_DEPENDENCIES = CREDENTIALS \
LIBCLI_LDAP SAMDB \
-   process_model auth \
+   process_model \
GENSEC_SOCKET
 # End SUBSYSTEM SMB
 ###

Modified: branches/SAMBA_4_0/source/libcli/config.mk
===
--- branches/SAMBA_4_0/source/libcli/config.mk  2007-11-27 01:25:11 UTC (rev 
26135)
+++ branches/SAMBA_4_0/source/libcli/config.mk  2007-11-27 02:04:38 UTC (rev 
26136)
@@ -34,7 +34,7 @@
smb_composite/fetchfile.o \
smb_composite/appendacl.o \
smb_composite/fsinfo.o 
-PUBLIC_DEPENDENCIES = LIBCLI_COMPOSITE CREDENTIALS
+PUBLIC_DEPENDENCIES = LIBCLI_COMPOSITE CREDENTIALS gensec
 
 [SUBSYSTEM::NDR_NBT_BUF]
 PRIVATE_PROTO_HEADER = nbt/nbtname.h

Modified: branches/SAMBA_4_0/source/libcli/ldap/config.mk

svn commit: samba r26137 - in branches/SAMBA_4_0/source: dsdb/samdb/ldb_modules selftest/env setup

2007-11-26 Thread abartlet
Author: abartlet
Date: 2007-11-27 02:26:47 + (Tue, 27 Nov 2007)
New Revision: 26137

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

Log:
Rename the entryUUID module to better match it's purpose: being a
simple ldap mapping (a complex mapping will follow).

Fix the module to handle 'name' better, rather than using the 'name'
attribute built into OpenLDAP, rename to samba4RDN.  We need to see if
this can be handled in the backend.

Also rename the functions and inernal module name to entryuuid for
consistancy.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/simple_ldap_map.c
Removed:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c
Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/config.mk
   branches/SAMBA_4_0/source/selftest/env/Samba4.pm
   branches/SAMBA_4_0/source/setup/provision
   branches/SAMBA_4_0/source/setup/schema-map-openldap-2.3


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


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

2007-11-26 Thread abartlet
Author: abartlet
Date: 2007-11-27 02:47:57 + (Tue, 27 Nov 2007)
New Revision: 26138

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

Log:
Don't talloc_free() res if an error occoured.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/cracknames.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/cracknames.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/cracknames.c   2007-11-27 02:26:47 UTC 
(rev 26137)
+++ branches/SAMBA_4_0/source/dsdb/samdb/cracknames.c   2007-11-27 02:47:57 UTC 
(rev 26138)
@@ -110,7 +110,10 @@
if (ret != LDB_SUCCESS  ret != LDB_ERR_NO_SUCH_OBJECT) {
DEBUG(1, (ldb_search: dn: %s not found: %s, service_dn_str, 
ldb_errstring(ldb_ctx)));
return DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
-   } else if (ret == LDB_ERR_NO_SUCH_OBJECT || res-count != 1) {
+   } else if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+   DEBUG(1, (ldb_search: dn: %s not found, service_dn_str));
+   return DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
+   } else if (res-count != 1) {
talloc_free(res);
DEBUG(1, (ldb_search: dn: %s not found, service_dn_str));
return DRSUAPI_DS_NAME_STATUS_NOT_FOUND;



svn commit: samba r26139 - in branches/SAMBA_4_0/source/scripting/libjs: .

2007-11-26 Thread abartlet
Author: abartlet
Date: 2007-11-27 02:49:37 + (Tue, 27 Nov 2007)
New Revision: 26139

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

Log:
Based on a report by Theodor Chirana, don't assert() on invalid
netbios names at this point, the calling order has changed, and we
have a more informative place to do it.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/scripting/libjs/provision.js


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js  2007-11-27 
02:47:57 UTC (rev 26138)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js  2007-11-27 
02:49:37 UTC (rev 26139)
@@ -464,9 +464,7 @@
subobj.REALM   = strupper(subobj.REALM);
subobj.HOSTNAME= strlower(subobj.HOSTNAME);
subobj.DOMAIN  = strupper(subobj.DOMAIN);
-   assert(valid_netbios_name(subobj.DOMAIN));
subobj.NETBIOSNAME = strupper(subobj.HOSTNAME);
-   assert(valid_netbios_name(subobj.NETBIOSNAME));
subobj.DNSDOMAIN= strlower(subobj.REALM);
subobj.DNSNAME  = sprintf(%s.%s, 
  strlower(subobj.HOSTNAME), 



svn commit: samba r26140 - in branches/SAMBA_4_0: source/dsdb/samdb/ldb_modules testprogs/ejs

2007-11-26 Thread abartlet
Author: abartlet
Date: 2007-11-27 04:43:20 + (Tue, 27 Nov 2007)
New Revision: 26140

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

Log:
Add a new test for searches by distinguieshedName and dn, and
implement these in the simple ldap mapping module.

We still don't pass this test, because we must get linked attributes
into OpenLDAP.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/simple_ldap_map.c
   branches/SAMBA_4_0/testprogs/ejs/ldap.js


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/simple_ldap_map.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/simple_ldap_map.c  
2007-11-27 02:49:37 UTC (rev 26139)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/simple_ldap_map.c  
2007-11-27 04:43:20 UTC (rev 26140)
@@ -376,6 +376,15 @@
}
},
{
+   .local_name = dn,
+   .type = MAP_RENAME,
+   .u = {
+   .rename = {
+.remote_name = entryDN
+}
+   }
+   },
+   {
.local_name = groupType,
.type = MAP_CONVERT,
.u = {
@@ -525,6 +534,15 @@
}
},
{
+   .local_name = dn,
+   .type = MAP_RENAME,
+   .u = {
+   .rename = {
+.remote_name = entryDN
+}
+   }
+   },
+   {
.local_name = groupType,
.type = MAP_CONVERT,
.u = {

Modified: branches/SAMBA_4_0/testprogs/ejs/ldap.js
===
--- branches/SAMBA_4_0/testprogs/ejs/ldap.js2007-11-27 02:49:37 UTC (rev 
26139)
+++ branches/SAMBA_4_0/testprogs/ejs/ldap.js2007-11-27 04:43:20 UTC (rev 
26140)
@@ -230,6 +230,28 @@
assert(res.msgs[0].cn == ldaptestUSER3);
assert(res.msgs[0].name == ldaptestUSER3);
 
+   println(Testing ldb.search for (dn=CN=ldaptestUSER3,CN=Users, + 
base_dn + ));
+   var res = ldb.search((dn=CN=ldaptestUSER3,CN=Users, + base_dn + ));
+   if (res.error != 0 || res.msgs.length != 1) {
+   println(Could not find (dn=CN=ldaptestUSER3,CN=Users, + 
base_dn + ));
+   assert(res.error == 0);
+   assert(res.msgs.length == 1);
+   }
+   assert(res.msgs[0].dn == (CN=ldaptestUSER3,CN=Users, + base_dn));
+   assert(res.msgs[0].cn == ldaptestUSER3);
+   assert(res.msgs[0].name == ldaptestUSER3);
+
+   println(Testing ldb.search for 
(distinguishedName=CN=ldaptestUSER3,CN=Users, + base_dn + ));
+   var res = ldb.search((distinguishedName=CN=ldaptestUSER3,CN=Users, + 
base_dn + ));
+   if (res.error != 0 || res.msgs.length != 1) {
+   println(Could not find (dn=CN=ldaptestUSER3,CN=Users, + 
base_dn + ));
+   assert(res.error == 0);
+   assert(res.msgs.length == 1);
+   }
+   assert(res.msgs[0].dn == (CN=ldaptestUSER3,CN=Users, + base_dn));
+   assert(res.msgs[0].cn == ldaptestUSER3);
+   assert(res.msgs[0].name == ldaptestUSER3);
+
// ensure we cannot add it again
ok = ldb.add(
 dn: cn=ldaptestuser3,cn=userS, + base_dn +