diff options
author | Scott Lovenberg <scott.lovenberg@gmail.com> | 2010-04-06 14:52:07 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2010-04-06 14:52:07 -0400 |
commit | aeba78abbe4f25ae77328e4ca6a67360dd4ea344 (patch) | |
tree | 1c730e215d748e760a2103e8c4546852e10694c7 /mount.cifs.c | |
parent | 2a78385bbf879c16c538b0c78ff4e939724fafd4 (diff) | |
download | cifs-utils-aeba78abbe4f25ae77328e4ca6a67360dd4ea344.tar.gz cifs-utils-aeba78abbe4f25ae77328e4ca6a67360dd4ea344.tar.bz2 cifs-utils-aeba78abbe4f25ae77328e4ca6a67360dd4ea344.zip |
mount.cifs: make credentials file parameters consistent with mount options
This patch makes the mount.cifs credentials file parameters consistent with
the command line parameters to remove ambiguity between the command line
parameter format and the credentials file format. That is, it parses for
both short and long form of the 'username', 'password', and 'domain'
parameters. This patch is against the current cifs-utils-4.2.
I'm also thinking of adding a second patch that allows for parsing a
"domain/user", "domain%user" and "domain/user%password" formats as allowed
from the command line.
Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
Diffstat (limited to 'mount.cifs.c')
-rw-r--r-- | mount.cifs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mount.cifs.c b/mount.cifs.c index e795fa4..21bc512 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -559,7 +559,7 @@ static int open_cred_file(char *file_name, if (newline) *newline = '\0'; - if (strncasecmp("username", line_buf + i, 8) == 0) { + if (strncasecmp("user", line_buf + i, 4) == 0) { temp_val = strchr(line_buf + i, '='); if (temp_val) { /* go past equals sign */ @@ -581,7 +581,7 @@ static int open_cred_file(char *file_name, strlcpy(parsed_info->username, temp_val, sizeof(parsed_info->username)); } - } else if (strncasecmp("password", line_buf + i, 8) == 0) { + } else if (strncasecmp("pass", line_buf + i, 4) == 0) { temp_val = strchr(line_buf + i, '='); if (!temp_val) continue; @@ -589,7 +589,7 @@ static int open_cred_file(char *file_name, i = set_password(parsed_info, temp_val); if (i) return i; - } else if (strncasecmp("domain", line_buf + i, 6) == 0) { + } else if (strncasecmp("dom", line_buf + i, 3) == 0) { temp_val = strchr(line_buf + i, '='); if (temp_val) { /* go past equals sign */ |