Q: directory mode = 1777 doesn't work ?

Jeremy Allison jeremy at valinux.com
Tue Dec 28 17:54:40 GMT 1999


Markus Koelle wrote:
> 
> How can I set the sticky bit on new directories
> via share definition ? (samba 2.0.6)
> 
> This doesn't work:
> 
> [share]
>  ....
> directory mode = 1777
>                           ^
> Any idea?

This has been fixed in the CVS sources. Here is the patch.

Hope this helps,

	Jeremy Allison,
	Samba Team.

--------------------cut here--------------------------------------------

--- /home/jeremy/tmp/samba-2.0.6/source/lib/doscalls.c  Thu Apr  8 14:13:01 1999
+++ lib/doscalls.c      Tue Dec  7 19:08:41 1999
@@ -104,11 +104,17 @@

 /*******************************************************************
  Mkdir() that calls dos_to_unix.
+ Cope with UNIXes that don't allow high order mode bits on mkdir.
+ Patch from gcarter at lanier.com.
 ********************************************************************/

 int dos_mkdir(char *dname,mode_t mode)
 {
-  return(mkdir(dos_to_unix(dname,False),mode));
+  int ret = mkdir(dos_to_unix(dname,False),mode);
+  if(!ret)
+    return(dos_chmod(dname,mode));
+  else
+    return ret;
 }

 /*******************************************************************
-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------


More information about the samba mailing list