s4:simple_ldap_map - Enhance it for supporting "primaryGroupID" in the right way
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Tue, 25 Aug 2009 22:12:44 +0000 (00:12 +0200)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 6 Sep 2009 10:35:22 +0000 (12:35 +0200)
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c

index 21b80dccbf3b9d4d60cd0b2c9351cce102788a94..b6a0ee0c76854f2126f76083b01d8821515c03aa 100644 (file)
@@ -450,8 +450,8 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                .remote_name = "nsuniqueid", 
                                .convert_local = guid_ns_string,
                                .convert_remote = encode_ns_guid,
-                       },
-               },
+                       }
+               }
        },
        /* objectSid */ 
        {
@@ -462,8 +462,8 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                .remote_name = "objectSid", 
                                .convert_local = sid_always_binary,
                                .convert_remote = val_copy,
-                       },
-               },
+                       }
+               }
        },
        {
                .local_name = "whenCreated",
@@ -491,8 +491,8 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                .remote_name = "objectCategory", 
                                .convert_local = objectCategory_always_dn,
                                .convert_remote = val_copy,
-                       },
-               },
+                       }
+               }
        },
        {
                .local_name = "distinguishedName",
@@ -503,6 +503,17 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                         }
                }
        },
+       {
+               .local_name = "primaryGroupID",
+               .type = MAP_CONVERT,
+               .u = {
+                       .convert = {
+                                .remote_name = "primaryGroupID",
+                                .convert_local = normalise_to_signed32,
+                                .convert_remote = val_copy,
+                       }
+               }
+       },
        {
                .local_name = "groupType",
                .type = MAP_CONVERT,
@@ -511,7 +522,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                 .remote_name = "groupType",
                                 .convert_local = normalise_to_signed32,
                                 .convert_remote = val_copy,
-                        },
+                        }
                }
        },
        {
@@ -522,7 +533,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                 .remote_name = "userAccountControl",
                                 .convert_local = normalise_to_signed32,
                                 .convert_remote = val_copy,
-                        },
+                        }
                }
        },
        {
@@ -533,7 +544,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                 .remote_name = "sAMAccountType",
                                 .convert_local = normalise_to_signed32,
                                 .convert_remote = val_copy,
-                        },
+                        }
                }
        },
        {
@@ -544,7 +555,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                 .remote_name = "systemFlags",
                                 .convert_local = normalise_to_signed32,
                                 .convert_remote = val_copy,
-                        },
+                        }
                }
        },
        {
@@ -555,8 +566,8 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                 .remote_name = "modifyTimestamp",
                                 .convert_local = usn_to_timestamp,
                                 .convert_remote = timestamp_to_usn,
-                        },
-               },
+                        }
+               }
        },
        {
                .local_name = "usnCreated",
@@ -566,8 +577,8 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
                                 .remote_name = "createTimestamp",
                                 .convert_local = usn_to_timestamp,
                                 .convert_remote = timestamp_to_usn,
-                        },
-               },
+                        }
+               }
        },
        {
                .local_name = "*",