diff options
author | Steve French <sfrench@samba.org> | 2004-02-16 23:43:14 +0000 |
---|---|---|
committer | Steve French <sfrench@samba.org> | 2004-02-16 23:43:14 +0000 |
commit | 269082724a1bf367e532b92e4a35c874a08e3649 (patch) | |
tree | e5828a8aed31fbea87bb5cdfc91d93f089ffec3f /source3 | |
parent | d2742ac2fc42dc36ae089fd043228b7a41e523aa (diff) | |
download | samba-269082724a1bf367e532b92e4a35c874a08e3649.tar.gz samba-269082724a1bf367e532b92e4a35c874a08e3649.tar.bz2 samba-269082724a1bf367e532b92e4a35c874a08e3649.zip |
Disable suid on user mounts (can override with -DCIFS_ALLOW_USR_SUID)
(This used to be commit a718f16e0bf78139ea46383feec0ce72c63a4986)
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/client/mount.cifs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c index 4ae653b25d..7a51ee4b9b 100755 --- a/source3/client/mount.cifs.c +++ b/source3/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; |