From fa4904460db36da68970454bdfad2f88c831a963 Mon Sep 17 00:00:00 2001 From: Juergen Daubert Date: Sat, 19 Jan 2013 18:47:45 +0100 Subject: [PATCH] cifs-utils: add patch to fix mount when a cred file supplies a username --- cifs-utils/.md5sum | 1 + cifs-utils/Pkgfile | 6 +++-- cifs-utils/cifs-utils-5.9-got_user.patch | 29 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 cifs-utils/cifs-utils-5.9-got_user.patch diff --git a/cifs-utils/.md5sum b/cifs-utils/.md5sum index d7fe7d289..ee1d6cf04 100644 --- a/cifs-utils/.md5sum +++ b/cifs-utils/.md5sum @@ -1 +1,2 @@ +53d12c13345008e6252017c2735b18e5 cifs-utils-5.9-got_user.patch 7164ad6f7963a31fcbffbe4f14a7cfc6 cifs-utils-5.9.tar.bz2 diff --git a/cifs-utils/Pkgfile b/cifs-utils/Pkgfile index 5a9dd334c..e93bb399b 100644 --- a/cifs-utils/Pkgfile +++ b/cifs-utils/Pkgfile @@ -5,11 +5,13 @@ name=cifs-utils version=5.9 -release=1 -source=(ftp://ftp.samba.org/pub/linux-cifs/$name/$name-$version.tar.bz2) +release=2 +source=(ftp://ftp.samba.org/pub/linux-cifs/$name/$name-$version.tar.bz2 + $name-$version-got_user.patch) build () { cd $name-$version + patch -p1 -i $SRC/$name-$version-got_user.patch ./configure --prefix=/usr --mandir=/usr/man make make DESTDIR=$PKG install diff --git a/cifs-utils/cifs-utils-5.9-got_user.patch b/cifs-utils/cifs-utils-5.9-got_user.patch new file mode 100644 index 000000000..b6ac8917b --- /dev/null +++ b/cifs-utils/cifs-utils-5.9-got_user.patch @@ -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);