libds/common/flags: various
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 13 Sep 2009 09:01:44 +0000 (11:01 +0200)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Thu, 17 Sep 2009 10:02:58 +0000 (12:02 +0200)
- Reorders the header file to have the order "userAccountFlags", "groupType",
  "sAMAccountType" (matches the order in the flag_mapping.c and samldb module)
- Fixes the group account flags properly up
- Fixes the flags for "domain/forestFunctionality" and "domainControllerFunctionality"
  up

libds/common/flag_mapping.c
libds/common/flags.h

index dc7d80185a2b9662c7fda092416eab198ca2d129..429ccacb490b8713c6dde7587450a290350e8a4a 100644 (file)
@@ -105,21 +105,24 @@ uint32_t ds_gtype2atype(uint32_t gtype)
                case GTYPE_SECURITY_BUILTIN_LOCAL_GROUP:
                        atype = ATYPE_SECURITY_LOCAL_GROUP;
                        break;
+               case GTYPE_SECURITY_GLOBAL_GROUP:
+                       atype = ATYPE_SECURITY_GLOBAL_GROUP;
+                       break;
                case GTYPE_SECURITY_DOMAIN_LOCAL_GROUP:
                        atype = ATYPE_SECURITY_LOCAL_GROUP;
                        break;
-               case GTYPE_SECURITY_GLOBAL_GROUP:
-                       atype = ATYPE_SECURITY_GLOBAL_GROUP;
+               case GTYPE_SECURITY_UNIVERSAL_GROUP:
+                       atype = ATYPE_SECURITY_UNIVERSAL_GROUP;
                        break;
 
                case GTYPE_DISTRIBUTION_GLOBAL_GROUP:
                        atype = ATYPE_DISTRIBUTION_GLOBAL_GROUP;
                        break;
                case GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP:
-                       atype = ATYPE_DISTRIBUTION_UNIVERSAL_GROUP;
+                       atype = ATYPE_DISTRIBUTION_LOCAL_GROUP;
                        break;
                case GTYPE_DISTRIBUTION_UNIVERSAL_GROUP:
-                       atype = ATYPE_DISTRIBUTION_LOCAL_GROUP;
+                       atype = ATYPE_DISTRIBUTION_UNIVERSAL_GROUP;
                        break;
        }
 
index 2b342af8d6a1e137ae2e9e5514888f11cb5b2d8d..dfdd603a1546ad4e2d8cf968b3b0af218ef081fd 100644 (file)
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-/* UserFlags for userAccountControl */
+/* User flags for "userAccountControl" */
 #define UF_SCRIPT                              0x00000001  /* NT or Lan Manager Login script must be executed */
 #define UF_ACCOUNTDISABLE                      0x00000002
 #define UF_00000004                            0x00000004
                UF_DONT_REQUIRE_PREAUTH \
                )
 
-/* sAMAccountType */
-#define ATYPE_NORMAL_ACCOUNT                   0x30000000 /* 805306368 */
-#define ATYPE_WORKSTATION_TRUST                        0x30000001 /* 805306369 */
-#define ATYPE_INTERDOMAIN_TRUST                        0x30000002 /* 805306370 */
-#define ATYPE_SECURITY_GLOBAL_GROUP            0x10000000 /* 268435456 */
-#define ATYPE_DISTRIBUTION_GLOBAL_GROUP                0x10000001 /* 268435457 */
-#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP     ATYPE_DISTRIBUTION_GLOBAL_GROUP
-#define ATYPE_SECURITY_LOCAL_GROUP             0x20000000 /* 536870912 */
-#define ATYPE_DISTRIBUTION_LOCAL_GROUP         0x20000001 /* 536870913 */
-
-#define ATYPE_ACCOUNT          ATYPE_NORMAL_ACCOUNT            /* 0x30000000 805306368 */
-#define ATYPE_GLOBAL_GROUP     ATYPE_SECURITY_GLOBAL_GROUP     /* 0x10000000 268435456 */
-#define ATYPE_LOCAL_GROUP      ATYPE_SECURITY_LOCAL_GROUP      /* 0x20000000 536870912 */
-
-/* groupType */
+/* Group flags for "groupType" */
 #define GROUP_TYPE_BUILTIN_LOCAL_GROUP         0x00000001
 #define GROUP_TYPE_ACCOUNT_GROUP               0x00000002
 #define GROUP_TYPE_RESOURCE_GROUP              0x00000004
 #define GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP  0x00000004      /* 4 */
 #define GTYPE_DISTRIBUTION_UNIVERSAL_GROUP     0x00000008      /* 8 */
 
