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);
}
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);
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);
int ret;
gregedit_init_subsystems;
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE);
load_interfaces();
setup_logging(argv[0], DEBUG_STDERR);
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);
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);
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;
}
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;
static BOOL do_parameter(const char *pszParmName, const char *pszParmValue)
{
- if (!bInGlobalSection && bGlobalOnly)
+ if (!bInGlobalSection)
return (True);
return (lp_do_parameter(bInGlobalSection ? -2 : iServiceIndex,
return (True);
}
- if (!bInGlobalSection && bGlobalOnly)
+ if (!bInGlobalSection)
return (True);
/* if we have a current service, tidy it up before moving on */
}
}
-/***************************************************************************
- 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.
********************************************************************/
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;
DEBUG(2, ("lp_load: refreshing parameters from %s\n", pszFname));
bInGlobalSection = True;
- bGlobalOnly = global_only;
if (Globals.param_opt != NULL) {
struct param_opt *next;
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);
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();
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);
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());
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());
argc -= 4;
argv += 4;
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE);
load_interfaces();
if (getenv("USER")) {
argc -= 1;
argv += 1;
- lp_load(dyn_CONFIGFILE,True,False,False);
+ lp_load(dyn_CONFIGFILE);
load_interfaces();
credentials = cli_credentials_init(talloc_autofree_context());
setup_logging(argv[0], DEBUG_STDOUT);
- lp_load(dyn_CONFIGFILE,False,False,False);
+ lp_load(dyn_CONFIGFILE);
message_init();