diff options
author | Steve French <smfrench@gmail.com> | 2009-02-24 12:52:08 -0600 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-03-27 13:06:50 +0100 |
commit | 73f8bd531ad180b4b40d4baa5a7f639ebe998030 (patch) | |
tree | fe8dad2a91d73fb904cbfb5ef56f0977e08a4c83 /source | |
parent | 18a27fe5c8629a7b5905e98a0b82dce356476b4d (diff) | |
download | samba-73f8bd531ad180b4b40d4baa5a7f639ebe998030.tar.gz samba-73f8bd531ad180b4b40d4baa5a7f639ebe998030.tar.xz samba-73f8bd531ad180b4b40d4baa5a7f639ebe998030.zip |
cifs mount fix for handling -V parameter
also syncs with 3-3 mount.cifs
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@samba.org>
(cherry picked from commit e831cd78ee3cf89abee058a475540955fad423ce)
Diffstat (limited to 'source')
-rw-r--r-- | source/client/mount.cifs.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c index e7397da2e97..67e964d6351 100644 --- a/source/client/mount.cifs.c +++ b/source/client/mount.cifs.c @@ -485,7 +485,8 @@ static int parse_options(char ** optionsp, int * filesys_flags) } } else if (strncmp(data, "sec", 3) == 0) { if (value) { - if (!strcmp(value, "none")) + if (!strncmp(value, "none", 4) || + !strncmp(value, "krb5", 4)) got_password = 1; } } else if (strncmp(data, "ip", 2) == 0) { @@ -533,8 +534,11 @@ static int parse_options(char ** optionsp, int * filesys_flags) SAFE_FREE(out); return 1; } - } else if ((strncmp(data, "domain", 3) == 0) - || (strncmp(data, "workgroup", 5) == 0)) { + } else if ((strncmp(data, "dom" /* domain */, 3) == 0) + || (strncmp(data, "workg", 5) == 0)) { + /* note this allows for synonyms of "domain" + such as "DOM" and "dom" and "workgroup" + and "WORKGRP" etc. */ if (!value || !*value) { printf("CIFS: invalid domain name\n"); SAFE_FREE(out); @@ -1075,6 +1079,14 @@ int main(int argc, char ** argv) } mountpoint = argv[2]; } else { + if ((strcmp (argv[1], "--version") == 0) || + ((strcmp (argv[1], "-V") == 0))) { + printf ("mount.cifs version: %s.%s%s\n", + MOUNT_CIFS_VERSION_MAJOR, + MOUNT_CIFS_VERSION_MINOR, + MOUNT_CIFS_VENDOR_SUFFIX); + exit (0); + } mount_cifs_usage(); exit(EX_USAGE); } @@ -1286,7 +1298,13 @@ int main(int argc, char ** argv) } if(got_user == 0) { - user_name = getusername(); + /* Note that the password will not be retrieved from the + USER env variable (ie user%password form) as there is + already a PASSWD environment varaible */ + if (getenv("USER")) + user_name = strdup(getenv("USER")); + if (user_name == NULL) + user_name = getusername(); got_user = 1; } |