diff options
author | James Peach <jpeach@samba.org> | 2006-03-11 10:59:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:15:16 -0500 |
commit | a62c0925e8b38e491fef7967fdca076895152d7e (patch) | |
tree | 73a8f88eda33b68606844843ae6e94c6b8cf1ef9 /source3 | |
parent | a156d128f2bd5ea8ff9c1b5a4927ad3b82956fa8 (diff) | |
download | samba-a62c0925e8b38e491fef7967fdca076895152d7e.tar.gz samba-a62c0925e8b38e491fef7967fdca076895152d7e.tar.bz2 samba-a62c0925e8b38e491fef7967fdca076895152d7e.zip |
r14207: Convert the lp_acl_compatibility() param into an enum.
(This used to be commit 5429c495c538e416010cf44e1d6fb771770a72ae)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/smb.h | 2 | ||||
-rw-r--r-- | source3/param/loadparm.c | 29 | ||||
-rw-r--r-- | source3/smbd/posix_acls.c | 6 |
3 files changed, 14 insertions, 23 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index 9464b4e8e8..cc85fa1f76 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1441,6 +1441,8 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; +/* ACL compatibility */ +enum acl_compatibility {ACL_COMPAT_AUTO, ACL_COMPAT_WINNT, ACL_COMPAT_WIN2K}; /* * Global value meaing that the smb_uid field should be * ingored (in share level security and protocol level == CORE) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 2be578ba4f..e285bd6087 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -622,7 +622,6 @@ static BOOL handle_workgroup( int snum, const char *pszParmValue, char **ptr ); static BOOL handle_netbios_aliases( int snum, const char *pszParmValue, char **ptr ); static BOOL handle_netbios_scope( int snum, const char *pszParmValue, char **ptr ); static BOOL handle_charset( int snum, const char *pszParmValue, char **ptr ); -static BOOL handle_acl_compatibility( int snum, const char *pszParmValue, char **ptr); static BOOL handle_printing( int snum, const char *pszParmValue, char **ptr); static void set_server_role(void); @@ -778,6 +777,13 @@ static const struct enum_list enum_smb_signing_vals[] = { {-1, NULL} }; +/* ACL compatibility options. */ +static const struct enum_list enum_acl_compat_vals[] = { + { ACL_COMPAT_AUTO, "auto" }, + { ACL_COMPAT_WINNT, "winnt" }, + { ACL_COMPAT_WIN2K, "win2k" }, + { -1, NULL} +}; /* Do you want session setups at user level security with a invalid @@ -969,7 +975,7 @@ static struct parm_struct parm_table[] = { {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED}, {"reset on zero vc", P_BOOL, P_GLOBAL, &Globals.bResetOnZeroVC, NULL, NULL, FLAG_ADVANCED}, - {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, + {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, NULL, enum_acl_compat_vals, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"defer sharing violations", P_BOOL, P_GLOBAL, &Globals.bDeferSharingViolations, NULL, NULL, FLAG_ADVANCED | FLAG_GLOBAL}, {"ea support", P_BOOL, P_LOCAL, &sDefault.bEASupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL}, @@ -1832,7 +1838,7 @@ FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners) FN_GLOBAL_CONST_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_CONST_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_CONST_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) -FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) +FN_GLOBAL_INTEGER(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) @@ -3305,23 +3311,6 @@ char *lp_ldap_idmap_suffix(void) return lp_string(Globals.szLdapSuffix); } -/*************************************************************************** -***************************************************************************/ - -static BOOL handle_acl_compatibility(int snum, const char *pszParmValue, char **ptr) -{ - if (strequal(pszParmValue, "auto")) - string_set(ptr, ""); - else if (strequal(pszParmValue, "winnt")) - string_set(ptr, "winnt"); - else if (strequal(pszParmValue, "win2k")) - string_set(ptr, "win2k"); - else - return False; - - return True; -} - /**************************************************************************** set the value for a P_ENUM ***************************************************************************/ diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 9e513580c3..5356d962a2 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -783,15 +783,15 @@ static void merge_aces( canon_ace **pp_list_head ) static BOOL nt4_compatible_acls(void) { - const char *compat = lp_acl_compatibility(); + int compat = lp_acl_compatibility(); - if (*compat == '\0') { + if (compat == ACL_COMPAT_AUTO) { enum remote_arch_types ra_type = get_remote_arch(); /* Automatically adapt to client */ return (ra_type <= RA_WINNT); } else - return (strequal(compat, "winnt")); + return (compat == ACL_COMPAT_WINNT); } |