summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-11-19 02:49:53 +0000
committerMartin Pool <mbp@samba.org>2001-11-19 02:49:53 +0000
commitf741f656737f4ec46cd318e986b6bf412ed309d2 (patch)
treefb2b1999441e25ae5db177631dd42abb051a9bce /source3/utils
parenta1b9de0b9872b91574e75bb360d49b887a072389 (diff)
downloadsamba-f741f656737f4ec46cd318e986b6bf412ed309d2.tar.gz
samba-f741f656737f4ec46cd318e986b6bf412ed309d2.tar.bz2
samba-f741f656737f4ec46cd318e986b6bf412ed309d2.zip
Store some path names in global variables initialized to configure
default, rather than in preprocessor macros. (This used to be commit 79ec88f0da40faebe1e587f1b3e87b5f2b184f58)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net.c2
-rw-r--r--source3/utils/nmblookup.c7
-rw-r--r--source3/utils/pdbedit.c5
-rw-r--r--source3/utils/smbcacls.c3
-rw-r--r--source3/utils/smbcontrol.c5
-rw-r--r--source3/utils/smbfilter.c2
-rw-r--r--source3/utils/smbgroupedit.c2
-rw-r--r--source3/utils/smbpasswd.c6
-rw-r--r--source3/utils/smbtree.c3
-rw-r--r--source3/utils/smbw_sample.c2
-rw-r--r--source3/utils/status.c9
-rw-r--r--source3/utils/testparm.c2
12 files changed, 20 insertions, 28 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 53075965b5..adffe7a4a5 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -1379,7 +1379,7 @@ int main(int argc,char *argv[])
int argc_new = 0;
const char ** argv_new;
poptContext pc;
- static char *servicesf = CONFIGFILE;
+ static char *servicesf = dyn_CONFIGFILE;
static char *target_workgroup = NULL;
static char *comment = "";
static char *user_name = NULL;
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index ceec1859e7..44f0558bf6 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -193,7 +193,6 @@ int main(int argc,char *argv[])
extern char *optarg;
BOOL find_master=False;
int i;
- static pstring servicesf = CONFIGFILE;
BOOL lookup_by_ip = False;
int commandline_debuglevel = -2;
@@ -240,7 +239,7 @@ int main(int argc,char *argv[])
commandline_debuglevel = DEBUGLEVEL = atoi(optarg);
break;
case 's':
- pstrcpy(servicesf, optarg);
+ pstrcpy(dyn_CONFIGFILE, optarg);
break;
case 'r':
RootPort = True;
@@ -262,8 +261,8 @@ int main(int argc,char *argv[])
exit(1);
}
- if (!lp_load(servicesf,True,False,False)) {
- fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
+ if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
+ fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
}
/*
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 90067a733b..749e33958b 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -536,7 +536,6 @@ account without a valid local system user.\n", user_name);
int main (int argc, char **argv)
{
int ch;
- static pstring servicesf = CONFIGFILE;
BOOL list_users = False;
BOOL verbose = False;
BOOL spstyle = False;
@@ -567,9 +566,9 @@ int main (int argc, char **argv)
exit(1);
}
- if (!lp_load(servicesf,True,False,False)) {
+ if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n",
- servicesf);
+ dyn_CONFIGFILE);
exit(1);
}
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index ba5630a9d8..e1d206e0ee 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -802,7 +802,6 @@ You can string acls together with spaces, commas or newlines\n\
extern int optind;
int opt;
char *p;
- static pstring servicesf = CONFIGFILE;
struct cli_state *cli=NULL;
enum acl_mode mode = SMB_ACL_SET;
char *the_acl = NULL;
@@ -832,7 +831,7 @@ You can string acls together with spaces, commas or newlines\n\
TimeInit();
- lp_load(servicesf,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces();
if (getenv("USER")) {
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 2b682d9860..9a597948b3 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -374,7 +374,6 @@ static BOOL do_command(char *dest, char *msg_name, char **params)
int opt;
char temp[255];
extern int optind;
- pstring servicesf = CONFIGFILE;
BOOL interactive = False;
TimeInit();
@@ -388,7 +387,7 @@ static BOOL do_command(char *dest, char *msg_name, char **params)
interactive = True;
break;
case 's':
- pstrcpy(servicesf, optarg);
+ pstrcpy(dyn_CONFIGFILE, optarg);
break;
default:
printf("Unknown option %c (%d)\n", (char)opt, opt);
@@ -396,7 +395,7 @@ static BOOL do_command(char *dest, char *msg_name, char **params)
}
}
- lp_load(servicesf,False,False,False);
+ lp_load(dyn_CONFIGFILE,False,False,False);
if (!message_init()) exit(1);
diff --git a/source3/utils/smbfilter.c b/source3/utils/smbfilter.c
index 0707db0e22..1a5aedc485 100644
--- a/source3/utils/smbfilter.c
+++ b/source3/utils/smbfilter.c
@@ -228,7 +228,7 @@ int main(int argc, char *argv[])
setup_logging(argv[0],True);
- pstrcpy(configfile,CONFIGFILE);
+ pstrcpy(configfile,dyn_CONFIGFILE);
if (argc < 2) {
fprintf(stderr,"smbfilter <desthost> <netbiosname>\n");
diff --git a/source3/utils/smbgroupedit.c b/source3/utils/smbgroupedit.c
index 062271abc5..c25f1a93fd 100644
--- a/source3/utils/smbgroupedit.c
+++ b/source3/utils/smbgroupedit.c
@@ -200,7 +200,7 @@ int listgroup(enum SID_NAME_USE sid_type)
int main (int argc, char **argv)
{
int ch;
- static pstring servicesf = CONFIGFILE;
+ static pstring servicesf = dyn_CONFIGFILE;
BOOL add_group = False;
BOOL view_group = False;
BOOL change_group = False;
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index ee8bae7a4a..1e637ede35 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -898,8 +898,6 @@ static int process_nonroot(int argc, char *argv[])
**********************************************************/
int main(int argc, char **argv)
{
- static pstring servicesf = CONFIGFILE;
-
#if defined(HAVE_SET_AUTH_PARAMETERS)
set_auth_parameters(argc, argv);
#endif /* HAVE_SET_AUTH_PARAMETERS */
@@ -913,9 +911,9 @@ int main(int argc, char **argv)
exit(1);
}
- if (!lp_load(servicesf,True,False,False)) {
+ if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
fprintf(stderr, "Can't load %s - run testparm to debug it\n",
- servicesf);
+ dyn_CONFIGFILE);
exit(1);
}
diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c
index d7842d1e02..857b858bec 100644
--- a/source3/utils/smbtree.c
+++ b/source3/utils/smbtree.c
@@ -327,7 +327,6 @@ static BOOL print_tree(struct user_auth_info *user_info)
extern int optind;
int opt;
char *p;
- pstring servicesf = CONFIGFILE;
struct user_auth_info user_info;
BOOL got_pass = False;
@@ -341,7 +340,7 @@ static BOOL print_tree(struct user_auth_info *user_info)
TimeInit();
- lp_load(servicesf,True,False,False);
+ lp_load(dyn_CONFIGFILE,True,False,False);
load_interfaces();
if (getenv("USER")) {
diff --git a/source3/utils/smbw_sample.c b/source3/utils/smbw_sample.c
index 6a8fbf116b..5cd792df7a 100644
--- a/source3/utils/smbw_sample.c
+++ b/source3/utils/smbw_sample.c
@@ -33,7 +33,7 @@ int main(int argc, char *argv[])
extern int optind;
char *path;
- lp_load(CONFIGFILE,1,0,0);
+ lp_load(dyn_CONFIGFILE,1,0,0);
smbw_setup_shared();
while ((opt = getopt(argc, argv, "W:U:R:d:P:l:hL:")) != EOF) {
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 3beae0f815..5febdd98d8 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -544,7 +544,6 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
{
pstring fname;
int c;
- static pstring servicesf = CONFIGFILE;
extern char *optarg;
int profile_only = 0, new_debuglevel = -1;
TDB_CONTEXT *tdb;
@@ -588,7 +587,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
shares_only = 1;
break;
case 's':
- pstrcpy(servicesf, optarg);
+ pstrcpy(dyn_CONFIGFILE, optarg);
break;
case 'u':
Ucrit_addUsername(optarg);
@@ -599,8 +598,8 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
}
}
- if (!lp_load(servicesf,False,False,False)) {
- fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
+ if (!lp_load(dyn_CONFIGFILE,False,False,False)) {
+ fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
return (-1);
}
@@ -609,7 +608,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
}
if (verbose) {
- d_printf("using configfile = %s\n", servicesf);
+ d_printf("using configfile = %s\n", dyn_CONFIGFILE);
}
if (profile_only) {
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index 09948b8635..53adbaae91 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -218,7 +218,7 @@ int main(int argc, char *argv[])
argc += (1 - optind);
if ((argc == 1) || (argc == 3))
- pstrcpy(configfile,CONFIGFILE);
+ pstrcpy(configfile, dyn_CONFIGFILE);
else if ((argc == 2) || (argc == 4))
pstrcpy(configfile,argv[optind]);