r14207: Convert the lp_acl_compatibility() param into an enum.
authorJames Peach <jpeach@samba.org>
Sat, 11 Mar 2006 10:59:03 +0000 (10:59 +0000)
committerJames Peach <jpeach@samba.org>
Sat, 11 Mar 2006 10:59:03 +0000 (10:59 +0000)
source/include/smb.h
source/param/loadparm.c
source/smbd/posix_acls.c

index 9464b4e8e839de9b1673166e165cb31744445255..cc85fa1f76b7084b64071beb4db10f43b5c14363 100644 (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)
index 2be578ba4feb5155f3bc2e6c5994193d08ad2af5..e285bd6087117370a0043a9fe568f5cdfbfdc5b3 100644 (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
  ***************************************************************************/
index 9e513580c3e499a0a030ffc243c01be8b233906b..5356d962a23646caa3d52c8ee652517aca482bad 100644 (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);
 }