From f741f656737f4ec46cd318e986b6bf412ed309d2 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 19 Nov 2001 02:49:53 +0000 Subject: Store some path names in global variables initialized to configure default, rather than in preprocessor macros. (This used to be commit 79ec88f0da40faebe1e587f1b3e87b5f2b184f58) --- source3/client/smbmount.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'source3/client/smbmount.c') diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c index d41d26ec37..d3265ee606 100644 --- a/source3/client/smbmount.c +++ b/source3/client/smbmount.c @@ -403,9 +403,9 @@ static void send_fs_socket(char *service, char *mount_point, struct cli_state *c } -/**************************************************************************** -mount smbfs -****************************************************************************/ +/** + * Mount a smbfs + **/ static void init_mount(void) { char mount_point[MAXPATHLEN+1]; @@ -475,13 +475,22 @@ static void init_mount(void) } if (sys_fork() == 0) { - if (file_exist(BINDIR "/smbmnt", NULL)) { - execv(BINDIR "/smbmnt", args); - fprintf(stderr,"execv of %s failed. Error was %s.", BINDIR "/smbmnt", strerror(errno)); + char *smbmnt_path; + + smbmnt_path = asprintf("%s/smbmnt", dyn_BINDIR); + + if (file_exist(smbmnt_path, NULL)) { + execv(smbmnt_path, args); + fprintf(stderr, + "smbfs/init_mount: execv of %s failed. Error was %s.", + smbmnt_path, strerror(errno)); } else { execvp("smbmnt", args); - fprintf(stderr,"execvp of smbmnt failed. Error was %s.", strerror(errno) ); + fprintf(stderr, + "smbfs/init_mount: execv of %s failed. Error was %s.", + "smbmnt", strerror(errno)); } + free(smbmnt_path); exit(1); } @@ -801,7 +810,7 @@ static void parse_mount_smb(int argc, char **argv) { extern char *optarg; extern int optind; - static pstring servicesf = CONFIGFILE; + static pstring servicesf = dyn_CONFIGFILE; char *p; DEBUGLEVEL = 1; -- cgit