s3-param Make lp_statedir() const
authorAndrew Bartlett <abartlet@samba.org>
Wed, 1 Jun 2011 01:48:38 +0000 (11:48 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 1 Jun 2011 02:19:05 +0000 (04:19 +0200)
This disables % substitutions in the 'state dir' parameter.  This is
used all over the codebase, and need to be internally consistent
between all the Samba tasks.

Andrew Bartlett

source3/include/proto.h
source3/param/loadparm.c

index 363d5e761abd0c1903c46abfd576c3c831d4b084..2c34c58968e1756fa18f458e11ade1b386344ef1 100644 (file)
@@ -1191,7 +1191,7 @@ char *lp_addprinter_cmd(void);
 char *lp_deleteprinter_cmd(void);
 char *lp_os2_driver_map(void);
 const char *lp_lockdir(void);
-char *lp_statedir(void);
+const char *lp_statedir(void);
 char *lp_cachedir(void);
 char *lp_piddir(void);
 char *lp_mangling_method(void);
index 808d4f714c86fc733a094a89411423bdd74aeaae..daf8955028effe8f03b2806ea6e1f644bbd08d2d 100644 (file)
@@ -5583,14 +5583,14 @@ FN_GLOBAL_CONST_STRING(lp_lockdir, &Globals.szLockDir)
 /* If lp_statedir() and lp_cachedir() are explicitely set during the
  * build process or in smb.conf, we use that value.  Otherwise they
  * default to the value of lp_lockdir(). */
-char *lp_statedir(void) {
+const char *lp_statedir(void) {
        if ((strcmp(get_dyn_STATEDIR(), get_dyn_LOCKDIR()) != 0) ||
            (strcmp(get_dyn_STATEDIR(), Globals.szStateDir) != 0))
-               return(lp_string(*(char **)(&Globals.szStateDir) ?
-                   *(char **)(&Globals.szStateDir) : ""));
+               return(*(char **)(&Globals.szStateDir) ?
+                      *(char **)(&Globals.szStateDir) : "");
        else
-               return(lp_string(*(char **)(&Globals.szLockDir) ?
-                   *(char **)(&Globals.szLockDir) : ""));
+               return(*(char **)(&Globals.szLockDir) ?
+                      *(char **)(&Globals.szLockDir) : "");
 }
 char *lp_cachedir(void) {
        if ((strcmp(get_dyn_CACHEDIR(), get_dyn_LOCKDIR()) != 0) ||