mount.cifs: check access of credential files before opening
commit42351937b00f6aa013d16c2a4dbd0b37e7e9ed11
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Sep 2009 10:51:01 +0000 (25 06:51 -0400)
committerKarolin Seeger <kseeger@samba.org>
Mon, 28 Sep 2009 11:22:56 +0000 (28 13:22 +0200)
tree4f34c89093381d83a8b477d538df79017e143cb3
parent53ba0b36d0d3bb2fb4b2fc5335920487060ed284
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.
source3/client/mount.cifs.c