s3: avoid global include of ads.h.
authorGünther Deschner <gd@samba.org>
Thu, 1 Jul 2010 22:32:52 +0000 (00:32 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 4 Aug 2010 22:32:02 +0000 (00:32 +0200)
Guenther

56 files changed:
libgpo/gpo.h
source3/Makefile.in
source3/include/ads.h
source3/include/includes.h
source3/include/proto.h
source3/include/smb_krb5.h
source3/include/smbldap.h
source3/lib/netapi/joindomain.c
source3/lib/smbldap.c
source3/libads/ads_proto.h [new file with mode: 0644]
source3/libads/ads_struct.c
source3/libads/ads_utils.c
source3/libads/authdata.c
source3/libads/disp_sec.c
source3/libads/kerberos.c
source3/libads/kerberos_keytab.c
source3/libads/kerberos_proto.h [new file with mode: 0644]
source3/libads/kerberos_util.c [new file with mode: 0644]
source3/libads/kerberos_verify.c
source3/libads/krb5_setpw.c
source3/libads/ldap.c
source3/libads/ldap_printer.c
source3/libads/ldap_schema.c
source3/libads/ldap_user.c
source3/libads/ldap_utils.c
source3/libads/ndr.c
source3/libads/sasl.c
source3/libads/sasl_wrapping.c
source3/libads/util.c
source3/libnet/libnet_join.c
source3/libsmb/cliconnect.c
source3/libsmb/namequery_dc.c
source3/param/loadparm.c
source3/smbd/sesssetup.c
source3/smbd/smb2_sesssetup.c
source3/utils/net_ads.c
source3/utils/net_ads_gpo.c
source3/utils/net_proto.h
source3/utils/ntlm_auth.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/nss_info.c
source3/winbindd/nss_info_template.c
source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_cred_cache.c
source3/winbindd/winbindd_pam.c
source3/winbindd/winbindd_proto.h
source3/wscript_build

index 6e71e3cff7df8b8573d208a314151d52e7eaabc3..ba9e0b79627d4b1177d2bec9fb63c2560670411f 100644 (file)
@@ -24,6 +24,7 @@
 #include "source4/libgpo/ads_convenience.h"
 #else
 struct loadparm_context;
+#include "ads.h"
 #endif
 
 enum GPO_LINK_TYPE {
index 128ff8c4b6b393c3bc68782d306b12573759c4d0..af26549eb44066330659a1a92f9f87b2b486ad57 100644 (file)
@@ -456,7 +456,9 @@ LIBGPO_OBJ = $(LIBGPO_OBJ0)
 
 LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o \
             libads/sasl.o libads/sasl_wrapping.o \
-            libads/krb5_setpw.o libads/ldap_user.o \
+            libads/krb5_setpw.o \
+            libads/kerberos_util.o \
+            libads/ldap_user.o \
             libads/ads_struct.o libads/kerberos_keytab.o \
              libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o \
             libads/ldap_schema.o libads/util.o libads/ndr.o
index 0637cc8ad4b483b457e6de5a7a20d96d292f9d9c..b45d53de0797ba6ffac6e769c94950ccbcb6475c 100644 (file)
@@ -148,6 +148,12 @@ typedef struct {
        int critical;
 } ads_control;
 
-#define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore"
+#include "libads/ads_proto.h"
+
+#ifdef HAVE_LDAP
+#include "libads/ads_ldap_protos.h"
+#endif
+
+#include "libads/kerberos_proto.h"
 
 #endif /* _INCLUDE_ADS_H_ */
index 2573585f6edfdd996ec7c68ecdcee567fc74ebbe..35686e9f313fe218725c76b7dbf4e5ecfd71bae6 100644 (file)
@@ -628,7 +628,6 @@ extern void *cmdline_lp_ctx;
 
 #include "krb5_env.h"
 #include "libads/ads_status.h"
-#include "ads.h"
 #include "interfaces.h"
 #include "trans2.h"
 #include "../libcli/util/error.h"
@@ -736,10 +735,6 @@ enum flush_reason_enum {
 #include "modules/vfs_irixacl.h"
 #endif
 
-#ifdef HAVE_LDAP
-#include "libads/ads_ldap_protos.h"
-#endif
-
 /* We need this after proto.h to reference GetTimeOfDay(). */
 #include "smbprofile.h"
 
index f9684ad16ee2db25154d1201e90d5da894c38b04..9fd91b4724ccffc363506a331545645c7937c749 100644 (file)
@@ -1727,244 +1727,6 @@ void wins_srv_tags_free(char **list);
 struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip);
 unsigned wins_srv_count_tag(const char *tag);
 
-/* The following definitions come from libads/ads_struct.c  */
-
-char *ads_build_path(const char *realm, const char *sep, const char *field, int reverse);
-char *ads_build_dn(const char *realm);
-char *ads_build_domain(const char *dn);
-ADS_STRUCT *ads_init(const char *realm, 
-                    const char *workgroup,
-                    const char *ldap_server);
-bool ads_set_sasl_wrap_flags(ADS_STRUCT *ads, int flags);
-void ads_destroy(ADS_STRUCT **ads);
-
-const char *ads_get_ldap_server_name(ADS_STRUCT *ads);
-
-/* The following definitions come from libads/authdata.c  */
-
-NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
-                            const char *name,
-                            const char *pass,
-                            time_t time_offset,
-                            time_t *expire_time,
-                            time_t *renew_till_time,
-                            const char *cache_name,
-                            bool request_pac,
-                            bool add_netbios_addr,
-                            time_t renewable_time,
-                            const char *impersonate_princ_s,
-                            struct PAC_LOGON_INFO **logon_info);
-
-/* The following definitions come from libads/disp_sec.c  */
-
-void ads_disp_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct security_descriptor *sd);
-
-/* The following definitions come from libads/kerberos.c  */
-
-int kerberos_kinit_password_ext(const char *principal,
-                               const char *password,
-                               int time_offset,
-                               time_t *expire_time,
-                               time_t *renew_till_time,
-                               const char *cache_name,
-                               bool request_pac,
-                               bool add_netbios_addr,
-                               time_t renewable_time,
-                               NTSTATUS *ntstatus);
-int ads_kinit_password(ADS_STRUCT *ads);
-int ads_kdestroy(const char *cc_name);
-char* kerberos_standard_des_salt( void );
-bool kerberos_secrets_store_des_salt( const char* salt );
-char* kerberos_secrets_fetch_des_salt( void );
-char *kerberos_get_default_realm_from_ccache( void );
-char *kerberos_get_realm_from_hostname(const char *hostname);
-
-bool kerberos_secrets_store_salting_principal(const char *service,
-                                             int enctype,
-                                             const char *principal);
-int kerberos_kinit_password(const char *principal,
-                           const char *password,
-                           int time_offset,
-                           const char *cache_name);
-bool create_local_private_krb5_conf_for_domain(const char *realm,
-                                               const char *domain,
-                                               const char *sitename,
-                                               struct sockaddr_storage *pss,
-                                               const char *kdc_name);
-
-/* The following definitions come from libads/kerberos_keytab.c  */
-
-int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc);
-int ads_keytab_flush(ADS_STRUCT *ads);
-int ads_keytab_create_default(ADS_STRUCT *ads);
-int ads_keytab_list(const char *keytab_name);
-
-/* The following definitions come from libads/kerberos_verify.c  */
-
-NTSTATUS ads_verify_ticket(TALLOC_CTX *mem_ctx,
-                          const char *realm,
-                          time_t time_offset,
-                          const DATA_BLOB *ticket,
-                          char **principal,
-                          struct PAC_LOGON_INFO **logon_info,
-                          DATA_BLOB *ap_rep,
-                          DATA_BLOB *session_key,
-                          bool use_replay_cache);
-
-/* The following definitions come from libads/krb5_errs.c  */
-
-
-/* The following definitions come from libads/krb5_setpw.c  */
-
-ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ, 
-                                const char *newpw, int time_offset);
-ADS_STATUS kerberos_set_password(const char *kpasswd_server, 
-                                const char *auth_principal, const char *auth_password,
-                                const char *target_principal, const char *new_password,
-                                int time_offset);
-ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
-                                   const char *machine_account,
-                                   const char *password);
-
-/* The following definitions come from libads/ldap.c  */
-
-bool ads_sitename_match(ADS_STRUCT *ads);
-bool ads_closest_dc(ADS_STRUCT *ads);
-ADS_STATUS ads_connect(ADS_STRUCT *ads);
-ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
-ADS_STATUS ads_connect_gc(ADS_STRUCT *ads);
-void ads_disconnect(ADS_STRUCT *ads);
-ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
-                               int scope, const char *expr, const char **attrs,
-                               bool (*fn)(ADS_STRUCT *, char *, void **, void *), 
-                               void *data_area);
-char *ads_parent_dn(const char *dn);
-ADS_MODLIST ads_init_mods(TALLOC_CTX *ctx);
-ADS_STATUS ads_mod_str(TALLOC_CTX *ctx, ADS_MODLIST *mods, 
-                      const char *name, const char *val);
-ADS_STATUS ads_mod_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
-                          const char *name, const char **vals);
-ADS_STATUS ads_gen_mod(ADS_STRUCT *ads, const char *mod_dn, ADS_MODLIST mods);
-ADS_STATUS ads_gen_add(ADS_STRUCT *ads, const char *new_dn, ADS_MODLIST mods);
-ADS_STATUS ads_del_dn(ADS_STRUCT *ads, char *del_dn);
-char *ads_ou_string(ADS_STRUCT *ads, const char *org_unit);
-char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid);
-ADS_STATUS ads_add_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
-                               const char *name, const char **vals);
-uint32 ads_get_kvno(ADS_STRUCT *ads, const char *account_name);
-uint32_t ads_get_machine_kvno(ADS_STRUCT *ads, const char *machine_name);
-ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machine_name);
-ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_name, 
-                                          const char *my_fqdn, const char *spn);
-ADS_STATUS ads_create_machine_acct(ADS_STRUCT *ads, const char *machine_name, 
-                                   const char *org_unit);
-ADS_STATUS ads_move_machine_acct(ADS_STRUCT *ads, const char *machine_name, 
-                                 const char *org_unit, bool *moved);
-int ads_count_replies(ADS_STRUCT *ads, void *res);
-ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn);
-ADS_STATUS ads_current_time(ADS_STRUCT *ads);
-ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32 *val);
-ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, struct dom_sid *sid);
-ADS_STATUS ads_site_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char **site_name);
-ADS_STATUS ads_site_dn_for_machine(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *computer_name, const char **site_dn);
-ADS_STATUS ads_upn_suffixes(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char ***suffixes, size_t *num_suffixes);
-ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
-                               TALLOC_CTX *mem_ctx,
-                               char ***ous,
-                               size_t *num_ous);
-ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx,
-                                       const char *extended_dn,
-                                       enum ads_extended_dn_flags flags,
-                                       struct dom_sid *sid);
-char* ads_get_dnshostname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
-char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
-char* ads_get_samaccountname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
-ADS_STATUS ads_join_realm(ADS_STRUCT *ads, const char *machine_name,
-                       uint32 account_type, const char *org_unit);
-ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname);
-ADS_STATUS ads_find_samaccount(ADS_STRUCT *ads,
-                              TALLOC_CTX *mem_ctx,
-                              const char *samaccountname,
-                              uint32 *uac_ret,
-                              const char **dn_ret);
-ADS_STATUS ads_config_path(ADS_STRUCT *ads, 
-                          TALLOC_CTX *mem_ctx, 
-                          char **config_path);
-const char *ads_get_extended_right_name_by_guid(ADS_STRUCT *ads, 
-                                               const char *config_path, 
-                                               TALLOC_CTX *mem_ctx, 
-                                               const struct GUID *rights_guid);
-ADS_STATUS ads_check_ou_dn(TALLOC_CTX *mem_ctx,
-                          ADS_STRUCT *ads,
-                          const char **account_ou);
-
-/* The following definitions come from libads/ldap_printer.c  */
-
-ADS_STATUS ads_mod_printer_entry(ADS_STRUCT *ads, char *prt_dn,
-                                TALLOC_CTX *ctx, const ADS_MODLIST *mods);
-ADS_STATUS ads_add_printer_entry(ADS_STRUCT *ads, char *prt_dn,
-                                       TALLOC_CTX *ctx, ADS_MODLIST *mods);
-WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli, 
-                                         TALLOC_CTX *mem_ctx,
-                                         ADS_MODLIST *mods,
-                                         const char *printer);
-
-/* The following definitions come from libads/ldap_user.c  */
-
-ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user, 
-                            const char *container, const char *fullname);
-ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group, 
-                             const char *container, const char *comment);
-
-/* The following definitions come from libads/ldap_utils.c  */
-
-ADS_STATUS ads_ranged_search(ADS_STRUCT *ads, 
-                            TALLOC_CTX *mem_ctx,
-                            int scope,
-                            const char *base,
-                            const char *filter,
-                            void *args,
-                            const char *range_attr,
-                            char ***strings,
-                            size_t *num_strings);
-ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads, 
-                                     TALLOC_CTX *mem_ctx,
-                                     int scope,
-                                     const char *base,
-                                     const char *filter,
-                                     const char **attrs,
-                                     void *args,
-                                     const char *range_attr,
-                                     char ***strings,
-                                     size_t *num_strings,
-                                     uint32 *first_usn,
-                                     int *num_retries,
-                                     bool *more_values);
-
-/* The following definitions come from libads/ndr.c  */
-
-void ndr_print_ads_auth_flags(struct ndr_print *ndr, const char *name, uint32_t r);
-void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct ads_struct *r);
-
-/* The following definitions come from libads/sasl.c  */
-
-ADS_STATUS ads_sasl_bind(ADS_STRUCT *ads);
-
-/* The following definitions come from libads/sasl_wrapping.c  */
-
-ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads,
-                                  const struct ads_saslwrap_ops *ops,
-                                  void *private_data);
-ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads,
-                                  const struct ads_saslwrap_ops *ops,
-                                  void *private_data);
-
-/* The following definitions come from libads/util.c  */
-
-ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_principal);
-ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads,
-                                      char **returned_principal);
-
 /* The following definitions come from librpc/ndr/util.c  */
 
 enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
