Set parsed_info->got_user when a cred file supplies a username;

(bnc#800018).

OBS-URL: https://build.opensuse.org/package/show/network:samba:STABLE/cifs-utils?expand=0&rev=79
This commit is contained in:
Lars Müller 2013-01-23 11:12:07 +00:00 committed by Git OBS Bridge
parent c08ffc3944
commit 91538d26d4
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,29 @@
commit 1a01f7c4b90695211d12291d7a24bec05b1f2922
Author: Jeff Layton <jlayton@samba.org>
Date: Sat Jan 12 22:02:01 2013 -0500
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>
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);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 23 11:06:31 UTC 2013 - lmuelle@suse.com
- Set parsed_info->got_user when a cred file supplies a username;
(bnc#800018).
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jan 16 14:51:39 UTC 2013 - lmuelle@suse.com Wed Jan 16 14:51:39 UTC 2013 - lmuelle@suse.com

View File

@ -27,6 +27,7 @@ Source: %{name}-%{version}.tar.bz2
Source1: cifs.init Source1: cifs.init
Source2: mkinitrd_scripts_boot-cifs.sh Source2: mkinitrd_scripts_boot-cifs.sh
Source3: mkinitrd_scripts_setup-cifs.sh Source3: mkinitrd_scripts_setup-cifs.sh
Patch: 1a01f7c4b90695211d12291d7a24bec05b1f2922.diff
%if 0%{?suse_version} %if 0%{?suse_version}
PreReq: insserv %{?fillup_prereq} mkinitrd PreReq: insserv %{?fillup_prereq} mkinitrd
%else %else
@ -82,6 +83,7 @@ necessary for building ID mapping plugins for cifs-utils.
%prep %prep
%setup -q %setup -q
%patch -p1
%build %build
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fpie" export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fpie"