s3-idmap: only include idmap headers where needed.
authorGünther Deschner <gd@samba.org>
Wed, 18 Aug 2010 16:13:42 +0000 (18:13 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 25 Aug 2010 22:20:29 +0000 (00:20 +0200)
Guenther

33 files changed:
source3/include/idmap.h
source3/include/includes.h
source3/include/proto.h
source3/include/smb.h
source3/lib/idmap_cache.c
source3/lib/idmap_cache.h [new file with mode: 0644]
source3/passdb/lookup_sid.c
source3/passdb/pdb_ldap.c
source3/utils/net_idmap.c
source3/winbindd/idmap.c
source3/winbindd/idmap_ad.c
source3/winbindd/idmap_adex/cell_util.c
source3/winbindd/idmap_adex/domain_util.c
source3/winbindd/idmap_adex/gc_util.c
source3/winbindd/idmap_adex/idmap_adex.c
source3/winbindd/idmap_adex/likewise_cell.c
source3/winbindd/idmap_adex/provider_unified.c
source3/winbindd/idmap_hash/idmap_hash.c
source3/winbindd/idmap_hash/mapfile.c
source3/winbindd/idmap_ldap.c
source3/winbindd/idmap_nss.c
source3/winbindd/idmap_passdb.c
source3/winbindd/idmap_proto.h [new file with mode: 0644]
source3/winbindd/idmap_rid.c
source3/winbindd/idmap_tdb.c
source3/winbindd/idmap_tdb2.c
source3/winbindd/idmap_util.c
source3/winbindd/wb_gid2sid.c
source3/winbindd/wb_sid2gid.c
source3/winbindd/wb_sid2uid.c
source3/winbindd/wb_uid2sid.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_dual_srv.c

index aab41cd7d3332cfc0226cd6f43d1c1733f3db827..8a1da81e3972e674c8649d58520413df7b3286cd 100644 (file)
@@ -30,6 +30,8 @@
 
 #define SMB_IDMAP_INTERFACE_VERSION 5
 
+#include "librpc/gen_ndr/idmap.h"
+
 struct idmap_domain {
        const char *name;
        struct idmap_methods *methods;
@@ -60,4 +62,6 @@ struct idmap_methods {
        NTSTATUS (*close_fn)(struct idmap_domain *dom);
 };
 
+#include "winbindd/idmap_proto.h"
+
 #endif /* _IDMAP_H_ */
index d409a354a12f54b31e148088ca78bc1511bb67ce..e65ea437ed69c73f7f3bc83cb074795bf5efb69a 100644 (file)
@@ -653,7 +653,6 @@ struct ntlmssp_state;
 #include "auth.h"
 #include "ntdomain.h"
 #include "librpc/rpc/dcerpc.h"
-#include "idmap.h"
 #include "client.h"
 
 #include "session.h"
index 7728af3ff5e4f84bccf81449a416c3dc21585587..87b2e275ad3dfcd2e8a3bb82ef43d9655d434115 100644 (file)
@@ -5653,55 +5653,6 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp);
 char *stdin_new_passwd( void);
 char *get_pass( const char *prompt, bool stdin_get);
 
-/* The following definitions come from winbindd/idmap.c  */
-
-bool idmap_is_offline(void);
-bool idmap_is_online(void);
-NTSTATUS smb_register_idmap(int version, const char *name,
-                           struct idmap_methods *methods);
-void idmap_close(void);
-NTSTATUS idmap_init_cache(void);
-NTSTATUS idmap_allocate_uid(struct unixid *id);
-NTSTATUS idmap_allocate_gid(struct unixid *id);
-NTSTATUS idmap_backends_unixid_to_sid(const char *domname,
-                                     struct id_map *id);
-NTSTATUS idmap_backends_sid_to_unixid(const char *domname,
-                                     struct id_map *id);
-NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
-                          struct unixid *pxid);
-
-/* The following definitions come from winbindd/idmap_cache.c  */
-
-bool idmap_cache_find_sid2uid(const struct dom_sid *sid, uid_t *puid,
-                             bool *expired);
-bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired);
-void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid);
-bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid,
-                             bool *expired);
-bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired);
-void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid);
-
-
-/* The following definitions come from winbindd/idmap_nss.c  */
-
-NTSTATUS idmap_nss_init(void);
-
-/* The following definitions come from winbindd/idmap_passdb.c  */
-
-NTSTATUS idmap_passdb_init(void);
-
-/* The following definitions come from winbindd/idmap_tdb.c  */
-
-NTSTATUS idmap_tdb_init(void);
-
-/* The following definitions come from winbindd/idmap_util.c  */
-
-NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid);
-NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid);
-NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid);
-NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid);
-bool idmap_unix_id_is_in_range(uint32_t id, struct idmap_domain *dom);
-
 /* The following definitions come from winbindd/nss_info.c  */
 
 
