aboutsummaryrefslogtreecommitdiffstats
path: root/mount.cifs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2013-01-12 22:02:01 -0500
committerJeff Layton <jlayton@samba.org>2013-01-13 05:49:06 -0500
commit1a01f7c4b90695211d12291d7a24bec05b1f2922 (patch)
tree90bd99bcda5958aa2375a1cb84f97f8fc117165f /mount.cifs.c
parent739289ad3ce915e1ee2705ecd7ac4e907cd91405 (diff)
downloadcifs-utils-1a01f7c4b90695211d12291d7a24bec05b1f2922.tar.gz
cifs-utils-1a01f7c4b90695211d12291d7a24bec05b1f2922.tar.xz
cifs-utils-1a01f7c4b90695211d12291d7a24bec05b1f2922.zip
mount.cifs: set parsed_info->got_user when a cred file supplies a username
commit 85d18a1ed introduced a regression when using a credentials file. It set the username in the parsed mount info properly, but didn't set the "got_user" flag in it. Also, fix an incorrect strlcpy length specifier in open_cred_file. Reported-by: "Mantas M." <grawity@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'mount.cifs.c')
-rw-r--r--mount.cifs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index c7c3055..40b77e9 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -581,7 +581,8 @@ static int open_cred_file(char *file_name,
switch (parse_cred_line(line_buf + i, &temp_val)) {
case CRED_USER:
strlcpy(parsed_info->username, temp_val,
- sizeof(parsed_info->domain));
+ sizeof(parsed_info->username));
+ parsed_info->got_user = 1;
break;
case CRED_PASS:
i = set_password(parsed_info, temp_val);