svn commit: samba r12390 - in trunk/source/param: .

jra at samba.org jra at samba.org
Tue Dec 20 00:54:14 GMT 2005


Author: jra
Date: 2005-12-20 00:54:12 +0000 (Tue, 20 Dec 2005)
New Revision: 12390

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12390

Log:
Don't allow usershare files that are public write.
Jeremy.

Modified:
   trunk/source/param/loadparm.c


Changeset:
Modified: trunk/source/param/loadparm.c
===================================================================
--- trunk/source/param/loadparm.c	2005-12-20 00:49:48 UTC (rev 12389)
+++ trunk/source/param/loadparm.c	2005-12-20 00:54:12 UTC (rev 12390)
@@ -4213,6 +4213,14 @@
 		return False;
 	}
 
+	/* Ensure this doesn't have the other write bit set. */
+	if (psbuf->st_mode & S_IWOTH) {
+		DEBUG(0,("check_usershare_stat: file %s owned by uid %u allows "
+			"public write. Refusing to allow as a usershare file.\n",
+			fname, (unsigned int)psbuf->st_uid ));
+		return False;
+	}
+
 	/* Should be 10k or less. */
 	if (psbuf->st_size > 10240) {
 		DEBUG(0,("check_usershare_stat: file %s owned by uid %u is "



More information about the samba-cvs mailing list