index 05a02637bdd0744f6f77967ed26e326a372f205a..74f1eb535ad1bdabd771becf9cb45fca1c362c07 100644 (file)
@@ -174,7 +174,6 @@ typedef union unid_t {
                                        |LOOKUP_NAME_WKN\
                                        |LOOKUP_NAME_DOMAIN)
 
-#include "librpc/gen_ndr/idmap.h"
 #include "librpc/gen_ndr/epmapper.h"
 #include "librpc/gen_ndr/dcerpc.h"
 
index 6377635a6563b3c7088e5743aadaa8660d1ac6ba..bf72d91efed0c2b98cb9d2dc550d93a77bc8556b 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.*/
 
 #include "includes.h"
+#include "idmap_cache.h"
 
 /**
  * Find a sid2uid mapping
diff --git a/source3/lib/idmap_cache.h b/source3/lib/idmap_cache.h
new file mode 100644 (file)
index 0000000..f511780
--- /dev/null
@@ -0,0 +1,10 @@
+/* The following definitions come from lib/idmap_cache.c  */
+
+bool idmap_cache_find_sid2uid(const struct dom_sid *sid, uid_t *puid,
+                             bool *expired);
+bool idmap_cache_find_uid2sid(uid_t uid, struct dom_sid *sid, bool *expired);
+void idmap_cache_set_sid2uid(const struct dom_sid *sid, uid_t uid);
+bool idmap_cache_find_sid2gid(const struct dom_sid *sid, gid_t *pgid,
+                             bool *expired);
+bool idmap_cache_find_gid2sid(gid_t gid, struct dom_sid *sid, bool *expired);
+void idmap_cache_set_sid2gid(const struct dom_sid *sid, gid_t gid);
index a93145330b21b0b87215d986d035059f881974c2..0e2385f43fdb492a6eb1ea79dce4fd7e0f35d5ef 100644 (file)
@@ -23,6 +23,7 @@
 #include "../librpc/gen_ndr/ndr_security.h"
 #include "secrets.h"
 #include "memcache.h"