+/* Account flags for "sAMAccountType" */
+#define ATYPE_NORMAL_ACCOUNT                   0x30000000 /* 805306368 */
+#define ATYPE_WORKSTATION_TRUST                        0x30000001 /* 805306369 */
+#define ATYPE_INTERDOMAIN_TRUST                        0x30000002 /* 805306370 */
+#define ATYPE_SECURITY_GLOBAL_GROUP            0x10000000 /* 268435456 */
+#define ATYPE_SECURITY_LOCAL_GROUP             0x20000000 /* 536870912 */
+#define ATYPE_SECURITY_UNIVERSAL_GROUP         ATYPE_SECURITY_GLOBAL_GROUP
+#define ATYPE_DISTRIBUTION_GLOBAL_GROUP                0x10000001 /* 268435457 */
+#define ATYPE_DISTRIBUTION_LOCAL_GROUP         0x20000001 /* 536870913 */
+#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP     ATYPE_DISTRIBUTION_GLOBAL_GROUP
+
+#define ATYPE_ACCOUNT          ATYPE_NORMAL_ACCOUNT            /* 0x30000000 805306368 */
+#define ATYPE_GLOBAL_GROUP     ATYPE_SECURITY_GLOBAL_GROUP     /* 0x10000000 268435456 */
+#define ATYPE_LOCAL_GROUP      ATYPE_SECURITY_LOCAL_GROUP      /* 0x20000000 536870912 */
+
+/* "instanceType" */
 #define INSTANCE_TYPE_IS_NC_HEAD       0x00000001
 #define INSTANCE_TYPE_UNINSTANT                0x00000002
 #define INSTANCE_TYPE_WRITE            0x00000004
 #define INSTANCE_TYPE_NC_COMING                0x00000010
 #define INSTANCE_TYPE_NC_GOING         0x00000020
 
+/* "systemFlags" */
 #define SYSTEM_FLAG_CR_NTDS_NC                 0x00000001
 #define SYSTEM_FLAG_CR_NTDS_DOMAIN             0x00000002
 #define SYSTEM_FLAG_CR_NTDS_NOT_GC_REPLICATED  0x00000004
 #define SYSTEM_FLAG_CONFIG_ALLOW_RENAME                0x40000000
 #define SYSTEM_FLAG_DISALLOW_DELTE             0x80000000
 
+/* "searchFlags" */
 #define SEARCH_FLAG_ATTINDEX           0x0000001
 #define SEARCH_FLAG_PDNTATTINDEX       0x0000002
 #define SEARCH_FLAG_ANR                        0x0000004
 #define SEARCH_FLAG_NEVERVALUEAUDIT    0x0000100
 #define SEARCH_FLAG_RODC_ATTRIBUTE     0x0000200
 
-#define DS_BEHAVIOR_WIN2000            0
-#define DS_BEHAVIOR_WIN2003_INTERIM    1
-#define DS_BEHAVIOR_WIN2003            2
-#define DS_BEHAVIOR_WIN2008            3
-
-/* Settings for the domainFunctionality attribute in the rootDSE */
-
+/* "domainFunctionality", "forestFunctionality" in the rootDSE */
 #define DS_DOMAIN_FUNCTION_2000                0
-#define DS_DOMAIN_FUCNTION_2003_MIXED  1
+#define DS_DOMAIN_FUNCTION_2003_MIXED  1
 #define DS_DOMAIN_FUNCTION_2003                2
 #define DS_DOMAIN_FUNCTION_2008                3
+#define DS_DOMAIN_FUNCTION_2008_R2     4 
+
+/* "domainControllerFunctionality" in the rootDSE */
+#define DS_DC_FUNCTION_2000            0
+#define DS_DC_FUNCTION_2003            2
+#define DS_DC_FUNCTION_2008            3
+#define DS_DC_FUNCTION_2008_R2         4