svn commit: samba r16428 - in trunk/source: param utils

jra at samba.org jra at samba.org
Tue Jun 20 20:43:00 GMT 2006


Author: jra
Date: 2006-06-20 20:42:59 +0000 (Tue, 20 Jun 2006)
New Revision: 16428

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

Log:
Fix final 4 Klocwork bugs we're going to fix before
release - #785, #786, #787, #788.
Jeremy.

Modified:
   trunk/source/param/loadparm.c
   trunk/source/utils/net_rpc_samsync.c


Changeset:
Modified: trunk/source/param/loadparm.c
===================================================================
--- trunk/source/param/loadparm.c	2006-06-20 20:05:39 UTC (rev 16427)
+++ trunk/source/param/loadparm.c	2006-06-20 20:42:59 UTC (rev 16428)
@@ -3251,9 +3251,9 @@
  Handle ldap suffixes - default to ldapsuffix if sub-suffixes are not defined.
 ***************************************************************************/
 
-static char* append_ldap_suffix( const char *str )
+static const char *append_ldap_suffix( const char *str )
 {
-	char *suffix_string;
+	const char *suffix_string;
 
 
 	if (!lp_talloc)
@@ -3262,13 +3262,13 @@
 	suffix_string = talloc_asprintf( lp_talloc, "%s,%s", str, Globals.szLdapSuffix );
 	if ( !suffix_string ) {
 		DEBUG(0,("append_ldap_suffix: talloc_asprintf() failed!\n"));
-		return NULL;
+		return "";
 	}
 
 	return suffix_string;
 }
 
-char *lp_ldap_machine_suffix(void)
+const char *lp_ldap_machine_suffix(void)
 {
 	if (Globals.szLdapMachineSuffix[0])
 		return append_ldap_suffix(Globals.szLdapMachineSuffix);
@@ -3276,7 +3276,7 @@
 	return lp_string(Globals.szLdapSuffix);
 }
 
-char *lp_ldap_user_suffix(void)
+const char *lp_ldap_user_suffix(void)
 {
 	if (Globals.szLdapUserSuffix[0])
 		return append_ldap_suffix(Globals.szLdapUserSuffix);
@@ -3284,7 +3284,7 @@
 	return lp_string(Globals.szLdapSuffix);
 }
 
-char *lp_ldap_group_suffix(void)
+const char *lp_ldap_group_suffix(void)
 {
 	if (Globals.szLdapGroupSuffix[0])
 		return append_ldap_suffix(Globals.szLdapGroupSuffix);
@@ -3292,7 +3292,7 @@
 	return lp_string(Globals.szLdapSuffix);
 }
 
-char *lp_ldap_idmap_suffix(void)
+const char *lp_ldap_idmap_suffix(void)
 {
 	if (Globals.szLdapIdmapSuffix[0])
 		return append_ldap_suffix(Globals.szLdapIdmapSuffix);

Modified: trunk/source/utils/net_rpc_samsync.c
===================================================================
--- trunk/source/utils/net_rpc_samsync.c	2006-06-20 20:05:39 UTC (rev 16427)
+++ trunk/source/utils/net_rpc_samsync.c	2006-06-20 20:42:59 UTC (rev 16428)
@@ -1025,7 +1025,7 @@
 static NTSTATUS populate_ldap_for_ldif(fstring sid, const char *suffix, const char 
 		       *builtin_sid, FILE *add_fd)
 {
-	char *user_suffix, *group_suffix, *machine_suffix, *idmap_suffix;
+	const char *user_suffix, *group_suffix, *machine_suffix, *idmap_suffix;
 	char *user_attr=NULL, *group_attr=NULL;
 	char *suffix_attr;
 	int len;



More information about the samba-cvs mailing list