+#include "idmap_cache.h"
 
 /*****************************************************************
  Dissect a user-provided name into domain, name, sid and type.
index ef695f1c1a2bac5a0fe45b2aaac90179183594ea..e3dedcd06ed237dab341fe763c0f86e25369db9a 100644 (file)
@@ -46,6 +46,7 @@
 #include "includes.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "secrets.h"
+#include "idmap_cache.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_PASSDB
index cd3a68db3cfc1f946f4a9ed4a967e24307d31a63..8bcb79fabf0146895224c4c74a0fd701eed597ce 100644 (file)
@@ -21,6 +21,7 @@
 #include "includes.h"
 #include "utils/net.h"
 #include "secrets.h"
+#include "idmap.h"
 
 #define ALLOC_CHECK(mem) do { \
        if (!mem) { \
index 2a4e2a5a43542c1d532edda7c5cc8f13dfc3d66b..102f4ebb7fca7f80eba0c2877962765c206a4bb4 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "idmap.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
index a690fb2b3661f0cc68394e38905bf7255b574ee1..3d47baadc9fa4c178ec8f0726b0aa604a754257c 100644 (file)
@@ -32,6 +32,7 @@
 #include "libads/ldap_schema.h"
 #include "nss_info.h"
 #include "secrets.h"
+#include "idmap.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
index c32bb9179d5e5c81e5bf588bd228ae477fc568c3..c82407c0f4808eda6202df9963608dcbd782bcf8 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 #include "../libds/common/flags.h"
 
index 72643e97da4323e782ec2814e947d33f70d19c28..c373106446993ba62e9a37979a64b2ac840faada 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 
 #undef DBGC_CLASS
index 339234dfaff7277fe8a31efa7d80debdb34322ef..56bd9542f6682976d82a53969093bf319cdbcaa5 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 #include "libads/cldap.h"
 
index 5e55df357e6b311ea277dd74f69267d717dd1917..0902d5547020a218981ed5a050b0f2980ecffa4e 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 #include "nss_info.h"
 #include "secrets.h"
index 3e529b427a4e830ece3f391c8c9ecda82a0398f3..00ccc597bb0dfbd8bef64a16637b29afbacf7950 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 #include "secrets.h"
 
index 999615ca3c222599c87d4607da4fc88563f4cd72..191f77159cefc5f5e5f078d5be2949d947d4733a 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "ads.h"
+#include "idmap.h"
 #include "idmap_adex.h"
 
 #undef DBGC_CLASS
index ed55cd5dd4988e701e6c8841dc20881614126aa7..f6c86524635192f7dbf59d8dff08e63debdf1153 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "winbindd/winbindd.h"
+#include "idmap.h"
 #include "idmap_hash.h"
 #include "ads.h"
 #include "nss_info.h"
index 5ab1142ffe0182e63e1988f5f5765cd0e165decc..199dded87f2aadafb14ec0e9756429fbeeeb4215 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "winbindd/winbindd.h"
+#include "idmap.h"
 #include "idmap_hash.h"
 #include <stdio.h>
 
index 51915002b52010f42b2223760dad5d0b6b6eba80..39df489be7b15563d948b4da3a79a808b5a64951 100644 (file)
@@ -26,6 +26,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "secrets.h"
+#include "idmap.h"
 #include "idmap_rw.h"
 
 #undef DBGC_CLASS
index 40adef29b852ca0868422b166399deb2eac3e6fc..ac5dd797fac784464d3103148ea0131af29b2628 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "nsswitch/winbind_client.h"
+#include "idmap.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
index 4dcf74416c94ee1e790a4bb4bc2aaf940c9c0eec..ece1b42122caeecae58533db18130c389ca43638 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "idmap.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
diff --git a/source3/winbindd/idmap_proto.h b/source3/winbindd/idmap_proto.h
new file mode 100644 (file)
index 0000000..42900a6
--- /dev/null
@@ -0,0 +1,36 @@
+/* The following definitions come from winbindd/idmap.c  */
+
+bool idmap_is_offline(void);
+bool idmap_is_online(void);
+NTSTATUS smb_register_idmap(int version, const char *name,
+                           struct idmap_methods *methods);
+void idmap_close(void);
+NTSTATUS idmap_init_cache(void);
+NTSTATUS idmap_allocate_uid(struct unixid *id);
+NTSTATUS idmap_allocate_gid(struct unixid *id);
+NTSTATUS idmap_backends_unixid_to_sid(const char *domname,
+                                     struct id_map *id);
+NTSTATUS idmap_backends_sid_to_unixid(const char *domname,
+                                     struct id_map *id);
+NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
+                          struct unixid *pxid);
+
+/* The following definitions come from winbindd/idmap_nss.c  */
+
+NTSTATUS idmap_nss_init(void);
+
+/* The following definitions come from winbindd/idmap_passdb.c  */
+
+NTSTATUS idmap_passdb_init(void);
+
+/* The following definitions come from winbindd/idmap_tdb.c  */
+
+NTSTATUS idmap_tdb_init(void);
+
+/* The following definitions come from winbindd/idmap_util.c  */
+
+NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid);
+NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid);
+NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid);
+NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid);
+bool idmap_unix_id_is_in_range(uint32_t id, struct idmap_domain *dom);
index 6e948025d2897db2e4c7319973affd3868a5f5a4..982c4fde69c9b515adb165e7da0e178abb0c0b0b 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "idmap.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
index d00ffbe90113ff1cc1b7c0a3b4d0b226d4845060..d04541fc2482d2119e3da846dddbe1b1f0d45ba9 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "idmap.h"
 #include "idmap_rw.h"
 
 #undef DBGC_CLASS