index 3e5c86268a98e930d1f556595782280212beba6f..35cc047868b5c28f53628ea1268f6c47e22544d1 100644 (file)
@@ -4,6 +4,8 @@
 #define KRB5_PRIVATE    1       /* this file uses PRIVATE interfaces! */
 /* this file uses DEPRECATED interfaces! */
 
+#define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore"
+
 #if defined(HAVE_KRB5_DEPRECATED_WITH_IDENTIFIER)
 #define KRB5_DEPRECATED 1
 #else
index f2a028046df1c45d22d88a180dcfd903cc0b5c25..69b4153f28000250251bf8a5cef88782ae227184 100644 (file)
@@ -247,4 +247,10 @@ struct ldapsam_privates;
 #define LDAP_CONNECTION_DEFAULT_TIMEOUT 2
 #define LDAP_PAGE_SIZE 1024
 
+#ifndef LDAP_OPT_SUCCESS
+#define LDAP_OPT_SUCCESS 0
+#endif
+
+#define ADS_PAGE_CTL_OID       "1.2.840.113556.1.4.319"
+
 #endif /* _SMBLDAP_H */
index 336f9dc7833787d9314f942e62cb6b2c163b1ace..94de573395c04a1be49c51cbb9e95160accbed6a 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #include "includes.h"
-
+#include "ads.h"
 #include "librpc/gen_ndr/libnetapi.h"
 #include "lib/netapi/netapi.h"
 #include "lib/netapi/netapi_private.h"
