summaryrefslogtreecommitdiffstats
path: root/source/param/loadparm.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-25 06:40:42 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-25 06:40:42 +0000
commitc4363a12fdc0be329ca2bfeb1d7b89bfe90031dc (patch)
tree4fe489d30d628c72facdeb573a8731cdaa1519da /source/param/loadparm.c
parent260e7e27401d863e9f580d4748c577334d9fc9d0 (diff)
downloadsamba-c4363a12fdc0be329ca2bfeb1d7b89bfe90031dc.tar.gz
samba-c4363a12fdc0be329ca2bfeb1d7b89bfe90031dc.tar.xz
samba-c4363a12fdc0be329ca2bfeb1d7b89bfe90031dc.zip
changed the default permissions code to do this:
if ((sbuf->st_mode & S_IWUSR) == 0) result |= aRONLY; rather than the very complex user/group permissions checks we do currently. This is equivalent ot setting "alternate permissions = yes" in the old code. The change is motivated by three main reasons: 1) it's basically impossible to second guess whether a file is writeable without trying to open it for writing. ACLs, root squash etc just make it too hard. 2) setting it not RONLY if the owner can write is closer to what NT does (eg. look at a cdrom - files are not marked read only). 3) it prevents the silly problem of copying files from a read only share to a writeable share and then finding you can't write to them as windows preserves the RONLY flag. Lots of people get bitten by this when they drag a folder from a Samba drive. It also hurts some install programs. I have also added a new flag type for loadparm.c called FLAG_DEPRECATED which I've set for "alternate permissions". I'll soon add code to testparm to give a warning about deprecated options.
Diffstat (limited to 'source/param/loadparm.c')
-rw-r--r--source/param/loadparm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index c2f7837aa85..60561870666 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -496,7 +496,7 @@ static struct parm_struct parm_table[] =
{"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0},
{"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0},
{"unix password sync", P_BOOL, P_GLOBAL, &Globals.bUnixPasswdSync, NULL, NULL, 0},
- {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL},
+ {"alternate permissions",P_BOOL,P_LOCAL, &sDefault.bAlternatePerm, NULL, NULL, FLAG_GLOBAL|FLAG_DEPRECATED},
{"revalidate", P_BOOL, P_LOCAL, &sDefault.bRevalidate, NULL, NULL, FLAG_GLOBAL},
{"username", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, FLAG_GLOBAL},
{"user", P_STRING, P_LOCAL, &sDefault.szUsername, NULL, NULL, 0},
@@ -1205,7 +1205,6 @@ FN_LOCAL_STRING(lp_hide_files,szHideFiles)
FN_LOCAL_STRING(lp_veto_oplocks,szVetoOplockFiles)
FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation)
-FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm)
FN_LOCAL_BOOL(lp_revalidate,bRevalidate)
FN_LOCAL_BOOL(lp_casesensitive,bCaseSensitive)
FN_LOCAL_BOOL(lp_preservecase,bCasePreserve)