sticky bit/force mode

Giulio Orsero giulioo at pobox.com
Fri Jan 28 09:33:06 GMT 2000


On Fri, 28 Jan 2000 19:33:26 +1100, hai scritto:

>Would somebody please reiterate the problem with sticky bits and/or
>force mode settings in samba 2.0.6 (on solaris)?  I searched the archive
>at the samba site.  I got hits, but I got file not found errors when I
>tried to view the messages.  Thanks.

There's a problem in samba <= 2.0.6 regarding the sticky bit.
If you use something like.
directory mode = 1777
force directory mode = 1777
the sticky bit won't be set.

Jeremy Allison posted a patch that will be in 2.0.7. I tested it on
linux and it works.

--- source/lib/doscalls.c  Thu Apr  8 14:13:01 1999
+++ source/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;
 }
 
 /*******************************************************************

-- 
giulioo at pobox.com


More information about the samba mailing list