mount.cifs: check access of credential files before opening
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Sep 2009 10:45:10 +0000 (06:45 -0400)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Nov 2009 10:38:48 +0000 (11:38 +0100)
commit64c649378e08f5749c66033324377ae024405eb9
treeea7b493557687c09e8e4a455375718775b6d5ae3
parentf92dd73d52e0e9e63393088ef81b1397dcf4c985
mount.cifs: check access of credential files before opening

It's possible for an unprivileged user to pass a setuid mount.cifs a
credential or password file to which he does not have access. This can cause
mount.cifs to open the file on his behalf and possibly leak the info in the
first few lines of the file.

Check the access permissions of the file before opening it.

Reported-by: Ronald Volgers <r.c.volgers@student.utwente.nl>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: Steve French <sfrench@us.ibm.com>
(cherry picked from commit 0293057abd8cdfc7c690cf5c8dd20b8a626d52ca)
client/mount.cifs.c