index a4d26fa8b66042381a80e1aff7180f3bb6d9bd13..b1571536eb02ab701b0ab4c7020cf59c730fdc55 100644 (file)
 #include "includes.h"
 #include "smbldap.h"
 
-#ifndef LDAP_OPT_SUCCESS
-#define LDAP_OPT_SUCCESS 0
-#endif
-
 /* Try not to hit the up or down server forever */
 
 #define SMBLDAP_DONT_PING_TIME 10      /* ping only all 10 seconds */
diff --git a/source3/libads/ads_proto.h b/source3/libads/ads_proto.h
new file mode 100644 (file)
index 0000000..aedd23f
--- /dev/null
@@ -0,0 +1,171 @@
+/* The following definitions come from libads/ads_struct.c  */
+
+char *ads_build_path(const char *realm, const char *sep, const char *field, int reverse);
+char *ads_build_dn(const char *realm);
+char *ads_build_domain(const char *dn);
+ADS_STRUCT *ads_init(const char *realm,
+                    const char *workgroup,
+                    const char *ldap_server);
+bool ads_set_sasl_wrap_flags(ADS_STRUCT *ads, int flags);
+void ads_destroy(ADS_STRUCT **ads);
+
+const char *ads_get_ldap_server_name(ADS_STRUCT *ads);
+
+/* The following definitions come from libads/disp_sec.c  */
+
+void ads_disp_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, struct security_descriptor *sd);
+
+/* The following definitions come from libads/kerberos_keytab.c  */
+
+int ads_keytab_add_entry(ADS_STRUCT *ads, const char *srvPrinc);
+int ads_keytab_flush(ADS_STRUCT *ads);
+int ads_keytab_create_default(ADS_STRUCT *ads);
+int ads_keytab_list(const char *keytab_name);
+
+/* The following definitions come from libads/krb5_errs.c  */
+
+/* The following definitions come from libads/kerberos_util.c  */
+
+ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
+                                   const char *machine_account,
+                                   const char *password);
+int ads_kinit_password(ADS_STRUCT *ads);
+
+/* The following definitions come from libads/ldap.c  */
+
+bool ads_sitename_match(ADS_STRUCT *ads);
+bool ads_closest_dc(ADS_STRUCT *ads);
+ADS_STATUS ads_connect(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_user_creds(ADS_STRUCT *ads);
+ADS_STATUS ads_connect_gc(ADS_STRUCT *ads);
+void ads_disconnect(ADS_STRUCT *ads);
+ADS_STATUS ads_do_search_all_fn(ADS_STRUCT *ads, const char *bind_path,
+                               int scope, const char *expr, const char **attrs,
+                               bool (*fn)(ADS_STRUCT *, char *, void **, void *),
+                               void *data_area);
+char *ads_parent_dn(const char *dn);
+ADS_MODLIST ads_init_mods(TALLOC_CTX *ctx);
+ADS_STATUS ads_mod_str(TALLOC_CTX *ctx, ADS_MODLIST *mods,
+                      const char *name, const char *val);
+ADS_STATUS ads_mod_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
+                          const char *name, const char **vals);
+ADS_STATUS ads_gen_mod(ADS_STRUCT *ads, const char *mod_dn, ADS_MODLIST mods);
+ADS_STATUS ads_gen_add(ADS_STRUCT *ads, const char *new_dn, ADS_MODLIST mods);
+ADS_STATUS ads_del_dn(ADS_STRUCT *ads, char *del_dn);
+char *ads_ou_string(ADS_STRUCT *ads, const char *org_unit);
+char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid);
+ADS_STATUS ads_add_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
+                               const char *name, const char **vals);
+uint32 ads_get_kvno(ADS_STRUCT *ads, const char *account_name);
+uint32_t ads_get_machine_kvno(ADS_STRUCT *ads, const char *machine_name);
+ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machine_name);
+ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_name,
+                                          const char *my_fqdn, const char *spn);
+ADS_STATUS ads_create_machine_acct(ADS_STRUCT *ads, const char *machine_name,
+                                   const char *org_unit);
+ADS_STATUS ads_move_machine_acct(ADS_STRUCT *ads, const char *machine_name,
+                                 const char *org_unit, bool *moved);
+int ads_count_replies(ADS_STRUCT *ads, void *res);
+ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn);
+ADS_STATUS ads_current_time(ADS_STRUCT *ads);
+ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32 *val);
+ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, struct dom_sid *sid);
+ADS_STATUS ads_site_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char **site_name);
+ADS_STATUS ads_site_dn_for_machine(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *computer_name, const char **site_dn);
+ADS_STATUS ads_upn_suffixes(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char ***suffixes, size_t *num_suffixes);
+ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
+                               TALLOC_CTX *mem_ctx,
+                               char ***ous,
+                               size_t *num_ous);
+ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx,
+                                       const char *extended_dn,
+                                       enum ads_extended_dn_flags flags,
+                                       struct dom_sid *sid);
+char* ads_get_dnshostname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
+char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
+char* ads_get_samaccountname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name );
+ADS_STATUS ads_join_realm(ADS_STRUCT *ads, const char *machine_name,
+                       uint32 account_type, const char *org_unit);
+ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname);
+ADS_STATUS ads_find_samaccount(ADS_STRUCT *ads,
+                              TALLOC_CTX *mem_ctx,
+                              const char *samaccountname,
+                              uint32 *uac_ret,
+                              const char **dn_ret);
+ADS_STATUS ads_config_path(ADS_STRUCT *ads,
+                          TALLOC_CTX *mem_ctx,
+                          char **config_path);
+const char *ads_get_extended_right_name_by_guid(ADS_STRUCT *ads,
+                                               const char *config_path,
+                                               TALLOC_CTX *mem_ctx,
+                                               const struct GUID *rights_guid);
+ADS_STATUS ads_check_ou_dn(TALLOC_CTX *mem_ctx,
+                          ADS_STRUCT *ads,
+                          const char **account_ou);
+
+/* The following definitions come from libads/ldap_printer.c  */
+
+ADS_STATUS ads_mod_printer_entry(ADS_STRUCT *ads, char *prt_dn,
+                                TALLOC_CTX *ctx, const ADS_MODLIST *mods);
+ADS_STATUS ads_add_printer_entry(ADS_STRUCT *ads, char *prt_dn,
+                                       TALLOC_CTX *ctx, ADS_MODLIST *mods);
+WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
+                                         TALLOC_CTX *mem_ctx,
+                                         ADS_MODLIST *mods,
+                                         const char *printer);
+
+/* The following definitions come from libads/ldap_user.c  */
+
+ADS_STATUS ads_add_user_acct(ADS_STRUCT *ads, const char *user,
+                            const char *container, const char *fullname);
+ADS_STATUS ads_add_group_acct(ADS_STRUCT *ads, const char *group,
+                             const char *container, const char *comment);
+
+/* The following definitions come from libads/ldap_utils.c  */
+
+ADS_STATUS ads_ranged_search(ADS_STRUCT *ads,
+                            TALLOC_CTX *mem_ctx,
+                            int scope,
+                            const char *base,
+                            const char *filter,
+                            void *args,
+                            const char *range_attr,
+                            char ***strings,
+                            size_t *num_strings);
+ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
+                                     TALLOC_CTX *mem_ctx,
+                                     int scope,
+                                     const char *base,
+                                     const char *filter,
+                                     const char **attrs,
+                                     void *args,
+                                     const char *range_attr,
+                                     char ***strings,
+                                     size_t *num_strings,
+                                     uint32 *first_usn,
+                                     int *num_retries,
+                                     bool *more_values);
+
+/* The following definitions come from libads/ndr.c  */
+
+void ndr_print_ads_auth_flags(struct ndr_print *ndr, const char *name, uint32_t r);
+void ndr_print_ads_struct(struct ndr_print *ndr, const char *name, const struct ads_struct *r);
+
+/* The following definitions come from libads/sasl.c  */
+
+ADS_STATUS ads_sasl_bind(ADS_STRUCT *ads);
+
+/* The following definitions come from libads/sasl_wrapping.c  */
+
+ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads,
+                                  const struct ads_saslwrap_ops *ops,
+                                  void *private_data);
+ADS_STATUS ads_setup_sasl_wrapping(ADS_STRUCT *ads,
+                                  const struct ads_saslwrap_ops *ops,
+                                  void *private_data);
+
+/* The following definitions come from libads/util.c  */
+
+ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_principal);
+ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads,
+                                      char **returned_principal);
index e01a36cbaeb50608af50c311e211e3c5eb8d820e..7794952387e0a65c94703eb906df9dd833e172c7 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 
 /* return a ldap dn path from a string, given separators and field name
    caller must free
index 213242c223470be3abd4785ed581eeaab392b274..ec3efa85509eb8c1fee4cd2050ec0b698c5d3ff1 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 
 const char *ads_get_ldap_server_name(ADS_STRUCT *ads)
 {
index 00062f4457eb8140e1f06bf3f86a2bdf16e0276d..3c529dbe7a1ab2feca4a22464ed4e6b1b678159f 100644 (file)
@@ -25,6 +25,7 @@
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_krb5pac.h"
 #include "smb_krb5.h"
+#include "libads/kerberos_proto.h"
 
 #ifdef HAVE_KRB5
 
index d05b5085f044852f1e26dad74d6e954fc6f9fbc4..05ac216bbe2335392d4614d043fb7d0aca6abb3c 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "libads/ldap_schema.h"
 
 /* for ADS */
