[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-918-g2cbff74

Matthias Dieter Wallnöfer mdw at samba.org
Fri Oct 2 09:35:57 MDT 2009


The branch, master has been updated
       via  2cbff7496e477f9af180a564dbd908ec2a968716 (commit)
       via  6edb92f33785bb07f1bafc3c8729dc505282b9f7 (commit)
       via  44df2488e30da783add33b4fb85d96ce65856484 (commit)
       via  f390daef475126b4ff5a3d0ffd2babbd87d4c22b (commit)
       via  d87cfc7cc4d9a547b86e82c418e7e2a8c36e0afa (commit)
      from  3f59705a7120df61effe054cfb21219637662b14 (commit)

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


- Log -----------------------------------------------------------------
commit 2cbff7496e477f9af180a564dbd908ec2a968716
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Fri Sep 25 18:03:31 2009 +0200

    s4:samdb_set_password - Return the maximum password age when requested (not the minimum one)

commit 6edb92f33785bb07f1bafc3c8729dc505282b9f7
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Wed Sep 23 19:23:17 2009 +0200

    s4:samdb_set_password - cosmetic fixes

commit 44df2488e30da783add33b4fb85d96ce65856484
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Tue Sep 29 11:49:50 2009 +0200

    s4: fix various warnings (not "const" related ones)

commit f390daef475126b4ff5a3d0ffd2babbd87d4c22b
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Tue Sep 29 11:49:50 2009 +0200

    s4/srvsvc: deactivate a "ntvfs_connect" with a wrong parameter
    
    In the srvsvc code for s4 (NTVFS module) there exists a call to "ntvfs_connect"
    which is performed with a totally wrong argument. Since I'm not able to fix
    this, I commented it out and added a "FIXME" comment.

commit d87cfc7cc4d9a547b86e82c418e7e2a8c36e0afa
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Fri Oct 2 15:21:17 2009 +0200

    s4:provision_users.ldif - Put potential primary groups in front of the file
    
    (So they can be always found by the SAMLDB module)

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

Summary of changes:
 source4/client/client.c                  |   44 +++++++-----
 source4/dsdb/common/util.c               |  107 +++++++++++++++++-------------
 source4/dsdb/samdb/ldb_modules/anr.c     |   14 ++--
 source4/lib/com/main.c                   |    2 +-
 source4/lib/socket/socket.h              |    2 +-
 source4/libcli/ldap/ldap_client.c        |    1 -
 source4/libcli/ldap/ldap_controls.c      |    4 +-
 source4/libcli/security/object_tree.c    |    6 +-
 source4/libnet/libnet_samsync.c          |    2 +-
 source4/librpc/rpc/pyrpc.h               |    2 +-
 source4/ntvfs/simple/vfs_simple.c        |    6 +-
 source4/rpc_server/common/common.h       |    4 +-
 source4/rpc_server/srvsvc/srvsvc_ntvfs.c |    4 +-
 source4/setup/provision_users.ldif       |   39 ++++++-----
 source4/torture/raw/notify.c             |    6 +-
 source4/torture/rpc/lsa_lookup.c         |    4 +-
 source4/torture/rpc/samba3rpc.c          |   12 ++--
 source4/torture/rpc/samlogon.c           |    2 +-
 source4/torture/rpc/samsync.c            |    2 +-
 source4/torture/rpc/schannel.c           |    2 +-
 source4/torture/smb2/compound.c          |    4 -
 source4/torture/smb2/dir.c               |    6 +-
 source4/winbind/wb_cmd_getgrgid.c        |    2 +-
 source4/winbind/wb_cmd_getgrnam.c        |    2 +-
 source4/winbind/wb_cmd_getpwuid.c        |    2 +-
 source4/winbind/wb_gid2sid.c             |    2 +-
 source4/winbind/wb_irpc.c                |    4 +-
 source4/winbind/wb_sids2xids.c           |    2 +-
 source4/winbind/wb_uid2sid.c             |    2 +-
 source4/winbind/wb_xids2sids.c           |    2 +-
 30 files changed, 156 insertions(+), 137 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/client/client.c b/source4/client/client.c
index 3fa819c..c1292a2 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -264,9 +264,9 @@ static int do_cd(struct smbclient_context *ctx, const char *newdir)
 	/* Save the current directory in case the
 	   new directory is invalid */
 	if (newdir[0] == '\\')
-		dname = talloc_strdup(NULL, newdir);
+		dname = talloc_strdup(ctx, newdir);
 	else
-		dname = talloc_asprintf(NULL, "%s\\%s", ctx->remote_cur_dir, newdir);
+		dname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, newdir);
 
 	dos_format(dname);
 
