Skip to contentSkip to conversation

mount.cifs: set parsed_info->got_user when a cred file supplies a username

PATCH New Jeff Layton 1 participant 1 message Jan 13, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 mount.cifs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mount.cifs.c +2 -1
index c7c3055..40b77e9 100644
@@ -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);
Signature · 1 line
1.7.11.7