summaryrefslogtreecommitdiffstats
path: root/source/client/mount.cifs.c
diff options
context:
space:
mode:
authorSteve French <sfrench@samba.org>2004-02-16 23:43:14 +0000
committerSteve French <sfrench@samba.org>2004-02-16 23:43:14 +0000
commita718f16e0bf78139ea46383feec0ce72c63a4986 (patch)
tree4a774d8bb8b99d11d3d95cd63767daa92fe29b37 /source/client/mount.cifs.c
parent04639e8862c360e89faac8b80c63197d514b7455 (diff)
downloadsamba-a718f16e0bf78139ea46383feec0ce72c63a4986.tar.gz
samba-a718f16e0bf78139ea46383feec0ce72c63a4986.tar.xz
samba-a718f16e0bf78139ea46383feec0ce72c63a4986.zip
Disable suid on user mounts (can override with -DCIFS_ALLOW_USR_SUID)
Diffstat (limited to 'source/client/mount.cifs.c')
-rwxr-xr-xsource/client/mount.cifs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index 4ae653b25da..7a51ee4b9b8 100755
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -749,7 +749,11 @@ int main(int argc, char ** argv)
if((getuid() != 0) && (geteuid() == 0)) {
if((statbuf.st_uid == getuid()) && (S_IRWXU == (statbuf.st_mode & S_IRWXU))) {
- printf("setuid mount allowed\n");
+#ifndef CIFS_ALLOW_USR_SUID
+ /* Do not allow user mounts to control suid flag
+ for mount unless explicitly built that way */
+ flags |= MS_NOSUID;
+#endif
} else {
printf("mount error: permission denied or not superuser and cifs.mount not installed SUID\n");
return -1;