index f34b9cad095e44be83ee303520a65e89a16418e1..c48944ae6f8ba3eec1f88f631ea7506c8e15ef09 100644 (file)
@@ -24,6 +24,7 @@
 #include "includes.h"
 #include "smb_krb5.h"
 #include "../librpc/gen_ndr/ndr_misc.h"
+#include "libads/kerberos_proto.h"
 
 #ifdef HAVE_KRB5
 
@@ -284,58 +285,6 @@ int kerberos_kinit_password_ext(const char *principal,
        return code;
 }
 
-
-
-/* run kinit to setup our ccache */
-int ads_kinit_password(ADS_STRUCT *ads)
-{
-       char *s;
-       int ret;
-       const char *account_name;
-       fstring acct_name;
-
-       if (ads->auth.flags & ADS_AUTH_USER_CREDS) {
-               account_name = ads->auth.user_name;
-               goto got_accountname;
-       }
-
-       if ( IS_DC ) {
-               /* this will end up getting a ticket for DOMAIN@RUSTED.REA.LM */
-               account_name = lp_workgroup();
-       } else {
-               /* always use the sAMAccountName for security = domain */
-               /* global_myname()$@REA.LM */
-               if ( lp_security() == SEC_DOMAIN ) {
-                       fstr_sprintf( acct_name, "%s$", global_myname() );
-                       account_name = acct_name;
-               }
-               else 
-                       /* This looks like host/global_myname()@REA.LM */
-                       account_name = ads->auth.user_name;
-       }
-
- got_accountname:
-       if (asprintf(&s, "%s@%s", account_name, ads->auth.realm) == -1) {
-               return KRB5_CC_NOMEM;
-       }
-
-       if (!ads->auth.password) {
-               SAFE_FREE(s);
-               return KRB5_LIBOS_CANTREADPWD;
-       }
-       
-       ret = kerberos_kinit_password_ext(s, ads->auth.password, ads->auth.time_offset,
-                       &ads->auth.tgt_expire, NULL, NULL, False, False, ads->auth.renewable, 
-                       NULL);
-
-       if (ret) {
-               DEBUG(0,("kerberos_kinit_password %s failed: %s\n", 
-                        s, error_message(ret)));
-       }
-       SAFE_FREE(s);
-       return ret;
-}
-
 int ads_kdestroy(const char *cc_name)
 {
        krb5_error_code code;
index fa2a1261a2823f6d60a211e6bf53de588d51ac9e..33b065f654341d131accfb8a12f6d8d4e5042b9f 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "includes.h"
 #include "smb_krb5.h"
+#include "ads.h"
 
 #ifdef HAVE_KRB5
 
diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h
new file mode 100644 (file)
index 0000000..7be81fa
--- /dev/null
@@ -0,0 +1,67 @@
+/* The following definitions come from libads/kerberos_verify.c  */
+
+NTSTATUS ads_verify_ticket(TALLOC_CTX *mem_ctx,
+                          const char *realm,
+                          time_t time_offset,
+                          const DATA_BLOB *ticket,
+                          char **principal,
+                          struct PAC_LOGON_INFO **logon_info,
+                          DATA_BLOB *ap_rep,
+                          DATA_BLOB *session_key,
+                          bool use_replay_cache);
+
+/* The following definitions come from libads/kerberos.c  */
+
+int kerberos_kinit_password_ext(const char *principal,
+                               const char *password,
+                               int time_offset,
+                               time_t *expire_time,
+                               time_t *renew_till_time,
+                               const char *cache_name,
+                               bool request_pac,
+                               bool add_netbios_addr,
+                               time_t renewable_time,
+                               NTSTATUS *ntstatus);
+int ads_kdestroy(const char *cc_name);
+char* kerberos_standard_des_salt( void );
+bool kerberos_secrets_store_des_salt( const char* salt );
+char* kerberos_secrets_fetch_des_salt( void );
+char *kerberos_get_default_realm_from_ccache( void );
+char *kerberos_get_realm_from_hostname(const char *hostname);
+
+bool kerberos_secrets_store_salting_principal(const char *service,
+                                             int enctype,
+                                             const char *principal);
+int kerberos_kinit_password(const char *principal,
+                           const char *password,
+                           int time_offset,
+                           const char *cache_name);
+bool create_local_private_krb5_conf_for_domain(const char *realm,
+                                               const char *domain,
+                                               const char *sitename,
+                                               struct sockaddr_storage *pss,
+                                               const char *kdc_name);
+
+/* The following definitions come from libads/authdata.c  */
+
+NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
+                            const char *name,
+                            const char *pass,
+                            time_t time_offset,
+                            time_t *expire_time,
+                            time_t *renew_till_time,
+                            const char *cache_name,
+                            bool request_pac,
+                            bool add_netbios_addr,
+                            time_t renewable_time,
+                            const char *impersonate_princ_s,
+                            struct PAC_LOGON_INFO **logon_info);
+
+/* The following definitions come from libads/krb5_setpw.c  */
+
+ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
+                                const char *newpw, int time_offset);
+ADS_STATUS kerberos_set_password(const char *kpasswd_server,
+                                const char *auth_principal, const char *auth_password,
+                                const char *target_principal, const char *new_password,
+                                int time_offset);
diff --git a/source3/libads/kerberos_util.c b/source3/libads/kerberos_util.c
new file mode 100644 (file)
index 0000000..4762e1b
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+   Unix SMB/CIFS implementation.
+   krb5 set password implementation
+   Copyright (C) Andrew Tridgell 2001
+   Copyright (C) Remus Koos 2001 (remuskoos@yahoo.com)
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "smb_krb5.h"
+#include "ads.h"
+
+#ifdef HAVE_KRB5
+
+/**
+ * Set the machine account password
+ * @param ads connection to ads server
+ * @param hostname machine whose password is being set
+ * @param password new password
+ * @return status of password change
+ **/
+ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
+                                   const char *machine_account,
+                                   const char *password)
+{
+       ADS_STATUS status;
+       char *principal = NULL;
+
+       /*
+         we need to use the '$' form of the name here (the machine account name),
+         as otherwise the server might end up setting the password for a user
+         instead
+        */
+       if (asprintf(&principal, "%s@%s", machine_account, ads->config.realm) < 0) {
+               return ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
+       }
+
+       status = ads_krb5_set_password(ads->auth.kdc_server, principal,
+                                      password, ads->auth.time_offset);
+
+       SAFE_FREE(principal);
+       return status;
+}
+
+/* run kinit to setup our ccache */
+int ads_kinit_password(ADS_STRUCT *ads)
+{
+       char *s;
+       int ret;
+       const char *account_name;
+       fstring acct_name;
+
+       if (ads->auth.flags & ADS_AUTH_USER_CREDS) {
+               account_name = ads->auth.user_name;
+               goto got_accountname;
+       }
+
+       if ( IS_DC ) {
+               /* this will end up getting a ticket for DOMAIN@RUSTED.REA.LM */
+               account_name = lp_workgroup();
+       } else {
+               /* always use the sAMAccountName for security = domain */
+               /* global_myname()$@REA.LM */
+               if ( lp_security() == SEC_DOMAIN ) {
+                       fstr_sprintf( acct_name, "%s$", global_myname() );
+                       account_name = acct_name;
+               }
+               else
+                       /* This looks like host/global_myname()@REA.LM */
+                       account_name = ads->auth.user_name;
+       }
+
+ got_accountname:
+       if (asprintf(&s, "%s@%s", account_name, ads->auth.realm) == -1) {
+               return KRB5_CC_NOMEM;
+       }
+
+       if (!ads->auth.password) {
+               SAFE_FREE(s);
+               return KRB5_LIBOS_CANTREADPWD;
+       }
+
+       ret = kerberos_kinit_password_ext(s, ads->auth.password, ads->auth.time_offset,
+                       &ads->auth.tgt_expire, NULL, NULL, False, False, ads->auth.renewable,
+                       NULL);
+
+       if (ret) {
+               DEBUG(0,("kerberos_kinit_password %s failed: %s\n",
+                        s, error_message(ret)));
+       }
+       SAFE_FREE(s);
+       return ret;
+}
+
+#endif
index 2047f0e3b9b0a99e8d6017d3526fd0fdbe521f99..f8a66021948fd71c01b3fa3e153b8fa83f7c3639 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "includes.h"
 #include "smb_krb5.h"
