summaryrefslogtreecommitdiff
path: root/source3/client/smbmount.c
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/client/smbmount.c
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/client/smbmount.c')
-rw-r--r--source3/client/smbmount.c25
1 files changed, 17 insertions, 8 deletions
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;