mount.cifs: take extra care that mountpoint isn't changed during mount
commita60afceaa71c0c9b53b2ec1014db5d09d777803d
authorJeff Layton <jlayton@redhat.com>
Tue, 26 Jan 2010 13:35:35 +0000 (26 08:35 -0500)
committerKarolin Seeger <kseeger@samba.org>
Mon, 8 Mar 2010 09:05:46 +0000 (8 10:05 +0100)
treee9b97209434ad792f6da0613f6c8a479e5280db1
parentcc5e6e62acc75699951e1860acde4af82646f747
mount.cifs: take extra care that mountpoint isn't changed during mount

It's possible to trick mount.cifs into mounting onto the wrong directory
by replacing the mountpoint with a symlink to a directory. mount.cifs
attempts to check the validity of the mountpoint, but there's still a
possible race between those checks and the mount(2) syscall.

To guard against this, chdir to the mountpoint very early, and only deal
with it as "." from then on out.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
client/mount.cifs.c