diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-06-13 10:01:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:18:07 -0500 |
commit | 00e2b7c1b49b128488cf977b40b086b935fb605a (patch) | |
tree | 0d68e4e6359ed6f9e2971dc6986db726ca1af6ac /source4 | |
parent | 68c15667f5c80b1990616829301990315c9a2254 (diff) | |
download | samba-00e2b7c1b49b128488cf977b40b086b935fb605a.tar.gz samba-00e2b7c1b49b128488cf977b40b086b935fb605a.tar.bz2 samba-00e2b7c1b49b128488cf977b40b086b935fb605a.zip |
r7530: Simply calling convention of lp_load().
This always loads all the services, as we now don't have an easy way
to split out smbd.
Andrew Bartlett
(This used to be commit 990e061939c76b559c4f5914c5fc6ca1b13e19dd)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/client/smbmount.c | 2 | ||||
-rw-r--r-- | source4/client/smbspool.c | 2 | ||||
-rw-r--r-- | source4/gtk/tools/gepdump.c | 2 | ||||
-rw-r--r-- | source4/gtk/tools/gregedit.c | 2 | ||||
-rw-r--r-- | source4/gtk/tools/gwcrontab.c | 2 | ||||
-rw-r--r-- | source4/gtk/tools/gwsam.c | 2 | ||||
-rw-r--r-- | source4/lib/cmdline/popt_common.c | 2 | ||||
-rw-r--r-- | source4/param/loadparm.c | 65 | ||||
-rw-r--r-- | source4/scripting/ejs/smbscript.c | 2 | ||||
-rw-r--r-- | source4/torture/gentest.c | 2 | ||||
-rw-r--r-- | source4/torture/locktest.c | 2 | ||||
-rw-r--r-- | source4/torture/locktest2.c | 2 | ||||
-rw-r--r-- | source4/torture/masktest.c | 2 | ||||
-rw-r--r-- | source4/torture/msgtest.c | 2 |
14 files changed, 20 insertions, 71 deletions
diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c index 7e9c74da57..45c5f703ce 100644 --- a/source4/client/smbmount.c +++ b/source4/client/smbmount.c @@ -898,7 +898,7 @@ static void parse_mount_smb(int argc, char **argv) pstrcpy(username,getenv("LOGNAME")); } - if (!lp_load(dyn_CONFIGFILE,True,False,False)) { + if (!lp_load(dyn_CONFIGFILE)) { fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE); } diff --git a/source4/client/smbspool.c b/source4/client/smbspool.c index 620e4b301c..41cb4c9bf3 100644 --- a/source4/client/smbspool.c +++ b/source4/client/smbspool.c @@ -186,7 +186,7 @@ static int smb_print(struct smbcli_state *, char *, FILE *); in_client = True; /* Make sure that we tell lp_load we are */ - if (!lp_load(dyn_CONFIGFILE, True, False, False)) + if (!lp_load(dyn_CONFIGFILE)) { fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE); return (1); diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c index c5c1aa1af6..4dacd2937c 100644 --- a/source4/gtk/tools/gepdump.c +++ b/source4/gtk/tools/gepdump.c @@ -463,7 +463,7 @@ static GtkWidget* create_mainwindow (void) int main(int argc, char **argv) { gepdump_init_subsystems; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c index 9e81b0b86f..72dd9ae929 100644 --- a/source4/gtk/tools/gregedit.c +++ b/source4/gtk/tools/gregedit.c @@ -976,7 +976,7 @@ int main(int argc, char *argv[]) int ret; gregedit_init_subsystems; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c index 8cae7279a4..eba8b54ac0 100644 --- a/source4/gtk/tools/gwcrontab.c +++ b/source4/gtk/tools/gwcrontab.c @@ -495,7 +495,7 @@ static GtkWidget*create_new_job_dialog (void) int main(int argc, char **argv) { gwcrontab_init_subsystems; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); diff --git a/source4/gtk/tools/gwsam.c b/source4/gtk/tools/gwsam.c index d64f786ef8..cf82ddb767 100644 --- a/source4/gtk/tools/gwsam.c +++ b/source4/gtk/tools/gwsam.c @@ -403,7 +403,7 @@ static GtkWidget* create_mainwindow (void) int main(int argc, char **argv) { gwsam_init_subsystems; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); setup_logging(argv[0], DEBUG_STDERR); diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c index fec85281ef..fb7356dc0e 100644 --- a/source4/lib/cmdline/popt_common.c +++ b/source4/lib/cmdline/popt_common.c @@ -52,7 +52,7 @@ static void popt_common_callback(poptContext con, if (reason == POPT_CALLBACK_REASON_POST) { /* Hook any 'every Samba program must do this, after * the smb.conf is setup' functions here */ - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); return; } diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 15a054863f..a546d51438 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -381,7 +381,6 @@ static service **ServicePtrs = NULL; static int iNumServices = 0; static int iServiceIndex = 0; static BOOL bInGlobalSection = True; -static BOOL bGlobalOnly = False; static int server_role; static int default_server_announce; @@ -2429,7 +2428,7 @@ BOOL lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue static BOOL do_parameter(const char *pszParmName, const char *pszParmValue) { - if (!bInGlobalSection && bGlobalOnly) + if (!bInGlobalSection) return (True); return (lp_do_parameter(bInGlobalSection ? -2 : iServiceIndex, @@ -2632,7 +2631,7 @@ static BOOL do_section(const char *pszSectionName) return (True); } - if (!bInGlobalSection && bGlobalOnly) + if (!bInGlobalSection) return (True); /* if we have a current service, tidy it up before moving on */ @@ -2907,47 +2906,6 @@ void lp_killservice(int iServiceIn) } } -/*************************************************************************** - Save the curent values of all global and sDefault parameters into the - defaults union. This allows swat and testparm to show only the - changed (ie. non-default) parameters. -***************************************************************************/ - -static void lp_save_defaults(void) -{ - int i; - for (i = 0; parm_table[i].label; i++) { - if (i > 0 && parm_table[i].ptr == parm_table[i - 1].ptr) - continue; - switch (parm_table[i].type) { - case P_LIST: - parm_table[i].def.lvalue = str_list_copy(talloc_autofree_context(), - *(const char ***)parm_table[i].ptr); - break; - case P_STRING: - case P_USTRING: - if (parm_table[i].ptr) { - parm_table[i].def.svalue = strdup(*(char **)parm_table[i].ptr); - } else { - parm_table[i].def.svalue = NULL; - } - break; - case P_BOOL: - parm_table[i].def.bvalue = - *(BOOL *)parm_table[i].ptr; - break; - case P_INTEGER: - case P_ENUM: - parm_table[i].def.ivalue = - *(int *)parm_table[i].ptr; - break; - case P_SEP: - break; - } - } - defaults_saved = True; -} - /******************************************************************* Set the server type we will announce as via nmbd. ********************************************************************/ @@ -3010,8 +2968,7 @@ static void set_server_role(void) False on failure. ***************************************************************************/ -BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, - BOOL add_ipc) +BOOL lp_load(const char *pszFname) { pstring n2; BOOL bRetval; @@ -3027,7 +2984,6 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, DEBUG(2, ("lp_load: refreshing parameters from %s\n", pszFname)); bInGlobalSection = True; - bGlobalOnly = global_only; if (Globals.param_opt != NULL) { struct param_opt *next; @@ -3043,11 +2999,6 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, init_globals(); - if (save_defaults) - { - lp_save_defaults(); - } - /* We get sections first, so have to start 'behind' to make up */ iServiceIndex = -1; bRetval = pm_process(n2, do_section, do_parameter); @@ -3060,12 +3011,10 @@ BOOL lp_load(const char *pszFname, BOOL global_only, BOOL save_defaults, lp_add_auto_services(lp_auto_services()); - if (add_ipc) { - /* When 'restrict anonymous = 2' guest connections to ipc$ - are denied */ - lp_add_hidden("IPC$", "IPC", (lp_restrict_anonymous() < 2)); - lp_add_hidden("ADMIN$", "DISK", False); - } + /* When 'restrict anonymous = 2' guest connections to ipc$ + are denied */ + lp_add_hidden("IPC$", "IPC", (lp_restrict_anonymous() < 2)); + lp_add_hidden("ADMIN$", "DISK", False); set_server_role(); set_default_server_announce_type(); diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c index 68d94f6d2a..2795e4f127 100644 --- a/source4/scripting/ejs/smbscript.c +++ b/source4/scripting/ejs/smbscript.c @@ -49,7 +49,7 @@ void ejs_exception(const char *reason) setup_logging(argv[0],DEBUG_STDOUT); - if (!lp_load(dyn_CONFIGFILE, False, False, False)) { + if (!lp_load(dyn_CONFIGFILE)) { fprintf(stderr, "%s: Can't load %s - run testparm to debug it\n", argv[0], dyn_CONFIGFILE); exit(127); diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index fce36188af..1baad25290 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -2127,7 +2127,7 @@ static void usage(void) argc -= NSERVERS; argv += NSERVERS; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); servers[0].credentials = cli_credentials_init(talloc_autofree_context()); diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index a655125344..583ce87624 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -476,7 +476,7 @@ static void usage(void) argc -= NSERVERS; argv += NSERVERS; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); servers[0] = cli_credentials_init(talloc_autofree_context()); diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c index 3eb3398bd1..aef45396eb 100644 --- a/source4/torture/locktest2.c +++ b/source4/torture/locktest2.c @@ -484,7 +484,7 @@ static void usage(void) argc -= 4; argv += 4; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); if (getenv("USER")) { diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index 21e22e91d8..1536ddafd8 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -296,7 +296,7 @@ static void usage(void) argc -= 1; argv += 1; - lp_load(dyn_CONFIGFILE,True,False,False); + lp_load(dyn_CONFIGFILE); load_interfaces(); credentials = cli_credentials_init(talloc_autofree_context()); diff --git a/source4/torture/msgtest.c b/source4/torture/msgtest.c index fa21aa307c..fa47eca1ba 100644 --- a/source4/torture/msgtest.c +++ b/source4/torture/msgtest.c @@ -41,7 +41,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len) setup_logging(argv[0], DEBUG_STDOUT); - lp_load(dyn_CONFIGFILE,False,False,False); + lp_load(dyn_CONFIGFILE); message_init(); |