From 91538d26d4bc3d3e4fa32a0d42fb280af61835a8d949bd7bf358b637f7452112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= Date: Wed, 23 Jan 2013 11:12:07 +0000 Subject: [PATCH] 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 --- 1a01f7c4b90695211d12291d7a24bec05b1f2922.diff | 29 +++++++++++++++++++ cifs-utils.changes | 6 ++++ cifs-utils.spec | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 1a01f7c4b90695211d12291d7a24bec05b1f2922.diff diff --git a/1a01f7c4b90695211d12291d7a24bec05b1f2922.diff b/1a01f7c4b90695211d12291d7a24bec05b1f2922.diff new file mode 100644 index 0000000..ca79837 --- /dev/null +++ b/1a01f7c4b90695211d12291d7a24bec05b1f2922.diff @@ -0,0 +1,29 @@ +commit 1a01f7c4b90695211d12291d7a24bec05b1f2922 +Author: Jeff Layton +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." + Signed-off-by: Jeff Layton + +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); diff --git a/cifs-utils.changes b/cifs-utils.changes index ffb7ebc..463afc4 100644 --- a/cifs-utils.changes +++ b/cifs-utils.changes @@ -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 diff --git a/cifs-utils.spec b/cifs-utils.spec index 483ab03..9ac06a9 100644 --- a/cifs-utils.spec +++ b/cifs-utils.spec @@ -27,6 +27,7 @@ Source: %{name}-%{version}.tar.bz2 Source1: cifs.init Source2: mkinitrd_scripts_boot-cifs.sh Source3: mkinitrd_scripts_setup-cifs.sh +Patch: 1a01f7c4b90695211d12291d7a24bec05b1f2922.diff %if 0%{?suse_version} PreReq: insserv %{?fillup_prereq} mkinitrd %else @@ -82,6 +83,7 @@ necessary for building ID mapping plugins for cifs-utils. %prep %setup -q +%patch -p1 %build export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fpie"