mount.cifs: check access of credential files before opening
commit3ea466e1b8e69d59736bf5b4452769014b17f0f3
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Sep 2009 11:03:44 +0000 (25 07:03 -0400)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Oct 2009 12:25:59 +0000 (1 14:25 +0200)
tree3ef792abe5769160a993a8e5d6a304e57dd6abb1
parent9f8352264abca4e3a659a911c091a15b590b020f
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 b656deb5d7e97176c32b61b7659258846db16887)
source/client/mount.cifs.c