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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx>
---
 mount.cifs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux