mount.cifs: check access of credential files before opening
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Sep 2009 11:05:00 +0000 (07:05 -0400)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Oct 2009 12:25:01 +0000 (14:25 +0200)
commit6aa5d772a91b34860f4717d504d2ddcd833c730a
tree509ad6220850f9252cee098bdebad822d4bcaddc
parentba99150d3c4c4afa45cad097d6b1f4bfaaa29ba0
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 87fe29ca3239492126a99e1562db673ea7ca208b)
source/client/mount.cifs.c