diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-01 11:48:38 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-01 04:19:05 +0200 |
commit | 9aef68f4c2791227186fa81f1ec19c40df435e18 (patch) | |
tree | 6e0aba8df0d14b4ef6333da3869b0875a805d12c | |
parent | 5f176378a802703778ae07c36e95fe186b6e57a8 (diff) | |
download | samba-9aef68f4c2791227186fa81f1ec19c40df435e18.tar.gz samba-9aef68f4c2791227186fa81f1ec19c40df435e18.tar.bz2 samba-9aef68f4c2791227186fa81f1ec19c40df435e18.zip |
s3-param Make lp_statedir() const
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
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/param/loadparm.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 363d5e761a..2c34c58968 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 808d4f714c..daf8955028 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -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) || |