+#include "libads/kerberos_proto.h"
 
 #ifdef HAVE_KRB5
 
index ec5cafc49d408a573c0a08cd07669b35799b3dc6..1c04d896de6af0aa5b32497c0082fa84cc574086 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "smb_krb5.h"
+#include "libads/kerberos_proto.h"
 
 #ifdef HAVE_KRB5
 
@@ -806,34 +807,4 @@ ADS_STATUS kerberos_set_password(const char *kpasswd_server,
                                     new_password, time_offset);
 }
 
-
-/**
- * Set the machine account password
- * @param ads connection to ads server
- * @param hostname machine whose password is being set
- * @param password new password
- * @return status of password change
- **/
-ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
-                                   const char *machine_account,
-                                   const char *password)
-{
-       ADS_STATUS status;
-       char *principal = NULL; 
-
-       /*
-         we need to use the '$' form of the name here (the machine account name), 
-         as otherwise the server might end up setting the password for a user
-         instead
-        */
-       if (asprintf(&principal, "%s@%s", machine_account, ads->config.realm) < 0) {
-               return ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
-       }
-       
-       status = ads_krb5_set_password(ads->auth.kdc_server, principal, 
-                                      password, ads->auth.time_offset);
-       
-       SAFE_FREE(principal);
-       return status;
-}
 #endif
