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>
Mon, 28 Sep 2009 18:34:53 +0000 (20:34 +0200)
commit87fe29ca3239492126a99e1562db673ea7ca208b
tree370caeb70b9b41bbf70e6c4e189140511a09cdbd
parent493ee2c888c4eb54dfa4063ac9fb3f19323a7b4c
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.
source/client/mount.cifs.c