Disable suid on user mounts (can override with -DCIFS_ALLOW_USR_SUID)
authorSteve French <sfrench@samba.org>
Mon, 16 Feb 2004 23:43:14 +0000 (23:43 +0000)
committerSteve French <sfrench@samba.org>
Mon, 16 Feb 2004 23:43:14 +0000 (23:43 +0000)
(This used to be commit a718f16e0bf78139ea46383feec0ce72c63a4986)

source3/client/mount.cifs.c

index 4ae653b25da18d01d580c0fac230d70af8094e05..7a51ee4b9b8ec8ec02708b5548193b1c49cc7a03 100755 (executable)
@@ -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;