index d30b105ba012f0d1f52c95a6b37aa1a48a47add4..77ebbebc662e60f55e87a2756aaaf4a9b7dcb26f 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "idmap.h"
 #include "idmap_rw.h"
 
 #undef DBGC_CLASS
index 3afe9f8607bdc2c7ba152b1b15ef4fdee6831732..d743f8ce23f014f32594dda464c301f1bc27cb92 100644 (file)
@@ -20,6 +20,8 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "winbindd_proto.h"
+#include "idmap.h"
+#include "idmap_cache.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_IDMAP
index 0937590a528c9f4f12047e0dd0bae34705abb983..d4416f1a76db46e583c99eefe64b82df9b8fc288 100644 (file)
@@ -20,6 +20,8 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "librpc/gen_ndr/cli_wbint.h"
+#include "idmap_cache.h"
+#include "idmap.h"
 
 struct wb_gid2sid_state {
        struct tevent_context *ev;
index 4d76d6929795a07b549005cef36511552ca4c97b..15cf394e2f7d5608662469ff1e43db0cd4def6cd 100644 (file)
@@ -20,6 +20,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "librpc/gen_ndr/cli_wbint.h"
+#include "idmap_cache.h"
 
 struct wb_sid2gid_state {
        struct tevent_context *ev;
index 86bf5d4641881a3c7c338eaddb0bbbe5f5234d13..51c70c57154166eab7f03874a14771d91dc4d473 100644 (file)
@@ -20,6 +20,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "librpc/gen_ndr/cli_wbint.h"
+#include "idmap_cache.h"
 
 struct wb_sid2uid_state {
        struct tevent_context *ev;
index 9e86fd5a01468506ef9695ae85d833e1b5b2350d..857066844c18a8dd1fce35a1cb1e23dd3992a1db 100644 (file)
@@ -20,6 +20,8 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "librpc/gen_ndr/cli_wbint.h"
+#include "idmap_cache.h"
+#include "idmap.h"
 
 struct wb_uid2sid_state {
        struct tevent_context *ev;
index 966ebadaea04e49461ded8e321b48c5ce1dbb58d..4163230a95d29355da802189957b445c7b503898 100644 (file)
@@ -31,6 +31,7 @@
 #include "../librpc/gen_ndr/srv_lsa.h"
 #include "../librpc/gen_ndr/srv_samr.h"
 #include "secrets.h"
+#include "idmap.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
index 706b691da8bbbc6244e3d09223e3f7dbae62695b..4c6fb97e7092852aafeda7a7b42b5cdb1bd22fef 100644 (file)
@@ -25,6 +25,7 @@
 #include "winbindd/winbindd_proto.h"
 #include "librpc/gen_ndr/srv_wbint.h"
 #include "../librpc/gen_ndr/cli_netlogon.h"
+#include "idmap.h"
 
 void _wbint_Ping(struct pipes_struct *p, struct wbint_Ping *r)
 {