diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-03-01 16:39:35 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-03-01 16:39:35 +0100 |
commit | 09ac816b36e45fd537af2f7fe7c57a11f5c744f5 (patch) | |
tree | 4d5d44c27a2395a39efc62359f6e4b6976f2ba2e /source3/client/mount.cifs.c | |
parent | 235244f4cc707130dd130afce88bde49606bd501 (diff) | |
parent | 54bc27e9374742d37b1ed9012d1cfe8f5ace6d40 (diff) | |
download | samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.tar.gz samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.tar.bz2 samba-09ac816b36e45fd537af2f7fe7c57a11f5c744f5.zip |
Merge branch 'master' of git://git.samba.org/samba into teventfix
Conflicts:
lib/tevent/pytevent.c
Diffstat (limited to 'source3/client/mount.cifs.c')
-rw-r--r-- | source3/client/mount.cifs.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index a736609580..8623d3c04b 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 */ @@ -650,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) { @@ -1017,6 +1018,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; @@ -1078,6 +1087,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); @@ -1102,7 +1129,7 @@ int main(int argc, char ** argv) case '?': case 'h': /* help */ mount_cifs_usage (); - exit(EX_USAGE); + exit(0); case 'n': ++nomtab; break; @@ -1134,11 +1161,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; |