1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

r14207: Convert the lp_acl_compatibility() param into an enum.

(This used to be commit 5429c495c5)
This commit is contained in:
James Peach 2006-03-11 10:59:03 +00:00 committed by Gerald (Jerry) Carter
parent a156d128f2
commit a62c0925e8
3 changed files with 14 additions and 23 deletions

View File

@ -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)

View File

@ -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
***************************************************************************/

View File

@ -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);
}