index 5adbd6d039b646137ca8f6925ffdd094541e0f02..77ab51ee2659eb8f5a5410e49f3b9c0f08d5e742 100644 (file)
@@ -22,6 +22,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "libads/sitename_cache.h"
 #include "libads/cldap.h"
 #include "libads/dns.h"
index fff50cfe8b131909b3c7fae525d25748f334b300..e4a7d34cf186eb53bb6014e93e41d7ad58cd55e0 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "../librpc/gen_ndr/cli_spoolss.h"
 #include "rpc_client/cli_spoolss.h"
 #include "registry.h"
index c739286abbdc0c881120a968ff4c4b798261f2b5..80ec45c73c89862ff80366d8ec942207b7e6fbc8 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "libads/ldap_schema.h"
 
 #ifdef HAVE_LDAP
index ffd20f9bd25df07131f043d5e2b05a3b2bb0a2c3..55421009a7b9ac348e25f9ac7a2d047c1a8cfcc9 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "../libds/common/flags.h"
 
 #ifdef HAVE_ADS
index f9106caed1606988be25ab2a214bdd3c86c8f23b..c0c1adba30032a6558b45a344fc3e310881f5e46 100644 (file)
@@ -21,6 +21,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 
 #ifdef HAVE_LDAP
 /*
index 397aa2ca601452c92234c7d777f72fd9169f8d0e..843ae3b61573dd9925108da38dc1fc8f1e11c02f 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "../librpc/gen_ndr/ndr_netlogon.h"
 
 void ndr_print_ads_auth_flags(struct ndr_print *ndr, const char *name, uint32_t r)
index f4a0ac627eb6e1f6400ef2413679d1d428b4786e..7ad4c9a86843683e8f17feb9a0c3a5091e4e9a01 100644 (file)
@@ -20,6 +20,8 @@
 #include "includes.h"
 #include "../libcli/auth/spnego.h"
 #include "../libcli/auth/ntlmssp.h"
+#include "ads.h"
+#include "smb_krb5.h"
 
 #ifdef HAVE_LDAP
 
index 2bfa07923502dad5600d3ba4a776424d893e8c60..d7353ac79c967e1804b2b780a882ca776390a555 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 
 #ifdef HAVE_LDAP_SASL_WRAPPING
 
index 9dcb906a37206c4c87dd2495566e0c5f6cd3d10c..f028c75cfe25d79cd7c7cc8fd707a1db51a7c75c 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 
 #ifdef HAVE_KRB5
 
index e2b917966ba9c1fa73eb48f59cdc893087c528bc..2d18261bfb8e0cd71763c927eee02a151af923d6 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "librpc/gen_ndr/ndr_libnet_join.h"
 #include "libnet/libnet_join.h"
 #include "libcli/auth/libcli_auth.h"
index 2d3e5a56a7db3c66a8794629b8ce79bf690e66e7..a0f8f282b32300b93601dc6b6c37fb357abc2cac 100644 (file)
@@ -23,6 +23,7 @@
 #include "../libcli/auth/spnego.h"
 #include "smb_krb5.h"
 #include "../libcli/auth/ntlmssp.h"
+#include "libads/kerberos_proto.h"
 
 static const struct {
        int prot;
index cebd793537612fb7344ccf630d179b31b2ebc74c..6458e5d5647c9ada63c11ee147a62d1d6e81a515 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "includes.h"
 #include "libads/sitename_cache.h"
+#include "ads.h"
 
 /**********************************************************************
  Is this our primary domain ?
index f65a9d50e95f7b5b74842223c6ef81834bb587e4..a91e82fe3dc2592e073665e25532aaacdaf368c7 100644 (file)
@@ -57,6 +57,8 @@
 #include "lib/smbconf/smbconf_init.h"
 #include "lib/smbconf/smbconf_reg.h"
 
+#include "ads.h"
+
 #ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
 #endif
index 9d8e7ece2c7cf7cecd8274d4d6c26f2b41ab4972..514170e5fa534c971ba50abeed7603246454df44 100644 (file)
@@ -28,6 +28,7 @@
 #include "../libcli/auth/ntlmssp.h"
 #include "ntlmssp_wrap.h"
 #include "librpc/gen_ndr/messaging.h"
+#include "libads/kerberos_proto.h"
 
 /* For split krb5 SPNEGO blobs. */
 struct pending_auth_data {
index f5272b35cd9c0fd08b1cdaa4a0c6fe8e4cb6d960..4f6d5d2e13e7bc13112d54091ae1e3b156f777a1 100644 (file)
@@ -25,6 +25,7 @@
 #include "../libcli/auth/spnego.h"
 #include "../libcli/auth/ntlmssp.h"
 #include "ntlmssp_wrap.h"
+#include "libads/kerberos_proto.h"
 
 static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *smb2req,
                                        uint64_t in_session_id,
index ef28fc7008b9a651b3e3f87acd95d55b99fc5016..71181990b583180a40426bf7134a9382bad4b15e 100644 (file)
 #include "librpc/gen_ndr/ndr_krb5pac.h"
 #include "../librpc/gen_ndr/cli_spoolss.h"
 #include "nsswitch/libwbclient/wbclient.h"
+#include "ads.h"
 #include "libads/cldap.h"
 #include "libads/dns.h"
 #include "../libds/common/flags.h"
-#include "ads.h"
 #include "librpc/gen_ndr/libnet_join.h"
 #include "libnet/libnet_join.h"
 #include "smb_krb5.h"
index 05c3676160932e58dcd90d62b6b5bd3b1674f4ca..57396c76e303df24dcbd7a559edc72a71f9b47eb 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "utils/net.h"
+#include "ads.h"
 #include "../libgpo/gpo.h"
 #include "libgpo/gpo_proto.h"
 #include "../libds/common/flags.h"
index 9f3fe155a40c3d5b2473a8b8be6dbb72a43c0185..4791223f2d4e4d9cd57c9e3ab0abbee96f097db0 100644 (file)
@@ -45,9 +45,9 @@ void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
 enum netr_SchannelType get_sec_channel_type(const char *param);
 
 /* The following definitions come from utils/net_ads.c  */
-
-ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads);
-ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, ADS_STRUCT **ads);
+struct ads_struct;
+ADS_STATUS ads_startup(struct net_context *c, bool only_own_domain, struct ads_struct **ads);
+ADS_STATUS ads_startup_nobind(struct net_context *c, bool only_own_domain, struct ads_struct **ads);
 int net_ads_check_our_domain(struct net_context *c);
 int net_ads_check(struct net_context *c);
 int net_ads_user(struct net_context *c, int argc, const char **argv);
