summaryrefslogtreecommitdiff
path: root/source/utils
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-01-28 22:53:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:18 -0500
commitf2a24de769d1b2266e576597c57a8e3b1e2a2b51 (patch)
tree7fec57191368a498282d032819b76fc9dbd97bbe /source/utils
parent0e24c701ce3755d71de7fdccb9f4564b381bf996 (diff)
downloadsamba-f2a24de769d1b2266e576597c57a8e3b1e2a2b51.tar.gz
r13212: r12414@cabra: derrell | 2006-01-28 17:52:17 -0500
lp_load() could not be called multiple times to modify parameter settings based on reading from multiple configuration settings. Each time, it initialized all of the settings back to their defaults before reading the specified configuration file. This patch adds a parameter to lp_load() specifying whether the settings should be initialized. It does, however, still force the settings to be initialized the first time, even if the request was to not initialize them. (Not doing so could wreak havoc due to uninitialized values.)
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/eventlogadm.c2
-rw-r--r--source/utils/net.c2
-rw-r--r--source/utils/nmblookup.c2
-rw-r--r--source/utils/ntlm_auth.c2
-rw-r--r--source/utils/pdbedit.c2
-rw-r--r--source/utils/smbcacls.c2
-rw-r--r--source/utils/smbcontrol.c2
-rw-r--r--source/utils/smbcquotas.c2
-rw-r--r--source/utils/smbfilter.c2
-rw-r--r--source/utils/smbpasswd.c2
-rw-r--r--source/utils/smbtree.c2
-rw-r--r--source/utils/smbw_sample.c2
-rw-r--r--source/utils/status.c2
-rw-r--r--source/utils/testparm.c2
14 files changed, 14 insertions, 14 deletions
diff --git a/source/utils/eventlogadm.c b/source/utils/eventlogadm.c
index eef7cde3771..8cf79fcf14b 100644
--- a/source/utils/eventlogadm.c
+++ b/source/utils/eventlogadm.c
@@ -170,7 +170,7 @@ int main( int argc, char *argv[] )
opt_debug = 0; /* todo set this from getopts */
- lp_load( dyn_CONFIGFILE, True, False, False );
+ lp_load( dyn_CONFIGFILE, True, False, False, True);
exename = argv[0];
srcname = NULL;
diff --git a/source/utils/net.c b/source/utils/net.c
index a2a9ac6a391..25e10c6a316 100644
--- a/source/utils/net.c
+++ b/source/utils/net.c
@@ -825,7 +825,7 @@ static struct functable net_func[] = {
* set by cmdline arg or remain default (0)
*/
AllowDebugChange = False;
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False,True);
argv_new = (const char **)poptGetArgs(pc);
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c
index e88d7862901..12ac1beb7b1 100644
--- a/source/utils/nmblookup.c
+++ b/source/utils/nmblookup.c
@@ -248,7 +248,7 @@ int main(int argc,char *argv[])
exit(1);
}
- if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
+ if (!lp_load(dyn_CONFIGFILE,True,False,False,True)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
}
diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index 65dbfb71650..4759aec0ccf 100644
--- a/source/utils/ntlm_auth.c
+++ b/source/utils/ntlm_auth.c
@@ -1758,7 +1758,7 @@ enum {
/* Samba client initialisation */
- if (!lp_load(dyn_CONFIGFILE, True, False, False)) {
+ if (!lp_load(dyn_CONFIGFILE, True, False, False, True)) {
d_fprintf(stderr, "ntlm_auth: error opening config file %s. Error was %s\n",
dyn_CONFIGFILE, strerror(errno));
exit(1);
diff --git a/source/utils/pdbedit.c b/source/utils/pdbedit.c
index 53d3b17d064..f41bbb8caaf 100644
--- a/source/utils/pdbedit.c
+++ b/source/utils/pdbedit.c
@@ -795,7 +795,7 @@ int main (int argc, char **argv)
if (user_name == NULL)
user_name = poptGetArg(pc);
- if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
+ if (!lp_load(dyn_CONFIGFILE,True,False,False,True)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
exit(1);
}
diff --git a/source/utils/smbcacls.c b/source/utils/smbcacls.c
index cbbd7adaab3..26362c6270a 100644
--- a/source/utils/smbcacls.c
+++ b/source/utils/smbcacls.c
@@ -830,7 +830,7 @@ static struct cli_state *connect_one(const char *share)
setlinebuf(stdout);
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False,True);
load_interfaces();
pc = poptGetContext("smbcacls", argc, argv, long_options, 0);
diff --git a/source/utils/smbcontrol.c b/source/utils/smbcontrol.c
index b8f7c2f2b55..a4d2766b132 100644
--- a/source/utils/smbcontrol.c
+++ b/source/utils/smbcontrol.c
@@ -827,7 +827,7 @@ int main(int argc, const char **argv)
if (argc == 1)
usage(&pc);
- lp_load(dyn_CONFIGFILE,False,False,False);
+ lp_load(dyn_CONFIGFILE,False,False,False,True);
/* Need to invert sense of return code -- samba
* routines mostly return True==1 for success, but
diff --git a/source/utils/smbcquotas.c b/source/utils/smbcquotas.c
index f8e33131555..b1a14685f5e 100644
--- a/source/utils/smbcquotas.c
+++ b/source/utils/smbcquotas.c
@@ -435,7 +435,7 @@ FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
fault_setup(NULL);
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False,True);
load_interfaces();
pc = poptGetContext("smbcquotas", argc, argv, long_options, 0);
diff --git a/source/utils/smbfilter.c b/source/utils/smbfilter.c
index 3665647905d..97d22230c4b 100644
--- a/source/utils/smbfilter.c
+++ b/source/utils/smbfilter.c
@@ -236,7 +236,7 @@ int main(int argc, char *argv[])
netbiosname = argv[2];
}
- if (!lp_load(configfile,True,False,False)) {
+ if (!lp_load(configfile,True,False,False,True)) {
d_printf("Unable to load config file\n");
}
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index 29189c5febd..7eb11137d70 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -187,7 +187,7 @@ static int process_options(int argc, char **argv, int local_flags)
usage();
}
- if (!lp_load(configfile,True,False,False)) {
+ if (!lp_load(configfile,True,False,False,True)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n",
dyn_CONFIGFILE);
exit(1);
diff --git a/source/utils/smbtree.c b/source/utils/smbtree.c
index 3755b7f8e55..853a46f379e 100644
--- a/source/utils/smbtree.c
+++ b/source/utils/smbtree.c
@@ -216,7 +216,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
while(poptGetNextOpt(pc) != -1);
poptFreeContext(pc);
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False,True);
load_interfaces();
/* Parse command line args */
diff --git a/source/utils/smbw_sample.c b/source/utils/smbw_sample.c
index 5cd792df7a2..ba78eb22fc7 100644
--- a/source/utils/smbw_sample.c
+++ b/source/utils/smbw_sample.c
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
extern int optind;
char *path;
- lp_load(dyn_CONFIGFILE,1,0,0);
+ lp_load(dyn_CONFIGFILE,1,0,0,1);
smbw_setup_shared();
while ((opt = getopt(argc, argv, "W:U:R:d:P:l:hL:")) != EOF) {
diff --git a/source/utils/status.c b/source/utils/status.c
index eeaf83d1772..2aed68be897 100644
--- a/source/utils/status.c
+++ b/source/utils/status.c
@@ -648,7 +648,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
d_printf("using configfile = %s\n", dyn_CONFIGFILE);
}
- if (!lp_load(dyn_CONFIGFILE,False,False,False)) {
+ if (!lp_load(dyn_CONFIGFILE,False,False,False,True)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
return (-1);
}
diff --git a/source/utils/testparm.c b/source/utils/testparm.c
index 11ce960e557..8b9ff4710e0 100644
--- a/source/utils/testparm.c
+++ b/source/utils/testparm.c
@@ -266,7 +266,7 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
fprintf(stderr,"Load smb config files from %s\n",config_file);
- if (!lp_load(config_file,False,True,False)) {
+ if (!lp_load(config_file,False,True,False,True)) {
fprintf(stderr,"Error loading services.\n");
return(1);
}