@@ -685,7 +685,7 @@ static int cmd_du(struct smbclient_context *ctx, const char **args)
 /****************************************************************************
   get a file from rname to lname
   ****************************************************************************/
-static int do_get(struct smbclient_context *ctx, char *rname, const char *lname, bool reget)
+static int do_get(struct smbclient_context *ctx, char *rname, const char *p_lname, bool reget)
 {  
 	int handle = 0, fnum;
 	bool newhandle = false;
@@ -697,11 +697,14 @@ static int do_get(struct smbclient_context *ctx, char *rname, const char *lname,
 	off_t start = 0;
 	off_t nread = 0;
 	int rc = 0;
+	char *lname;
+
 
+	lname = talloc_strdup(ctx, p_lname);
 	GetTimeOfDay(&tp_start);
 
 	if (ctx->lowercase) {
-		strlower(discard_const_p(char, lname));
+		strlower(lname);
 	}
 
 	fnum = smbcli_open(ctx->cli->tree, rname, O_RDONLY, DENY_NONE);
@@ -858,6 +861,7 @@ static void do_mget(struct smbclient_context *ctx, struct clilist_file_info *fin
 	char *quest;
 	char *mget_mask;
 	char *saved_curdir;
+	char *l_fname;
 
 	if (ISDOT(finfo->name) || ISDOTDOT(finfo->name))
 		return;
@@ -879,27 +883,29 @@ static void do_mget(struct smbclient_context *ctx, struct clilist_file_info *fin
 	}
 
 	/* handle directories */
-	saved_curdir = talloc_strdup(NULL, ctx->remote_cur_dir);
+	saved_curdir = talloc_strdup(ctx, ctx->remote_cur_dir);
 
 	ctx->remote_cur_dir = talloc_asprintf_append_buffer(NULL, "%s\\", finfo->name);
 
-	string_replace(discard_const_p(char, finfo->name), '\\', '/');
+	l_fname = talloc_strdup(ctx, finfo->name);
+
+	string_replace(l_fname, '\\', '/');
 	if (ctx->lowercase) {
-		strlower(discard_const_p(char, finfo->name));
+		strlower(l_fname);
 	}
 	
-	if (!directory_exist(finfo->name) && 
-	    mkdir(finfo->name,0777) != 0) {
-		d_printf("failed to create directory %s\n",finfo->name);
+	if (!directory_exist(l_fname) &&
+	    mkdir(l_fname, 0777) != 0) {
+		d_printf("failed to create directory %s\n", l_fname);
 		return;
 	}
 	
-	if (chdir(finfo->name) != 0) {
-		d_printf("failed to chdir to directory %s\n",finfo->name);
+	if (chdir(l_fname) != 0) {
+		d_printf("failed to chdir to directory %s\n", l_fname);
 		return;
 	}
 
-	mget_mask = talloc_asprintf(NULL, "%s*", ctx->remote_cur_dir);
+	mget_mask = talloc_asprintf(ctx, "%s*", ctx->remote_cur_dir);
 	
 	do_list(ctx, mget_mask, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY,do_mget,false, true);
 	chdir("..");
@@ -963,7 +969,7 @@ static int cmd_mget(struct smbclient_context *ctx, const char **args)
 		attribute |= FILE_ATTRIBUTE_DIRECTORY;
 	
 	for (i = 1; args[i]; i++) {
-		mget_mask = talloc_strdup(ctx,ctx->remote_cur_dir);
+		mget_mask = talloc_strdup(ctx, ctx->remote_cur_dir);
 		if(mget_mask[strlen(mget_mask)-1]!='\\')
 			mget_mask = talloc_append_string(ctx, mget_mask, "\\");
 		
@@ -1292,7 +1298,7 @@ static bool seek_list(struct file_list *list, char *name)
 static int cmd_select(struct smbclient_context *ctx, const char **args)
 {
 	talloc_free(ctx->fileselection);
-	ctx->fileselection = talloc_strdup(NULL, args[1]);
+	ctx->fileselection = talloc_strdup(ctx, args[1]);
 
 	return 0;
 }
@@ -1533,7 +1539,7 @@ static int cmd_del(struct smbclient_context *ctx, const char **args)
 		d_printf("del <filename>\n");
 		return 1;
 	}
-	mask = talloc_asprintf(ctx,"%s%s", ctx->remote_cur_dir, args[1]);
+	mask = talloc_asprintf(ctx, "%s%s", ctx->remote_cur_dir, args[1]);
 
 	if (NT_STATUS_IS_ERR(smbcli_unlink(ctx->cli->tree, mask))) {
 		d_printf("%s deleting remote file %s\n",smbcli_errstr(ctx->cli->tree),mask);
@@ -2994,7 +3000,7 @@ static int process_line(struct smbclient_context *ctx, const char *cline)
 	int i;
 
 	/* and get the first part of the command */
-	args = str_list_make_shell(ctx, cline, NULL);
+	args = (const char **) str_list_make_shell(ctx, cline, NULL);
 	if (!args || !args[0])
 		return 0;
 
@@ -3151,12 +3157,12 @@ static int do_message_op(const char *netbios_name, const char *desthost,
 ****************************************************************************/
  int main(int argc,char *argv[])
 {
-	const char *base_directory = NULL;
+	char *base_directory = NULL;
 	const char *dest_ip = NULL;
 	int opt;
 	const char *query_host = NULL;
 	bool message = false;
-	const char *desthost = NULL;
+	char *desthost = NULL;
 	poptContext pc;
 	const char *service = NULL;
 	int port = 0;
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 72cbf63..ce74c7b 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -1586,18 +1586,19 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 			    enum samr_RejectReason *reject_reason,
 			    struct samr_DomInfo1 **_dominfo)
 {
-	const char * const user_attrs[] = { "userAccountControl", "lmPwdHistory", 
+	const char * const user_attrs[] = { "userAccountControl",
+					    "lmPwdHistory",
 					    "ntPwdHistory", 
 					    "dBCSPwd", "unicodePwd", 
 					    "objectSid", 
 					    "pwdLastSet", NULL };
-	const char * const domain_attrs[] = { "pwdProperties", "pwdHistoryLength", 
-					      "maxPwdAge", "minPwdAge", 
-					      "minPwdLength", NULL };
+	const char * const domain_attrs[] = { "minPwdLength", "pwdProperties",
+					      "pwdHistoryLength",
+					      "maxPwdAge", "minPwdAge", NULL };
 	NTTIME pwdLastSet;
-	int64_t minPwdAge;
-	uint_t minPwdLength, pwdProperties, pwdHistoryLength;
-	uint_t userAccountControl;
+	uint32_t minPwdLength, pwdProperties, pwdHistoryLength;
+	int64_t maxPwdAge, minPwdAge;
+	uint32_t userAccountControl;
 	struct samr_Password *sambaLMPwdHistory, *sambaNTPwdHistory,
 		*lmPwdHash, *ntPwdHash, *lmNewHash, *ntNewHash;
 	struct samr_Password local_lmNewHash, local_ntNewHash;
@@ -1618,14 +1619,14 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 	if (count != 1) {
 		return NT_STATUS_INTERNAL_DB_CORRUPTION;
 	}
-	userAccountControl = samdb_result_uint(res[0],   "userAccountControl", 0);
-	sambaLMPwdHistory_len =   samdb_result_hashes(mem_ctx, res[0], 
-						 "lmPwdHistory", &sambaLMPwdHistory);
-	sambaNTPwdHistory_len =   samdb_result_hashes(mem_ctx, res[0], 
-						 "ntPwdHistory", &sambaNTPwdHistory);
-	lmPwdHash =          samdb_result_hash(mem_ctx, res[0],   "dBCSPwd");
-	ntPwdHash =          samdb_result_hash(mem_ctx, res[0],   "unicodePwd");
-	pwdLastSet =         samdb_result_uint64(res[0], "pwdLastSet", 0);
+	userAccountControl = samdb_result_uint(res[0], "userAccountControl", 0);
+	sambaLMPwdHistory_len = samdb_result_hashes(mem_ctx, res[0],
+					 "lmPwdHistory", &sambaLMPwdHistory);
+	sambaNTPwdHistory_len = samdb_result_hashes(mem_ctx, res[0],
+					 "ntPwdHistory", &sambaNTPwdHistory);
+	lmPwdHash = samdb_result_hash(mem_ctx, res[0], "dBCSPwd");
+	ntPwdHash = samdb_result_hash(mem_ctx, res[0], "unicodePwd");
+	pwdLastSet = samdb_result_uint64(res[0], "pwdLastSet", 0);
 
 	/* Copy parameters */
 	lmNewHash = param_lmNewHash;
@@ -1638,9 +1639,10 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 					       |UF_WORKSTATION_TRUST_ACCOUNT
 					       |UF_SERVER_TRUST_ACCOUNT)); 
 
-	if (domain_dn) {
+	if (domain_dn != NULL) {
 		/* pull the domain parameters */
-		count = gendb_search_dn(ctx, mem_ctx, domain_dn, &res, domain_attrs);
+		count = gendb_search_dn(ctx, mem_ctx, domain_dn, &res,
+								domain_attrs);
 		if (count != 1) {
 			DEBUG(2, ("samdb_set_password: Domain DN %s is invalid, for user %s\n", 
 				  ldb_dn_get_linearized(domain_dn),
@@ -1649,14 +1651,15 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		}
 	} else {
 		/* work out the domain sid, and pull the domain from there */
-		domain_sid =         samdb_result_sid_prefix(mem_ctx, res[0], "objectSid");
+		domain_sid = samdb_result_sid_prefix(mem_ctx, res[0],
+								"objectSid");
 		if (domain_sid == NULL) {
 			return NT_STATUS_INTERNAL_DB_CORRUPTION;
 		}
 
 		count = gendb_search(ctx, mem_ctx, NULL, &res, domain_attrs, 
-				     "(objectSid=%s)", 
-				     ldap_encode_ndr_dom_sid(mem_ctx, domain_sid));
+				"(objectSid=%s)",
+				ldap_encode_ndr_dom_sid(mem_ctx, domain_sid));
 		if (count != 1) {
 			DEBUG(2, ("samdb_set_password: Could not find domain to match SID: %s, for user %s\n", 
 				  dom_sid_string(mem_ctx, domain_sid),
@@ -1665,17 +1668,18 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		}
 	}
 
-	pwdProperties =    samdb_result_uint(res[0],   "pwdProperties", 0);
-	pwdHistoryLength = samdb_result_uint(res[0],   "pwdHistoryLength", 0);
-	minPwdLength =     samdb_result_uint(res[0],   "minPwdLength", 0);
-	minPwdAge =        samdb_result_int64(res[0],  "minPwdAge", 0);
+	minPwdLength = samdb_result_uint(res[0], "minPwdLength", 0);
+	pwdProperties = samdb_result_uint(res[0], "pwdProperties", 0);
+	pwdHistoryLength = samdb_result_uint(res[0], "pwdHistoryLength", 0);
+	maxPwdAge = samdb_result_int64(res[0], "maxPwdAge", 0);
+	minPwdAge = samdb_result_int64(res[0], "minPwdAge", 0);
 
-	if (userAccountControl & UF_PASSWD_NOTREQD) {
+	if ((userAccountControl & UF_PASSWD_NOTREQD) != 0) {
 		/* see [MS-ADTS] 2.2.15 */
 		minPwdLength = 0;
 	}
 
-	if (_dominfo) {
+	if (_dominfo != NULL) {
 		struct samr_DomInfo1 *dominfo;
 		/* on failure we need to fill in the reject reasons */
 		dominfo = talloc(mem_ctx, struct samr_DomInfo1);
@@ -1685,16 +1689,18 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		dominfo->min_password_length     = minPwdLength;
 		dominfo->password_properties     = pwdProperties;
 		dominfo->password_history_length = pwdHistoryLength;
-		dominfo->max_password_age        = minPwdAge;
+		dominfo->max_password_age        = maxPwdAge;
 		dominfo->min_password_age        = minPwdAge;
 		*_dominfo = dominfo;
 	}
 
-	if (restrictions && new_password) {
+	if ((restrictions != 0) && (new_password != 0)) {
 		char *new_pass;
 
-		/* check the various password restrictions */
-		if (restrictions && minPwdLength > utf16_len_n(new_password->data, new_password->length) / 2) {
+		/* checks if the "minPwdLength" property is satisfied */
+		if ((restrictions != 0)
+			&& (minPwdLength > utf16_len_n(
+				new_password->data, new_password->length)/2)) {
 			if (reject_reason) {
 				*reject_reason = SAMR_REJECT_TOO_SHORT;
 			}
@@ -1702,7 +1708,8 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		}
 
 		/* Create the NT hash */
-		mdfour(local_ntNewHash.hash, new_password->data, new_password->length);
+		mdfour(local_ntNewHash.hash, new_password->data,
+							new_password->length);
 
 		ntNewHash = &local_ntNewHash;
 
@@ -1713,9 +1720,11 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 			  new_password->data, new_password->length,
 			  (void **)&new_pass, NULL, false)) {
 
-			/* possibly check password complexity */
-			if (restrictions && (pwdProperties & DOMAIN_PASSWORD_COMPLEX) &&
-			    !check_password_quality(new_pass)) {
+			/* checks the password complexity */
+			if ((restrictions != 0)
+				&& ((pwdProperties
+					& DOMAIN_PASSWORD_COMPLEX) != 0)
+				&& (!check_password_quality(new_pass))) {
 				if (reject_reason) {
 					*reject_reason = SAMR_REJECT_COMPLEXITY;
 				}
@@ -1729,24 +1738,24 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		}
 	}
 
-	if (restrictions && user_change) {
+	if ((restrictions != 0) && user_change) {
 		/* are all password changes disallowed? */
-		if (pwdProperties & DOMAIN_REFUSE_PASSWORD_CHANGE) {
+		if ((pwdProperties & DOMAIN_REFUSE_PASSWORD_CHANGE) != 0) {
 			if (reject_reason) {
 				*reject_reason = SAMR_REJECT_OTHER;
 			}
 			return NT_STATUS_PASSWORD_RESTRICTION;
 		}
 
-		/* can this user change password? */
-		if (userAccountControl & UF_PASSWD_CANT_CHANGE) {
+		/* can this user change the password? */
+		if ((userAccountControl & UF_PASSWD_CANT_CHANGE) != 0) {
 			if (reject_reason) {
 				*reject_reason = SAMR_REJECT_OTHER;
 			}
 			return NT_STATUS_PASSWORD_RESTRICTION;
 		}
 
-		/* yes, this is a minus. The ages are in negative 100nsec units! */
+		/* Password minimum age: yes, this is a minus. The ages are in negative 100nsec units! */
 		if (pwdLastSet - minPwdAge > now_nt) {
 			if (reject_reason) {
 				*reject_reason = SAMR_REJECT_OTHER;
@@ -1756,13 +1765,15 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 
 		/* check the immediately past password */
 		if (pwdHistoryLength > 0) {
-			if (lmNewHash && lmPwdHash && memcmp(lmNewHash->hash, lmPwdHash->hash, 16) == 0) {
+			if (lmNewHash && lmPwdHash && memcmp(lmNewHash->hash,
+					lmPwdHash->hash, 16) == 0) {
 				if (reject_reason) {
 					*reject_reason = SAMR_REJECT_IN_HISTORY;
 				}
 				return NT_STATUS_PASSWORD_RESTRICTION;
 			}
-			if (ntNewHash && ntPwdHash && memcmp(ntNewHash->hash, ntPwdHash->hash, 16) == 0) {
+			if (ntNewHash && ntPwdHash && memcmp(ntNewHash->hash,
+					ntPwdHash->hash, 16) == 0) {
 				if (reject_reason) {
 					*reject_reason = SAMR_REJECT_IN_HISTORY;
 				}
@@ -1771,11 +1782,14 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 		}
 
 		/* check the password history */
-		sambaLMPwdHistory_len = MIN(sambaLMPwdHistory_len, pwdHistoryLength);
-		sambaNTPwdHistory_len = MIN(sambaNTPwdHistory_len, pwdHistoryLength);
+		sambaLMPwdHistory_len = MIN(sambaLMPwdHistory_len,
+							pwdHistoryLength);
+		sambaNTPwdHistory_len = MIN(sambaNTPwdHistory_len,
+							pwdHistoryLength);
 
 		for (i=0; lmNewHash && i<sambaLMPwdHistory_len;i++) {
-			if (memcmp(lmNewHash->hash, sambaLMPwdHistory[i].hash, 16) == 0) {
+			if (memcmp(lmNewHash->hash, sambaLMPwdHistory[i].hash,
+					16) == 0) {
 				if (reject_reason) {
 					*reject_reason = SAMR_REJECT_IN_HISTORY;
 				}
@@ -1783,7 +1797,8 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 			}
 		}
 		for (i=0; ntNewHash && i<sambaNTPwdHistory_len;i++) {
-			if (memcmp(ntNewHash->hash, sambaNTPwdHistory[i].hash, 16) == 0) {
+			if (memcmp(ntNewHash->hash, sambaNTPwdHistory[i].hash,
+					 16) == 0) {
 				if (reject_reason) {
 					*reject_reason = SAMR_REJECT_IN_HISTORY;
 				}
@@ -1795,7 +1810,7 @@ NTSTATUS samdb_set_password(struct ldb_context *ctx, TALLOC_CTX *mem_ctx,
 #define CHECK_RET(x) do { if (x != 0) return NT_STATUS_NO_MEMORY; } while(0)
 
 	/* the password is acceptable. Start forming the new fields */
-	if (new_password) {
+	if (new_password != NULL) {
 		/* if we know the cleartext UTF16 password, then set it.
 		 * Modules in ldb will set all the appropriate
 		 * hashes */
diff --git a/source4/dsdb/samdb/ldb_modules/anr.c b/source4/dsdb/samdb/ldb_modules/anr.c
index deeccac..a5220b3 100644
--- a/source4/dsdb/samdb/ldb_modules/anr.c
+++ b/source4/dsdb/samdb/ldb_modules/anr.c
@@ -67,8 +67,10 @@ static struct ldb_parse_tree *make_parse_list(struct ldb_module *module,
  * Make an equality or prefix match tree, from the attribute, operation and matching value supplied
  */
 static struct ldb_parse_tree *make_match_tree(struct ldb_module *module,
-				       TALLOC_CTX *mem_ctx, enum ldb_parse_op op, 
-				       const char *attr, const DATA_BLOB *match)
+					      TALLOC_CTX *mem_ctx,
+					      enum ldb_parse_op op,
+					      const char *attr,
+					      struct ldb_val *match)
 {
 	struct ldb_context *ldb;
 	struct ldb_parse_tree *match_tree;
@@ -123,7 +125,7 @@ struct anr_context {
  */
 static int anr_replace_value(struct anr_context *ac,
 			     TALLOC_CTX *mem_ctx,
-			     const struct ldb_val *match,
+			     struct ldb_val *match,
 			     struct ldb_parse_tree **ntree)
 {
 	struct ldb_parse_tree *tree = NULL;
@@ -146,7 +148,7 @@ static int anr_replace_value(struct anr_context *ac,
 	ac->found_anr = true;
 
 	if (match->length > 1 && match->data[0] == '=') {
-		DATA_BLOB *match2 = talloc(mem_ctx, DATA_BLOB);
+		struct ldb_val *match2 = talloc(mem_ctx, struct ldb_val);
 		*match2 = data_blob_const(match->data+1, match->length - 1);
 		if (match2 == NULL){
 			ldb_oom(ldb);
@@ -181,8 +183,8 @@ static int anr_replace_value(struct anr_context *ac,
 
 	if (p) {
 		struct ldb_parse_tree *first_split_filter, *second_split_filter, *split_filters, *match_tree_1, *match_tree_2;
-		DATA_BLOB *first_match = talloc(tree, DATA_BLOB);
-		DATA_BLOB *second_match = talloc(tree, DATA_BLOB);
+		struct ldb_val *first_match = talloc(tree, struct ldb_val);
+		struct ldb_val *second_match = talloc(tree, struct ldb_val);
 		if (!first_match || !second_match) {
 			ldb_oom(ldb);
 			return LDB_ERR_OPERATIONS_ERROR;
diff --git a/source4/lib/com/main.c b/source4/lib/com/main.c
index 062d136..487ed5b 100644
--- a/source4/lib/com/main.c
+++ b/source4/lib/com/main.c
@@ -52,7 +52,7 @@ WERROR com_create_object(struct com_context *ctx, struct GUID *clsid, int num_if
 	}
 
 	/* Run IClassFactory::CreateInstance() */
-	error = IClassFactory_CreateInstance(factory, ctx, NULL, &classfact_iid, &iunk);
+	error = IClassFactory_CreateInstance(factory, ctx, NULL, &classfact_iid, (struct MInterfacePointer *) &iunk);
 	if (!W_ERROR_IS_OK(error)) {
 		DEBUG(3, ("Error while calling IClassFactory::CreateInstance : %s\n", win_errstr(error)));
 		return error;
diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h
index 0f469e5..0287245 100644
--- a/source4/lib/socket/socket.h
+++ b/source4/lib/socket/socket.h
@@ -206,7 +206,7 @@ NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx, const char *server_address,
 			      struct socket_context **result,
 			      uint16_t *port);
 void set_socket_options(int fd, const char *options);
-void socket_set_flags(struct socket_context *socket, unsigned flags);
+void socket_set_flags(struct socket_context *sock, unsigned flags);
 
 void socket_tevent_fd_close_fn(struct tevent_context *ev,
 			       struct tevent_fd *fde,
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index d278f40..3c78a7c 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -403,7 +403,6 @@ static void ldap_connect_got_sock(struct composite_context *ctx,
 	talloc_steal(conn, conn->sock);
 	if (conn->ldaps) {
 		struct socket_context *tls_socket;
-		struct socket_context *tmp_socket;
 		char *cafile = lp_tls_cafile(conn->sock, conn->lp_ctx);
 
 		if (!cafile || !*cafile) {
diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c
index aef775f..86493c8 100644
--- a/source4/libcli/ldap/ldap_controls.c
+++ b/source4/libcli/ldap/ldap_controls.c
@@ -214,7 +214,7 @@ static bool decode_sd_flags_request(void *mem_ctx, DATA_BLOB in, void *_out)
 		return false;
 	}
 
-	if (!asn1_read_Integer(data, &(lsdfc->secinfo_flags))) {
+	if (!asn1_read_Integer(data, (int *) &(lsdfc->secinfo_flags))) {
 		return false;
 	}
 
@@ -248,7 +248,7 @@ static bool decode_search_options_request(void *mem_ctx, DATA_BLOB in, void *_ou
 		return false;
 	}
 
-	if (!asn1_read_Integer(data, &(lsoc->search_options))) {
+	if (!asn1_read_Integer(data, (int *) &(lsoc->search_options))) {
 		return false;
 	}
 
diff --git a/source4/libcli/security/object_tree.c b/source4/libcli/security/object_tree.c
index 8a90019..85b4079 100644
--- a/source4/libcli/security/object_tree.c
+++ b/source4/libcli/security/object_tree.c
@@ -94,13 +94,13 @@ struct object_tree * get_object_tree_by_GUID(struct object_tree *root,
 /* Change the granted access per each ACE */
 
 void object_tree_modify_access(struct object_tree *root,
-			       uint32_t access)
+			       uint32_t access_mask)
 {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list