diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/ads.h | 4 | ||||
-rw-r--r-- | source3/include/ads_protos.h | 89 | ||||
-rw-r--r-- | source3/include/includes.h | 4 | ||||
-rw-r--r-- | source3/include/smb.h | 1 |
4 files changed, 98 insertions, 0 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h index f70c5a6f12..58fac36920 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -15,7 +15,11 @@ enum wb_posix_mapping { }; typedef struct { +#ifdef HAVE_LDAP + LDAP *ld; +#else void *ld; /* the active ldap structure */ +#endif struct in_addr ldap_ip; /* the ip of the active connection, if any */ time_t last_attempt; /* last attempt to reconnect */ int ldap_port; diff --git a/source3/include/ads_protos.h b/source3/include/ads_protos.h new file mode 100644 index 0000000000..6eb4f10f65 --- /dev/null +++ b/source3/include/ads_protos.h @@ -0,0 +1,89 @@ +/* + * Prototypes for ads + */ + +void ads_msgfree(ADS_STRUCT *ads, LDAPMessage *msg); +char *ads_get_dn(ADS_STRUCT *ads, LDAPMessage *msg); +char *ads_get_dn_canonical(ADS_STRUCT *ads, LDAPMessage *msg); + +char *ads_pull_string(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg, + const char *field); +char **ads_pull_strings(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, + size_t *num_values); +char **ads_pull_strings_range(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, + char **current_strings, + const char **next_attribute, + size_t *num_strings, + BOOL *more_strings); +BOOL ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, + uint32 *v); +BOOL ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct uuid *guid); +BOOL ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, + DOM_SID *sid); +int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, DOM_SID **sids); +BOOL ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg, const char *field, SEC_DESC **sd); +char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, + LDAPMessage *msg); +int ads_pull_sids_from_extendeddn(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + LDAPMessage *msg, + const char *field, + enum ads_extended_dn_flags flags, + DOM_SID **sids); + +ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, LDAPMessage **res, + const char *machine); +ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, LDAPMessage **res, + const char *printer, + const char *servername); +ADS_STATUS ads_find_printers(ADS_STRUCT *ads, LDAPMessage **res); +ADS_STATUS ads_find_user_acct(ADS_STRUCT *ads, LDAPMessage **res, + const char *user); + +ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope, + const char *expr, + const char **attrs, LDAPMessage **res); +ADS_STATUS ads_search(ADS_STRUCT *ads, LDAPMessage **res, + const char *expr, const char **attrs); +ADS_STATUS ads_search_dn(ADS_STRUCT *ads, LDAPMessage **res, + const char *dn, const char **attrs); +ADS_STATUS ads_do_search_all_args(ADS_STRUCT *ads, const char *bind_path, + int scope, const char *expr, + const char **attrs, void *args, + LDAPMessage **res); +ADS_STATUS ads_do_search_all(ADS_STRUCT *ads, const char *bind_path, + int scope, const char *expr, + const char **attrs, LDAPMessage **res); +ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path, + int scope, + const char *expr, + const char **attrs, LDAPMessage **res); +ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path, + int scope, const char *expr, + const char **attrs, void *args, + LDAPMessage **res); +ADS_STATUS ads_search_retry(ADS_STRUCT *ads, LDAPMessage **res, + const char *expr, const char **attrs); +ADS_STATUS ads_search_retry_dn(ADS_STRUCT *ads, LDAPMessage **res, + const char *dn, + const char **attrs); +ADS_STATUS ads_search_retry_extended_dn(ADS_STRUCT *ads, LDAPMessage **res, + const char *dn, + const char **attrs, + enum ads_extended_dn_flags flags); +ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, + const DOM_SID *sid, + const char **attrs); + + +LDAPMessage *ads_first_entry(ADS_STRUCT *ads, LDAPMessage *res); +LDAPMessage *ads_next_entry(ADS_STRUCT *ads, LDAPMessage *res); +void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res, + BOOL(*fn)(char *, void **, void *), + void *data_area); +void ads_dump(ADS_STRUCT *ads, LDAPMessage *res); diff --git a/source3/include/includes.h b/source3/include/includes.h index 524e6ab8d2..3629996ff9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1084,6 +1084,10 @@ typedef int (*comparison_fn_t)(const void *, const void *); #include "proto.h" #endif +#ifdef HAVE_ADS +#include "ads_protos.h" +#endif + /* We need this after proto.h to reference GetTimeOfDay(). */ #include "smbprofile.h" diff --git a/source3/include/smb.h b/source3/include/smb.h index 5a9d0f7d15..6f1e51b1a6 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -410,6 +410,7 @@ struct fd_handle { struct timed_event; struct idle_event; struct share_mode_entry; +struct uuid; struct vfs_fsp_data { struct vfs_fsp_data *next; |