param: rename FLAG_HIDE to FLAG_SYNONYM
authorMichael Adam <obnox@samba.org>
Fri, 24 Apr 2015 07:57:08 +0000 (09:57 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 1 May 2015 22:56:31 +0000 (00:56 +0200)
This is what it is used for - detect synonyms.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
lib/param/loadparm.h
lib/param/param_table.c
source3/param/loadparm.c

index 2be307812157d95c2842e578db6385ccb2c0c380..c762259ba747f3b8dd7af0998dd80ea92fd96ecb 100644 (file)
@@ -95,7 +95,7 @@ struct file_lists {
 };
 
 #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
-#define FLAG_HIDE      0x2000 /* options that should be hidden in SWAT */
+#define FLAG_SYNONYM   0x2000 /* options that is a synonym of another option */
 #define FLAG_CMDLINE   0x10000 /* option has been overridden */
 #define FLAG_DEFAULT    0x20000 /* this option was a default */
 
index a4f807dbcdb17073cfaf451efc0ae86ac0bddea9..eede823273ea0e8a03351da114b625b852e40994 100644 (file)
@@ -274,7 +274,7 @@ static const struct enum_list enum_case[] = {
  *
  * NOTE: Handling of duplicated (synonym) parameters:
  *   Parameters that are synonymous are stored in the same variable.
- *   All but the default spelling carry the flag FLAG_HIDE.
+ *   All but the default spelling carry the flag FLAG_SYNONYM.
  */
 
 #define GLOBAL_VAR(name) offsetof(struct loadparm_global, name)
@@ -321,7 +321,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(path),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "workgroup",
@@ -515,7 +515,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(private_dir),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "passdb backend",
@@ -548,7 +548,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(root_directory),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "root",
@@ -557,7 +557,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(root_directory),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "guest account",
@@ -722,7 +722,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(username),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "users",
@@ -731,7 +731,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(username),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "invalid users",
@@ -812,7 +812,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(read_only),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "writeable",
@@ -821,7 +821,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(read_only),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "writable",
@@ -830,7 +830,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(read_only),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "acl check permissions",
@@ -881,7 +881,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(create_mask),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "force create mode",
@@ -962,7 +962,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(guest_only),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "administrative share",
@@ -988,7 +988,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(guest_ok),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "only user",
@@ -1014,7 +1014,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(hosts_allow),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "hosts deny",
@@ -1031,7 +1031,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(hosts_deny),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "preload modules",
@@ -1080,7 +1080,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(log_level),
                .special        = handle_debug_list,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "syslog",
@@ -1918,7 +1918,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(szPrintcapname),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "printable",
@@ -1943,7 +1943,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(printable),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "printing",
@@ -2017,7 +2017,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(_disable_spoolss),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "lpq command",
@@ -2131,7 +2131,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(_printername),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "use client driver",
@@ -2205,7 +2205,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(case_sensitive),
                .special        = NULL,
                .enum_list      = enum_bool_auto,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "preserve case",
@@ -2577,7 +2577,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(iPreferredMaster),
                .special        = NULL,
                .enum_list      = enum_bool_auto,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "local master",
@@ -2618,7 +2618,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(browseable),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "access based share enum",
@@ -2843,7 +2843,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(ldap_passwd_sync),
                .special        = NULL,
                .enum_list      = enum_ldap_passwd_sync,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "ldap replication sleep",
@@ -3012,7 +3012,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(lock_directory),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "state directory",
@@ -3218,7 +3218,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(valid),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "copy",
@@ -3227,7 +3227,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(szCopy),
                .special        = handle_copy,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "include",
@@ -3508,7 +3508,7 @@ struct parm_struct parm_table[] = {
                .offset         = LOCAL_VAR(vfs_objects),
                .special        = NULL,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "msdfs root",
@@ -3591,7 +3591,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(szIdmapUID),
                .special        = handle_idmap_uid,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "idmap gid",
@@ -3609,7 +3609,7 @@ struct parm_struct parm_table[] = {
                .offset         = GLOBAL_VAR(szIdmapGID),
                .special        = handle_idmap_gid,
                .enum_list      = NULL,
-               .flags          = FLAG_HIDE,
+               .flags          = FLAG_SYNONYM,
        },
        {
                .label          = "template homedir",
index af91a22012506e66facc0f32fd344495f1784948..a81a20a7478f84a0c31e98bef8ee055d298879c1 100644 (file)
@@ -1652,7 +1652,7 @@ static int map_parameter_canonical(const char *pszParmName, bool *inverse)
        bool loc_inverse = false;
 
        parm_num = lpcfg_map_parameter(pszParmName);
-       if ((parm_num < 0) || !(parm_table[parm_num].flags & FLAG_HIDE)) {
+       if ((parm_num < 0) || !(parm_table[parm_num].flags & FLAG_SYNONYM)) {
                /* invalid, parametric or no canidate for synonyms ... */
                goto done;
        }
@@ -1682,8 +1682,8 @@ static bool is_synonym_of(int parm1, int parm2, bool *inverse)
 {
        if ((parm_table[parm1].offset == parm_table[parm2].offset) &&
            (parm_table[parm1].p_class == parm_table[parm2].p_class) &&
-           (parm_table[parm1].flags & FLAG_HIDE) &&
-           !(parm_table[parm2].flags & FLAG_HIDE))
+           (parm_table[parm1].flags & FLAG_SYNONYM) &&
+           !(parm_table[parm2].flags & FLAG_SYNONYM))
        {
                if (inverse != NULL) {
                        if ((parm_table[parm1].type == P_BOOLREV) &&
@@ -1714,8 +1714,8 @@ static void show_parameter(int parmIndex)
        const char *type[] = { "P_BOOL", "P_BOOLREV", "P_CHAR", "P_INTEGER",
                "P_OCTAL", "P_LIST", "P_STRING", "P_USTRING",
                "P_ENUM" };
-       unsigned flags[] = { FLAG_DEPRECATED, FLAG_HIDE };
-       const char *flag_names[] = { "FLAG_DEPRECATED", "FLAG_HIDE", NULL};
+       unsigned flags[] = { FLAG_DEPRECATED, FLAG_SYNONYM };
+       const char *flag_names[] = { "FLAG_DEPRECATED", "FLAG_SYNONYM", NULL};
 
        printf("%s=%s", parm_table[parmIndex].label,
               type[parm_table[parmIndex].type]);