index 971ba96220c9d7a25ba14c3f352f75a7668b36e8..1ddc94b8f7070568d813da5edd53d644a011ebc6 100644 (file)
@@ -31,6 +31,7 @@
 #include "smb_krb5.h"
 #include <iniparser.h>
 #include "../lib/crypto/arcfour.h"
+#include "libads/kerberos_proto.h"
 
 #ifndef PAM_WINBIND_CONFIG_FILE
 #define PAM_WINBIND_CONFIG_FILE "/etc/security/pam_winbind.conf"
index 7aaaa9d272c807661697e56b9b36a34036b928f9..def41c6c116e3d4d76ccfa3a0c31bb4ae95f3d49 100644 (file)
@@ -28,6 +28,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "../libds/common/flags.h"
+#include "ads.h"
 #include "libads/ldap_schema.h"
 #include "nss_info.h"
 
index 257647a797fd3d7be79ee65d09c66b37bcacc449..c32bb9179d5e5c81e5bf588bd228ae477fc568c3 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
 #include "../libds/common/flags.h"
 
index dae5415b3b7e476675bb4fcacb8b747c4ead2b2f..72643e97da4323e782ec2814e947d33f70d19c28 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
 
 #undef DBGC_CLASS
index 9b4ce77b000de16aa983a83e7e73091b75ac12a9..339234dfaff7277fe8a31efa7d80debdb34322ef 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
 #include "libads/cldap.h"
 
