s3-libads: move ldap posix schema defines to their own header file.
authorGünther Deschner <gd@samba.org>
Wed, 30 Jun 2010 21:48:34 +0000 (23:48 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 1 Jul 2010 21:20:40 +0000 (23:20 +0200)
Guenther

source3/include/ads.h
source3/include/proto.h
source3/libads/disp_sec.c
source3/libads/ldap_schema.c
source3/libads/ldap_schema.h [new file with mode: 0644]
source3/winbindd/idmap_ad.c

index 756612be3a843be8770eff5cfa9e7d5c09d3d452..0637cc8ad4b483b457e6de5a7a20d96d292f9d9c 100644 (file)
@@ -6,15 +6,6 @@
   basically this is a wrapper around ldap
 */
 
-enum wb_posix_mapping {
-       WB_POSIX_MAP_UNKNOWN    = -1,
-       WB_POSIX_MAP_TEMPLATE   = 0, 
-       WB_POSIX_MAP_SFU        = 1, 
-       WB_POSIX_MAP_SFU20      = 2, 
-       WB_POSIX_MAP_RFC2307    = 3,
-       WB_POSIX_MAP_UNIXINFO   = 4
-};
-
 struct ads_struct;
 
 struct ads_saslwrap_ops {
@@ -108,20 +99,6 @@ typedef struct ads_struct {
 #endif /* HAVE_LDAP */
 } ADS_STRUCT;
 
-/* used to remember the names of the posix attributes in AD */
-/* see the rfc2307 & sfu nss backends */
-
-struct posix_schema {
-       char *posix_homedir_attr;
-       char *posix_shell_attr;
-       char *posix_uidnumber_attr;
-       char *posix_gidnumber_attr;
-       char *posix_gecos_attr;
-       char *posix_uid_attr;
-};
-
-
-
 #ifdef HAVE_ADS
 typedef LDAPMod **ADS_MODLIST;
 #else
@@ -140,31 +117,6 @@ typedef void **ADS_MODLIST;
 #define ADS_EXTENDED_DN_OID    "1.2.840.113556.1.4.529"
 #define ADS_SD_FLAGS_OID       "1.2.840.113556.1.4.801"
 
-/* ldap attribute oids (Services for Unix 3.0, 3.5) */
-#define ADS_ATTR_SFU_UIDNUMBER_OID     "1.2.840.113556.1.6.18.1.310"
-#define ADS_ATTR_SFU_GIDNUMBER_OID     "1.2.840.113556.1.6.18.1.311"
-#define ADS_ATTR_SFU_HOMEDIR_OID       "1.2.840.113556.1.6.18.1.344"
-#define ADS_ATTR_SFU_SHELL_OID                 "1.2.840.113556.1.6.18.1.312"
-#define ADS_ATTR_SFU_GECOS_OID                 "1.2.840.113556.1.6.18.1.337"
-#define ADS_ATTR_SFU_UID_OID            "1.2.840.113556.1.6.18.1.309"
-
-/* ldap attribute oids (Services for Unix 2.0) */
-#define ADS_ATTR_SFU20_UIDNUMBER_OID   "1.2.840.113556.1.4.7000.187.70"
-#define ADS_ATTR_SFU20_GIDNUMBER_OID   "1.2.840.113556.1.4.7000.187.71"
-#define ADS_ATTR_SFU20_HOMEDIR_OID     "1.2.840.113556.1.4.7000.187.106"
-#define ADS_ATTR_SFU20_SHELL_OID       "1.2.840.113556.1.4.7000.187.72"
-#define ADS_ATTR_SFU20_GECOS_OID       "1.2.840.113556.1.4.7000.187.97"
-#define ADS_ATTR_SFU20_UID_OID          "1.2.840.113556.1.4.7000.187.102"
-
-
-/* ldap attribute oids (RFC2307) */
-#define ADS_ATTR_RFC2307_UIDNUMBER_OID "1.3.6.1.1.1.1.0"
-#define ADS_ATTR_RFC2307_GIDNUMBER_OID "1.3.6.1.1.1.1.1"
-#define ADS_ATTR_RFC2307_HOMEDIR_OID   "1.3.6.1.1.1.1.3"
-#define ADS_ATTR_RFC2307_SHELL_OID     "1.3.6.1.1.1.1.4"
-#define ADS_ATTR_RFC2307_GECOS_OID     "1.3.6.1.1.1.1.2"
-#define ADS_ATTR_RFC2307_UID_OID        "0.9.2342.19200300.100.1.1"
-
 /* ldap bitwise searches */
 #define ADS_LDAP_MATCHING_RULE_BIT_AND "1.2.840.113556.1.4.803"
 #define ADS_LDAP_MATCHING_RULE_BIT_OR  "1.2.840.113556.1.4.804"
index 08a6ba79749cf62481c0d543ba1b32b29d729a79..135820f1ce98bb94546bea2a8ec53a65a2d2f8f9 100644 (file)
@@ -1938,23 +1938,6 @@ bool get_local_printer_publishing_data(TALLOC_CTX *mem_ctx,
                                       ADS_MODLIST *mods,
                                       NT_PRINTER_DATA *data);
 
-/* The following definitions come from libads/ldap_schema.c  */
-
-ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
-                                    const char *schema_path,
-                                    const char **OIDs, size_t num_OIDs, 
-                                    char ***OIDs_out, char ***names, size_t *count);
-const char *ads_get_attrname_by_guid(ADS_STRUCT *ads, 
-                                    const char *schema_path, 
-                                    TALLOC_CTX *mem_ctx, 
-                                    const struct GUID *schema_guid);
-const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, const char *schema_path, TALLOC_CTX *mem_ctx, const char * OID);
-ADS_STATUS ads_schema_path(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char **schema_path);
-ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
-                                         ADS_STRUCT *ads,
-                                         enum wb_posix_mapping map_type,
-                                         struct posix_schema **s ) ;
-
 /* The following definitions come from libads/ldap_user.c  */
 
 ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user, 
