loadparm.c: Changed default create mask to 755 to support MAP_ARCHIVE.
authorSamba Release Account <samba-bugs@samba.org>
Thu, 24 Jul 1997 22:42:16 +0000 (22:42 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Thu, 24 Jul 1997 22:42:16 +0000 (22:42 +0000)
server.c: Added check for MAP_ARCHIVE before we set archive bit.
Jeremy (jallison@whistle.com)
(This used to be commit d21a166277776f6750b7bcc3c4f9073cce17eacb)

source3/param/loadparm.c
source3/smbd/server.c

index ede1f12decc1fa1f756e09b0400424e3f18798b7..fd2797aadb75d333f625d21a7f7056eb2d93f2db 100644 (file)
@@ -222,9 +222,9 @@ typedef struct
   char *writelist;
   char *volume;
   int  iMinPrintSpace;
   char *writelist;
   char *volume;
   int  iMinPrintSpace;
-  int  iCreate_mode;
+  int  iCreate_mask;
   int  iCreate_force_mode;
   int  iCreate_force_mode;
-  int  iDir_mode;
+  int  iDir_mask;
   int  iDir_force_mode;
   int  iMaxConnections;
   int  iDefaultCase;
   int  iDir_force_mode;
   int  iMaxConnections;
   int  iDefaultCase;
@@ -302,9 +302,9 @@ static service sDefault =
   NULL,    /* writelist */
   NULL,    /* volume */
   0,       /* iMinPrintSpace */
   NULL,    /* writelist */
   NULL,    /* volume */
   0,       /* iMinPrintSpace */
-  0644,    /* iCreate_mode */
+  0744,    /* iCreate_mask */
   0000,    /* iCreate_force_mode */
   0000,    /* iCreate_force_mode */
-  0755,    /* iDir_mode */
+  0755,    /* iDir_mask */
   0000,    /* iDir_force_mode */
   0,       /* iMaxConnections */
   CASE_LOWER, /* iDefaultCase */
   0000,    /* iDir_force_mode */
   0,       /* iMaxConnections */
   CASE_LOWER, /* iDefaultCase */
@@ -504,11 +504,11 @@ struct parm_struct
   {"writable",         P_BOOLREV, P_LOCAL,  &sDefault.bRead_only,       NULL},
   {"max connections",  P_INTEGER, P_LOCAL,  &sDefault.iMaxConnections,  NULL},
   {"min print space",  P_INTEGER, P_LOCAL,  &sDefault.iMinPrintSpace,   NULL},
   {"writable",         P_BOOLREV, P_LOCAL,  &sDefault.bRead_only,       NULL},
   {"max connections",  P_INTEGER, P_LOCAL,  &sDefault.iMaxConnections,  NULL},
   {"min print space",  P_INTEGER, P_LOCAL,  &sDefault.iMinPrintSpace,   NULL},
-  {"create mask",      P_OCTAL,   P_LOCAL,  &sDefault.iCreate_mode,     NULL},
-  {"create mode",      P_OCTAL,   P_LOCAL,  &sDefault.iCreate_mode,     NULL},
+  {"create mask",      P_OCTAL,   P_LOCAL,  &sDefault.iCreate_mask,     NULL},
+  {"create mode",      P_OCTAL,   P_LOCAL,  &sDefault.iCreate_mask,     NULL},
   {"force create mode",P_OCTAL,   P_LOCAL,  &sDefault.iCreate_force_mode,     NULL},
   {"force create mode",P_OCTAL,   P_LOCAL,  &sDefault.iCreate_force_mode,     NULL},
-  {"directory mask",   P_OCTAL,   P_LOCAL,  &sDefault.iDir_mode,        NULL},
-  {"directory mode",   P_OCTAL,   P_LOCAL,  &sDefault.iDir_mode,        NULL},
+  {"directory mask",   P_OCTAL,   P_LOCAL,  &sDefault.iDir_mask,        NULL},
+  {"directory mode",   P_OCTAL,   P_LOCAL,  &sDefault.iDir_mask,        NULL},
   {"force directory mode",   P_OCTAL,   P_LOCAL,  &sDefault.iDir_force_mode,        NULL},
   {"set directory",    P_BOOLREV, P_LOCAL,  &sDefault.bNo_set_dir,      NULL},
   {"status",           P_BOOL,    P_LOCAL,  &sDefault.status,           NULL},
   {"force directory mode",   P_OCTAL,   P_LOCAL,  &sDefault.iDir_force_mode,        NULL},
   {"set directory",    P_BOOLREV, P_LOCAL,  &sDefault.bNo_set_dir,      NULL},
   {"status",           P_BOOL,    P_LOCAL,  &sDefault.status,           NULL},
@@ -929,9 +929,9 @@ FN_LOCAL_BOOL(lp_map_system,bMap_system)
 FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly)
 FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks)
 
 FN_LOCAL_BOOL(lp_delete_readonly,bDeleteReadonly)
 FN_LOCAL_BOOL(lp_fake_oplocks,bFakeOplocks)
 
-FN_LOCAL_INTEGER(lp_create_mode,iCreate_mode)
+FN_LOCAL_INTEGER(lp_create_mode,iCreate_mask)
 FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode)
 FN_LOCAL_INTEGER(lp_force_create_mode,iCreate_force_mode)
-FN_LOCAL_INTEGER(lp_dir_mode,iDir_mode)
+FN_LOCAL_INTEGER(lp_dir_mode,iDir_mask)
 FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode)
 FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections)
 FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase)
 FN_LOCAL_INTEGER(lp_force_dir_mode,iDir_force_mode)
 FN_LOCAL_INTEGER(lp_max_connections,iMaxConnections)
 FN_LOCAL_INTEGER(lp_defaultcase,iDefaultCase)
index 30a3027de9e48a51b0131bab595b3fc30f04bfc1..1b961ab7c7a12b8781c307ea1ba6a0638869dba1 100644 (file)
@@ -194,7 +194,7 @@ int dos_mode(int cnum,char *path,struct stat *sbuf)
       result |= aRONLY;
   }
 
       result |= aRONLY;
   }
 
-  if ((sbuf->st_mode & S_IXUSR) != 0)
+  if (MAP_ARCHIVE(cnum) && ((sbuf->st_mode & S_IXUSR) != 0))
     result |= aARCH;
 
   if (MAP_SYSTEM(cnum) && ((sbuf->st_mode & S_IXGRP) != 0))
     result |= aARCH;
 
   if (MAP_SYSTEM(cnum) && ((sbuf->st_mode & S_IXGRP) != 0))