svn commit: samba r8396 - branches/SAMBA_3_0/source/utils trunk/source/utils

gd at samba.org gd at samba.org
Tue Jul 12 23:02:32 GMT 2005


Author: gd
Date: 2005-07-12 23:02:31 +0000 (Tue, 12 Jul 2005)
New Revision: 8396

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8396

Log:
fix some compile warnings.

Guenther

Modified:
   branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
   trunk/source/utils/net_rpc_samsync.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_rpc_samsync.c	2005-07-12 22:35:02 UTC (rev 8395)
+++ branches/SAMBA_3_0/source/utils/net_rpc_samsync.c	2005-07-12 23:02:31 UTC (rev 8396)
@@ -436,7 +436,7 @@
 		pdb_sethexhours(oldstr, pdb_get_hours(account));
 		pdb_sethexhours(newstr, delta->buf_logon_hrs.buffer);
 		if (!strequal(oldstr, newstr))
-			pdb_set_hours(account, (const char *)delta->buf_logon_hrs.buffer, PDB_CHANGED);
+			pdb_set_hours(account, (const uint8 *)delta->buf_logon_hrs.buffer, PDB_CHANGED);
 	}
 
 	if (pdb_get_bad_password_count(account) != delta->bad_pwd_count)
@@ -1716,7 +1716,7 @@
 		fprintf(add_fd, "sambaLMPassword: %s\n", hex_lm_passwd);
 	if (strcmp(nopasswd, hex_nt_passwd) != 0)
 		fprintf(add_fd, "sambaNTPassword: %s\n", hex_nt_passwd);
-	fprintf(add_fd, "sambaPwdLastSet: %d\n", unix_time);
+	fprintf(add_fd, "sambaPwdLastSet: %d\n", (int)unix_time);
 	fprintf(add_fd, "sambaAcctFlags: %s\n", flags);
 	fprintf(add_fd, "\n");
 	fflush(add_fd);
@@ -1871,11 +1871,18 @@
 	/* Array element is the account rid */
 	ACCOUNTMAP *accountmap = NULL; 
 
+	if (!(mem_ctx = talloc_init("fetch_database"))) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
 	/* Ensure we have an output file */
 	if (user_file)
-		ldif_file = user_file;
+		ldif_file = talloc_strdup(mem_ctx, user_file);
 	else
-		ldif_file = "/tmp/tmp.ldif";
+		ldif_file = talloc_strdup(mem_ctx, "/tmp/tmp.ldif");
+	
+	if (ldif_file == NULL)
+		return NT_STATUS_NO_MEMORY;
 
 	/* Open the add and mod ldif files */
 	add_fd = fopen(add_ldif, "a");
@@ -1892,10 +1899,6 @@
 		return NT_STATUS_UNSUCCESSFUL;
 	}
 
-	if (!(mem_ctx = talloc_init("fetch_database"))) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
 	/* Get the sid */
 	sid_to_string(sid, &dom_sid);
 

Modified: trunk/source/utils/net_rpc_samsync.c
===================================================================
--- trunk/source/utils/net_rpc_samsync.c	2005-07-12 22:35:02 UTC (rev 8395)
+++ trunk/source/utils/net_rpc_samsync.c	2005-07-12 23:02:31 UTC (rev 8396)
@@ -436,7 +436,7 @@
 		pdb_sethexhours(oldstr, pdb_get_hours(account));
 		pdb_sethexhours(newstr, delta->buf_logon_hrs.buffer);
 		if (!strequal(oldstr, newstr))
-			pdb_set_hours(account, (const char *)delta->buf_logon_hrs.buffer, PDB_CHANGED);
+			pdb_set_hours(account, (const uint8 *)delta->buf_logon_hrs.buffer, PDB_CHANGED);
 	}
 
 	if (pdb_get_bad_password_count(account) != delta->bad_pwd_count)
@@ -1716,7 +1716,7 @@
 		fprintf(add_fd, "sambaLMPassword: %s\n", hex_lm_passwd);
 	if (strcmp(nopasswd, hex_nt_passwd) != 0)
 		fprintf(add_fd, "sambaNTPassword: %s\n", hex_nt_passwd);
-	fprintf(add_fd, "sambaPwdLastSet: %d\n", unix_time);
+	fprintf(add_fd, "sambaPwdLastSet: %d\n", (int)unix_time);
 	fprintf(add_fd, "sambaAcctFlags: %s\n", flags);
 	fprintf(add_fd, "\n");
 	fflush(add_fd);
@@ -1871,11 +1871,18 @@
 	/* Array element is the account rid */
 	ACCOUNTMAP *accountmap = NULL; 
 
+	if (!(mem_ctx = talloc_init("fetch_database"))) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
 	/* Ensure we have an output file */
 	if (user_file)
-		ldif_file = user_file;
+		ldif_file = talloc_strdup(mem_ctx, user_file);
 	else
-		ldif_file = "/tmp/tmp.ldif";
+		ldif_file = talloc_strdup(mem_ctx, "/tmp/tmp.ldif");
+	
+	if (ldif_file == NULL)
+		return NT_STATUS_NO_MEMORY;
 
 	/* Open the add and mod ldif files */
 	add_fd = fopen(add_ldif, "a");
@@ -1892,10 +1899,6 @@
 		return NT_STATUS_UNSUCCESSFUL;
 	}
 
-	if (!(mem_ctx = talloc_init("fetch_database"))) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
 	/* Get the sid */
 	sid_to_string(sid, &dom_sid);
 



More information about the samba-cvs mailing list