r16429: Fix final 4 Klocwork bugs we're going to fix before
authorJeremy Allison <jra@samba.org>
Tue, 20 Jun 2006 20:43:05 +0000 (20:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:18:53 +0000 (11:18 -0500)
release - #785, #786, #787, #788.
Jeremy.

source/param/loadparm.c
source/utils/net_rpc_samsync.c

index 2ef1c4df2fe444aa2ef61ffc4ec3b6564cf083c9..a3a41c7664ddb63c054bf27fd71fbddb43049990 100644 (file)
@@ -3244,9 +3244,9 @@ static BOOL handle_debug_list( int snum, const char *pszParmValueIn, char **ptr
  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)
@@ -3255,13 +3255,13 @@ static char* append_ldap_suffix( const char *str )
        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);
@@ -3269,7 +3269,7 @@ char *lp_ldap_machine_suffix(void)
        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);
@@ -3277,7 +3277,7 @@ char *lp_ldap_user_suffix(void)
        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);
@@ -3285,7 +3285,7 @@ char *lp_ldap_group_suffix(void)
        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);
index 85b086a02ff2256bed57dd56149b8a15d03a669c..4f99c3035c846ab1b61ad6d2888c6a4ec6281fe8 100644 (file)
@@ -1025,7 +1025,7 @@ static NTSTATUS fetch_database(struct rpc_pipe_client *pipe_hnd, uint32 db_type,
 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;