From 6e16c5eed59bb3539af365d30e9ec35012b8c8ac Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 24 Feb 2009 16:57:30 +0100 Subject: s3:mount.cifs: don't error exit on explicitly requested help... Michael --- source3/client/mount.cifs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/client/mount.cifs.c') diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index a736609580..641584947f 100644 --- a/source3/client/mount.cifs.c +++ b/source3/client/mount.cifs.c @@ -179,7 +179,6 @@ static void mount_cifs_usage(void) printf("\n\t%s -V\n",thisprogram); SAFE_FREE(mountpassword); - exit(EX_USAGE); } /* caller frees username if necessary */ @@ -1102,7 +1101,7 @@ int main(int argc, char ** argv) case '?': case 'h': /* help */ mount_cifs_usage (); - exit(EX_USAGE); + exit(0); case 'n': ++nomtab; break; -- cgit From d7ca4997017e86b6f23ced64f1f1672bfb15716b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 24 Feb 2009 16:58:33 +0100 Subject: s3:mount.cifs: make "mount.cifs -V" print the version, not usage. Also make "mount.cifs -h" not exit with error exit code but with return code 0. Michael --- source3/client/mount.cifs.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'source3/client/mount.cifs.c') diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index 641584947f..ae8a7fd186 100644 --- a/source3/client/mount.cifs.c +++ b/source3/client/mount.cifs.c @@ -1016,6 +1016,14 @@ uppercase_string(char *string) return 1; } +static void print_cifs_mount_version(void) +{ + printf("mount.cifs version: %s.%s%s\n", + MOUNT_CIFS_VERSION_MAJOR, + MOUNT_CIFS_VERSION_MINOR, + MOUNT_CIFS_VENDOR_SUFFIX); +} + int main(int argc, char ** argv) { int c; @@ -1077,6 +1085,24 @@ int main(int argc, char ** argv) exit(EX_SYSERR); } mountpoint = argv[2]; + } else if (argc == 2) { + if ((strcmp(argv[1], "-V") == 0) || + (strcmp(argv[1], "--version") == 0)) + { + print_cifs_mount_version(); + exit(0); + } + + if ((strcmp(argv[1], "-h") == 0) || + (strcmp(argv[1], "-?") == 0) || + (strcmp(argv[1], "--help") == 0)) + { + mount_cifs_usage(); + exit(0); + } + + mount_cifs_usage(); + exit(EX_USAGE); } else { mount_cifs_usage(); exit(EX_USAGE); @@ -1133,11 +1159,8 @@ int main(int argc, char ** argv) case 'v': ++verboseflag; break; - case 'V': - printf ("mount.cifs version: %s.%s%s\n", - MOUNT_CIFS_VERSION_MAJOR, - MOUNT_CIFS_VERSION_MINOR, - MOUNT_CIFS_VENDOR_SUFFIX); + case 'V': + print_cifs_mount_version(); exit (0); case 'w': flags &= ~MS_RDONLY; -- cgit From d75df717336e063f52af1415f99b6e16ccbf918c Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 24 Feb 2009 20:53:46 -0600 Subject: Fix guest mounts guest session setup, login (user id) as anonymous. This patch is for samba bugzilla bug 4640. Signed-off-by: Shirish Pargaonkar Acked-by: Jeff Layton Signed-off-by: Steve French --- source3/client/mount.cifs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/client/mount.cifs.c') diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index ae8a7fd186..8623d3c04b 100644 --- a/source3/client/mount.cifs.c +++ b/source3/client/mount.cifs.c @@ -649,7 +649,9 @@ static int parse_options(char ** optionsp, int * filesys_flags) } else if (strncmp(data, "exec", 4) == 0) { *filesys_flags &= ~MS_NOEXEC; } else if (strncmp(data, "guest", 5) == 0) { - got_password=1; + user_name = (char *)calloc(1, 1); + got_user = 1; + got_password = 1; } else if (strncmp(data, "ro", 2) == 0) { *filesys_flags |= MS_RDONLY; } else if (strncmp(data, "rw", 2) == 0) { -- cgit