[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-119-g772d5de

Günther Deschner gd at samba.org
Mon Jun 29 20:37:37 GMT 2009


The branch, master has been updated
       via  772d5dea303813514d53a42ac4114da8a9cb1c5a (commit)
       via  28ef5c3ece00e9f314709e74f28dc2ebc3987015 (commit)
      from  ce8159b30e751c9856e983c5b351741ce4b14558 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 772d5dea303813514d53a42ac4114da8a9cb1c5a
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jun 24 00:24:03 2009 +0200

    s4-smbtorture: correctly test comment behaviour in RPC-SAMR-USERS against s3.
    
    Guenther

commit 28ef5c3ece00e9f314709e74f28dc2ebc3987015
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jun 24 00:23:09 2009 +0200

    s3-pdb_tdb: give 'unknown_str' the proper name 'comment' and set comment in passdb.
    
    pdb_{get,set}_comment were already existing in the API but were never used.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/passdb/passdb.c    |   25 +++++++++++++++----------
 source4/torture/rpc/samr.c |   11 ++++-------
 2 files changed, 19 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 502c372..4ed04e4 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -1519,7 +1519,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
 	char *domain = NULL;
 	char *nt_username = NULL;
 	char *dir_drive = NULL;
-	char *unknown_str = NULL;
+	char *comment = NULL;
 	char *munged_dial = NULL;
 	char *fullname = NULL;
 	char *homedir = NULL;
@@ -1528,7 +1528,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
 	char *acct_desc = NULL;
 	char *workstations = NULL;
 	uint32	username_len, domain_len, nt_username_len,
-		dir_drive_len, unknown_str_len, munged_dial_len,
+		dir_drive_len, comment_len, munged_dial_len,
 		fullname_len, homedir_len, logon_script_len,
 		profile_path_len, acct_desc_len, workstations_len;
 
@@ -1570,7 +1570,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
 		&profile_path_len, &profile_path,			/* B */
 		&acct_desc_len, &acct_desc,				/* B */
 		&workstations_len, &workstations,			/* B */
-		&unknown_str_len, &unknown_str,				/* B */
+		&comment_len, &comment,					/* B */
 		&munged_dial_len, &munged_dial,				/* B */
 		&user_rid,						/* d */
 		&group_rid,						/* d */
@@ -1656,6 +1656,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
 	}
 
 	pdb_set_acct_desc(sampass, acct_desc, PDB_SET);
+	pdb_set_comment(sampass, comment, PDB_SET);
 	pdb_set_workstations(sampass, workstations, PDB_SET);
 	pdb_set_munged_dial(sampass, munged_dial, PDB_SET);
 
@@ -1724,7 +1725,7 @@ done:
 	SAFE_FREE(acct_desc);
 	SAFE_FREE(workstations);
 	SAFE_FREE(munged_dial);
-	SAFE_FREE(unknown_str);
+	SAFE_FREE(comment);
 	SAFE_FREE(lm_pw_ptr);
 	SAFE_FREE(nt_pw_ptr);
 	SAFE_FREE(nt_pw_hist_ptr);
@@ -1757,7 +1758,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
 	const char *domain;
 	const char *nt_username;
 	const char *dir_drive;
-	const char *unknown_str;
+	const char *comment;
 	const char *munged_dial;
 	const char *fullname;
 	const char *homedir;
@@ -1766,7 +1767,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
 	const char *acct_desc;
 	const char *workstations;
 	uint32	username_len, domain_len, nt_username_len,
-		dir_drive_len, unknown_str_len, munged_dial_len,
+		dir_drive_len, comment_len, munged_dial_len,
 		fullname_len, homedir_len, logon_script_len,
 		profile_path_len, acct_desc_len, workstations_len;
 
@@ -1900,8 +1901,12 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
 		workstations_len = 0;
 	}
 
-	unknown_str = NULL;
-	unknown_str_len = 0;
+	comment = pdb_get_comment(sampass);
+	if (comment) {
+		comment_len = strlen(comment) +1;
+	} else {
+		comment_len = 0;
+	}
 
 	munged_dial = pdb_get_munged_dial(sampass);
 	if (munged_dial) {
@@ -1931,7 +1936,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
 		profile_path_len, profile_path,		/* B */
 		acct_desc_len, acct_desc,		/* B */
 		workstations_len, workstations,		/* B */
-		unknown_str_len, unknown_str,		/* B */
+		comment_len, comment,			/* B */
 		munged_dial_len, munged_dial,		/* B */
 		user_rid,				/* d */
 		group_rid,				/* d */
@@ -1975,7 +1980,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
 		profile_path_len, profile_path,		/* B */
 		acct_desc_len, acct_desc,		/* B */
 		workstations_len, workstations,		/* B */
-		unknown_str_len, unknown_str,		/* B */
+		comment_len, comment,			/* B */
 		munged_dial_len, munged_dial,		/* B */
 		user_rid,				/* d */
 		group_rid,				/* d */
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index be2bfef..11f7b3e 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -339,13 +339,10 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx
 	q0.in.level = 12;
 	do { TESTCALL(QueryUserInfo, q0) } while (0);
 
-	/* Samba 3 cannot store comment fields atm. - gd */
-	if (!torture_setting_bool(tctx, "samba3", false)) {
-		TEST_USERINFO_STRING(2, comment,  1, comment, "xx2-1 comment", 0);
-		TEST_USERINFO_STRING(2, comment, 21, comment, "xx2-21 comment", 0);
-		TEST_USERINFO_STRING(21, comment, 21, comment, "xx21-21 comment",
-				   SAMR_FIELD_COMMENT);
-	}
+	TEST_USERINFO_STRING(2, comment,  1, comment, "xx2-1 comment", 0);
+	TEST_USERINFO_STRING(2, comment, 21, comment, "xx2-21 comment", 0);
+	TEST_USERINFO_STRING(21, comment, 21, comment, "xx21-21 comment",
+			   SAMR_FIELD_COMMENT);
 
 	test_account_name = talloc_asprintf(tctx, "%sxx7-1", base_account_name);
 	TEST_USERINFO_STRING(7, account_name,  1, account_name, base_account_name, 0);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list