mount.cifs: check access of credential files before opening
commit5942b8b3aca131510d0efc0288144ce82d87443c
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Sep 2009 11:00:18 +0000 (25 07:00 -0400)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Oct 2009 12:26:57 +0000 (1 14:26 +0200)
tree68e9a175631558252cddf4e9a049b720d4048fba
parentb056f86f8668f117068e32bea84447cf50597f7a
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>
Part 1/2 of a fix for CVE-2009-2948.
(cherry picked from commit 8f0af2ed4f330be558987dd52c32b32e4b8ed95f)
source/client/mount.cifs.c