[linux-cifs-client] Error's opening credentials file.

Jeff Layton jlayton at samba.org
Fri Apr 2 14:04:09 MDT 2010


On Fri, 2 Apr 2010 15:12:12 -0400
Jeff Layton <jlayton at samba.org> wrote:

> On Fri, 2 Apr 2010 17:11:20 +0200
> Stef Bon <stefbon at gmail.com> wrote:
> 
> > Hello,
> > 
> > I'm using a construction to make resources (local and remote) on a
> > userfriendly manner available in map in the users
> > home directory. These resources are USB devices (local) and FTP and
> > SSH hosts, and SMB shares.
> > 
> > For mounting the construction is using the autofs automounter for Linux.
> > It's running with root permissions.
> > 
> > To mount SMB shares of course mount.cifs is used, and a personalized
> > credentialsfile. So the mountcommand looks like:
> > 
> > mount.cifs "//$SMM_name/$SMB_share" $mount_directory -o
> > ip=$SMB_ip,credentialsfile=/home/sbon/.smb/mount.cred
> > 
> > Now with the latest version of cifs.utils 4.2, it does not mount. The
> > error it gives is:
> > 
> > error -1 (Unknown error 4294967295) opening credential file
> > /home/sbon/.smb/mount.cred
> > 
> > Now after some trying, when I put the credential file in a subdir of
> > root's home, it's ok:
> > 
> > mv /home/sbon/.smb/mount.cred /root/.smb
> > 
> > and I adjust the config of my construction to look for this
> > credentialfile, everything works again.
> > 
> > The permissions of the cred file is not changed! Apparently the
> > mount.cifs command also looks at the
> > directories above it (parents).
> > 
> > Now checking the code the function that reads the cred file is
> > open_cred_file, which uses the access call to check access.
> > Obviously that function checks the permissions of all the parent dirs,
> > and sees that the user root has not enough permissions, which is not
> > true.
> > 
> > IT's not such a big problem, I've got it working again, but it should
> > be documented.
> > 
> > Stef
> 
> What was the last version on which this worked? Are you mount.cifs as a
> setuid root program? Is mount.cifs linked against libcap?
> 

Does the attached patch fix the problem?

-- 
Jeff Layton <jlayton at samba.org>


More information about the linux-cifs-client mailing list