mount.cifs: fix regression in credential file handling

Signed-off-by: Jeff Layton <jlayton@redhat.com>
This commit is contained in:
Jeff Layton 2013-01-13 05:56:48 -05:00
parent 590cd6cd96
commit fef67dae06
2 changed files with 43 additions and 3 deletions

View File

@ -0,0 +1,35 @@
From 1a01f7c4b90695211d12291d7a24bec05b1f2922 Mon Sep 17 00:00:00 2001
From: Jeff Layton <jlayton@samba.org>
Date: Sat, 12 Jan 2013 22:02:01 -0500
Subject: [PATCH] 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>
---
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

View File

@ -3,7 +3,7 @@
Name: cifs-utils
Version: 5.9
Release: 1%{pre_release}%{?dist}
Release: 2%{pre_release}%{?dist}
Summary: Utilities for mounting and managing CIFS mounts
Group: System Environment/Daemons
@ -11,11 +11,12 @@ License: GPLv3
URL: http://linux-cifs.samba.org/cifs-utils/
BuildRoot: %{_tmppath}/%{name}-%{version}%{pre_release}-%{release}-root-%(%{__id_u} -n)
Source0: ftp://ftp.samba.org/pub/linux-cifs/cifs-utils/%{name}-%{version}%{pre_release}.tar.bz2
BuildRequires: libcap-ng-devel libtalloc-devel krb5-devel keyutils-libs-devel autoconf automake libwbclient-devel
Requires: keyutils
Source0: ftp://ftp.samba.org/pub/linux-cifs/cifs-utils/%{name}-%{version}%{pre_release}.tar.bz2
Patch1: 0001-mount.cifs-set-parsed_info-got_user-when-a-cred-file.patch
%description
The SMB/CIFS protocol is a standard file sharing protocol widely deployed
on Microsoft Windows machines. This package contains tools for mounting
@ -35,6 +36,7 @@ necessary for building ID mapping plugins for cifs-utils.
%prep
%setup -q -n %{name}-%{version}%{pre_release}
%patch1 -p1
%build
%configure --prefix=/usr ROOTSBINDIR=%{_sbindir}
@ -77,6 +79,9 @@ rm -rf %{buildroot}
%{_includedir}/cifsidmap.h
%changelog
* Sun Jan 13 2013 Jeff Layton <jlayton@redhat.com> 5.9-2
- fix regression in credential file handling
* Mon Jan 07 2013 Jeff Layton <jlayton@redhat.com> 5.9-1
- update to 5.9
- move mount.cifs to /usr/sbin per new packaging guidelines