index 89baaf2bdec19d8ca240125267ea3435066bd29d..d05b5085f044852f1e26dad74d6e954fc6f9fbc4 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "libads/ldap_schema.h"
 
 /* for ADS */
 #define SEC_RIGHTS_FULL_CTRL           0xf01ff
index a841fbdca816ba3b9c30cdcf2fc2d30ac38a4059..c739286abbdc0c881120a968ff4c4b798261f2b5 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "libads/ldap_schema.h"
 
 #ifdef HAVE_LDAP
 
diff --git a/source3/libads/ldap_schema.h b/source3/libads/ldap_schema.h
new file mode 100644 (file)
index 0000000..90ce203
--- /dev/null
@@ -0,0 +1,62 @@
+/* used to remember the names of the posix attributes in AD */
+/* see the rfc2307 & sfu nss backends */
+
+struct posix_schema {
+       char *posix_homedir_attr;
+       char *posix_shell_attr;
+       char *posix_uidnumber_attr;
+       char *posix_gidnumber_attr;
+       char *posix_gecos_attr;
+       char *posix_uid_attr;
+};
+
+/* ldap attribute oids (Services for Unix 3.0, 3.5) */
+#define ADS_ATTR_SFU_UIDNUMBER_OID     "1.2.840.113556.1.6.18.1.310"
+#define ADS_ATTR_SFU_GIDNUMBER_OID     "1.2.840.113556.1.6.18.1.311"
+#define ADS_ATTR_SFU_HOMEDIR_OID       "1.2.840.113556.1.6.18.1.344"
+#define ADS_ATTR_SFU_SHELL_OID                 "1.2.840.113556.1.6.18.1.312"
+#define ADS_ATTR_SFU_GECOS_OID                 "1.2.840.113556.1.6.18.1.337"
+#define ADS_ATTR_SFU_UID_OID            "1.2.840.113556.1.6.18.1.309"
+
+/* ldap attribute oids (Services for Unix 2.0) */
+#define ADS_ATTR_SFU20_UIDNUMBER_OID   "1.2.840.113556.1.4.7000.187.70"
+#define ADS_ATTR_SFU20_GIDNUMBER_OID   "1.2.840.113556.1.4.7000.187.71"
+#define ADS_ATTR_SFU20_HOMEDIR_OID     "1.2.840.113556.1.4.7000.187.106"
+#define ADS_ATTR_SFU20_SHELL_OID       "1.2.840.113556.1.4.7000.187.72"
+#define ADS_ATTR_SFU20_GECOS_OID       "1.2.840.113556.1.4.7000.187.97"
+#define ADS_ATTR_SFU20_UID_OID          "1.2.840.113556.1.4.7000.187.102"
+
+
+/* ldap attribute oids (RFC2307) */
+#define ADS_ATTR_RFC2307_UIDNUMBER_OID "1.3.6.1.1.1.1.0"
+#define ADS_ATTR_RFC2307_GIDNUMBER_OID "1.3.6.1.1.1.1.1"
+#define ADS_ATTR_RFC2307_HOMEDIR_OID   "1.3.6.1.1.1.1.3"
+#define ADS_ATTR_RFC2307_SHELL_OID     "1.3.6.1.1.1.1.4"
+#define ADS_ATTR_RFC2307_GECOS_OID     "1.3.6.1.1.1.1.2"
+#define ADS_ATTR_RFC2307_UID_OID        "0.9.2342.19200300.100.1.1"
+
+enum wb_posix_mapping {
+       WB_POSIX_MAP_UNKNOWN    = -1,
+       WB_POSIX_MAP_TEMPLATE   = 0,
+       WB_POSIX_MAP_SFU        = 1,
+       WB_POSIX_MAP_SFU20      = 2,
+       WB_POSIX_MAP_RFC2307    = 3,
+       WB_POSIX_MAP_UNIXINFO   = 4
+};
+
+/* The following definitions come from libads/ldap_schema.c  */
+
+ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
+                                    const char *schema_path,
+                                    const char **OIDs, size_t num_OIDs,
+                                    char ***OIDs_out, char ***names, size_t *count);
+const char *ads_get_attrname_by_guid(ADS_STRUCT *ads,
+                                    const char *schema_path,
+                                    TALLOC_CTX *mem_ctx,
+                                    const struct GUID *schema_guid);
+const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, const char *schema_path, TALLOC_CTX *mem_ctx, const char * OID);
+ADS_STATUS ads_schema_path(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char **schema_path);
+ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
+                                         ADS_STRUCT *ads,
+                                         enum wb_posix_mapping map_type,
+                                         struct posix_schema **s ) ;
index 55d571704d7bc659e50890e537dc22a8d216ca65..6f46f70436302efeadc8e8650a14c7f42e099f48 100644 (file)
@@ -28,6 +28,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "../libds/common/flags.h"
+#include "libads/ldap_schema.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP