mount.cifs: check for invalid characters in device name and mountpoint
authorJeff Layton <jlayton@redhat.com>
Tue, 26 Jan 2010 13:36:03 +0000 (08:36 -0500)
committerKarolin Seeger <kseeger@samba.org>
Mon, 29 Mar 2010 07:41:00 +0000 (09:41 +0200)
commited18be92ed14de689b6493d534e65dfa3855fbc2
treee1e0e884343f657b24aaff070aa4bc4635fa25c7
parenta395811b01e1ee40198749e45eeaf56d0093a7b6
mount.cifs: check for invalid characters in device name and mountpoint

It's apparently possible to corrupt the mtab if you pass embedded
newlines to addmntent. Apparently tabs are also a problem with certain
earlier glibc versions. Backslashes are also a minor issue apparently,
but we can't reasonably filter those.

Make sure that neither the devname or mountpoint contain any problematic
characters before allowing the mount to proceed.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit ae24005a5a2c165dfd9b859bf1c02b5f7e967be5)
client/mount.cifs.c