mount.cifs: take extra care that mountpoint isn't changed during mount
commitc4a342cec1ced80128f82758c7a2192b23f4017a
authorJeff Layton <jlayton@redhat.com>
Tue, 26 Jan 2010 13:45:58 +0000 (26 08:45 -0500)
committerKarolin Seeger <kseeger@samba.org>
Mon, 8 Mar 2010 09:02:34 +0000 (8 10:02 +0100)
tree7c3a4909b7b7f1db7adbecd5d9e15c4ec4693a21
parent396eb03109400fe603c57a0a0d4bdc37c7131cf5
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>
source3/client/mount.cifs.c