mount.cifs: take extra care that mountpoint isn't changed during mount
commit3971af7054f4a437e7ca0a9be0441d2b383623a2
authorJeff Layton <jlayton@redhat.com>
Tue, 26 Jan 2010 13:15:41 +0000 (26 08:15 -0500)
committerFernando J V da Silva <fernandojvsilva@yahoo.com.br>
Thu, 4 Feb 2010 19:09:46 +0000 (4 17:09 -0200)
tree36085ac9e0a8ef93a25a79bdb3fdacc150026484
parente12a08345281e2150dd1b66c977f61769130dafc
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