index aabc4da4007ce6745fd24b6b6ca2199292a42ea3..c815e75a2919018bffa53278b2ed0fd6a2b2b9be 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
 #include "nss_info.h"
 
index f1abb24da2b0ad99880868fe68ffbd02259dc07f..24343eb554627765696fd1c5961a525f4e2476a5 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
 
 #undef DBGC_CLASS
index f66d4dfbf4b8a80b2607922580cf977145736d14..999615ca3c222599c87d4607da4fc88563f4cd72 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include "includes.h"
+#include "ads.h"
 #include "idmap_adex.h"
 
 #undef DBGC_CLASS
index de4652d68488216527112bcbf599e57768cc0be7..ed55cd5dd4988e701e6c8841dc20881614126aa7 100644 (file)
@@ -21,6 +21,7 @@
 #include "includes.h"
 #include "winbindd/winbindd.h"
 #include "idmap_hash.h"
+#include "ads.h"
 #include "nss_info.h"
 
 #undef DBGC_CLASS
index 82eb6c7db535e262476338ecafffe1663644c56b..67ffbf21cc48329b547d1816a2c6dc7467a342f8 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "nss_info.h"
 
 static struct nss_function_entry *backends = NULL;
index 1b69a8cb2b65711604d19a2eb3ffdbcfc6e34c32..0bc398e9083fd017664d7891707d4c9d67281ce8 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "includes.h"
+#include "ads.h"
 #include "nss_info.h"
 
 /************************************************************************
index c73e1a0aeb9c87121fef651e9359c2306d541557..949e206d0425e7da04d75c4827135d49b4a93647 100644 (file)
@@ -25,6 +25,7 @@
 #include "winbindd.h"
 #include "../librpc/gen_ndr/cli_netlogon.h"
 #include "../libds/common/flags.h"
+#include "ads.h"
 
 #ifdef HAVE_ADS
 
index 631a14d4134edd4845154894a2bba83c60f2fd8d..5d12c2b3bc29e16dda607ea3ccdb636777f5a2a5 100644 (file)
@@ -28,6 +28,7 @@
 #include "tdb_validate.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "../librpc/gen_ndr/ndr_wbint.h"
+#include "ads.h"
 #include "nss_info.h"
 
 #undef DBGC_CLASS
index b30035719072fdf688102a8f8dbe86d70204850b..c10d82cb4907bead05a785ca8112960cd4cf71a7 100644 (file)
@@ -70,6 +70,7 @@
 #include "libads/sitename_cache.h"
 #include "librpc/gen_ndr/messaging.h"
 #include "libsmb/clidgram.h"
+#include "ads.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
index 22e135a3811f125d053e2442816aa8c5b6c5b646..ab8934bfd4a8b631c7bee70e87de68b0990249f6 100644 (file)
@@ -25,6 +25,7 @@
 #include "winbindd.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "smb_krb5.h"
+#include "libads/kerberos_proto.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
index 010245f05d6bd45b1fa40209604504bf6375a16c..11b16310b414c32e557d6f0e17e8109ead231342 100644 (file)
@@ -32,6 +32,7 @@
 #include "smb_krb5.h"
 #include "../lib/crypto/arcfour.h"
 #include "../libcli/security/dom_sid.h"
+#include "ads.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
index a26a9df889e3a75e890f8acd96e4cc2594b90b5d..eb9ca4bace6ef398216a1d3e3ee1d871ab65fdde 100644 (file)
@@ -155,10 +155,11 @@ bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_do
 bool wcache_tdc_add_domain( struct winbindd_domain *domain );
 struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
 void wcache_tdc_clear( void );
+struct ads_struct;
 NTSTATUS nss_get_info_cached( struct winbindd_domain *domain, 
                              const struct dom_sid *user_sid,
                              TALLOC_CTX *ctx,
-                             ADS_STRUCT *ads, LDAPMessage *msg,
+                             struct ads_struct *ads, LDAPMessage *msg,
                              const char **homedir, const char **shell,
                              const char **gecos, gid_t *p_gid);
 bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
index aec350ffce4eda0e71c69106baeeb53a3456b3bf..1babb54db8f9734996b8e9c13f6ba95f12354f55 100644 (file)
@@ -205,7 +205,9 @@ LIBGPO_SRC = '''${LIBGPO_SRC0}'''
 
 LIBADS_SRC = '''libads/ldap.c libads/ldap_printer.c
              libads/sasl.c libads/sasl_wrapping.c
-             libads/krb5_setpw.c libads/ldap_user.c
+             libads/krb5_setpw.c
+             libads/kerberos_util.c
+             libads/ldap_user.c
              libads/ads_struct.c libads/kerberos_keytab.c
              libads/disp_sec.c libads/ads_utils.c libads/ldap_utils.c
              libads/ldap_schema.c libads/util.c libads/ndr.c'''