From 269082724a1bf367e532b92e4a35c874a08e3649 Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 16 Feb 2004 23:43:14 +0000 Subject: Disable suid on user mounts (can override with -DCIFS_ALLOW_USR_SUID) (This used to be commit a718f16e0bf78139ea46383feec0ce72c63a4986) --- source3/client/mount.cifs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/client/mount.cifs.c') 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; -- cgit