diff options
author | Gerald Carter <jerry@samba.org> | 2006-11-19 18:47:58 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2006-11-19 18:47:58 +0000 |
commit | fa9727d443956c4ef4dcf3dbb83f311813f122ea (patch) | |
tree | 5e4899ab3652a12b3cabc00a1e17d8f24b0882f4 /source/include | |
parent | 5eef37058bcbee1324ca45c6a0fbd2a57e236ff9 (diff) | |
parent | be27ef2d325798ee9c77472ce113151cf69cb35c (diff) | |
download | samba-fa9727d443956c4ef4dcf3dbb83f311813f122ea.tar.gz samba-fa9727d443956c4ef4dcf3dbb83f311813f122ea.tar.xz samba-fa9727d443956c4ef4dcf3dbb83f311813f122ea.zip |
r19796: * copy libgpo and grab libads changes
* update net to include dns and gpo commands
* include server name rap call in net
Diffstat (limited to 'source/include')
-rw-r--r-- | source/include/ads_protos.h | 95 | ||||
-rw-r--r-- | source/include/gpo.h | 22 | ||||
-rw-r--r-- | source/include/includes.h | 5 |
3 files changed, 113 insertions, 9 deletions
diff --git a/source/include/ads_protos.h b/source/include/ads_protos.h new file mode 100644 index 00000000000..b5f323774d3 --- /dev/null +++ b/source/include/ads_protos.h @@ -0,0 +1,95 @@ +/* + * 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 GUID *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); + +ADS_STATUS ads_parse_gpo(ADS_STRUCT *ads, + TALLOC_CTX *mem_ctx, + LDAPMessage *res, + const char *gpo_dn, + struct GROUP_POLICY_OBJECT *gpo); diff --git a/source/include/gpo.h b/source/include/gpo.h index 65c96c31e6b..c3ae20dd20b 100644 --- a/source/include/gpo.h +++ b/source/include/gpo.h @@ -20,11 +20,11 @@ enum GPO_LINK_TYPE { - GP_LINK_UNKOWN, - GP_LINK_MACHINE, - GP_LINK_SITE, - GP_LINK_DOMAIN, - GP_LINK_OU + GP_LINK_UNKOWN = 0, + GP_LINK_MACHINE = 1, + GP_LINK_SITE = 2, + GP_LINK_DOMAIN = 3, + GP_LINK_OU = 4 }; /* GPO_OPTIONS */ @@ -35,11 +35,12 @@ enum GPO_LINK_TYPE { #define GPO_LIST_FLAG_MACHINE 0x00000001 #define GPO_LIST_FLAG_SITEONLY 0x00000002 +#define GPO_VERSION_USER(x) (x >> 16) +#define GPO_VERSION_MACHINE(x) (x & 0xffff) + struct GROUP_POLICY_OBJECT { uint32 options; /* GPFLAGS_* */ uint32 version; - uint16 version_user; - uint16 version_machine; const char *ds_path; const char *file_sys_path; const char *display_name; @@ -62,8 +63,8 @@ struct GROUP_POLICY_OBJECT { /* 'gPOptions', maybe a bitmask as well */ enum GPO_INHERIT { - GPOPTIONS_INHERIT, - GPOPTIONS_BLOCK_INHERITANCE + GPOPTIONS_INHERIT = 0, + GPOPTIONS_BLOCK_INHERITANCE = 1 }; /* 'flags' in a 'groupPolicyContainer' object */ @@ -89,3 +90,6 @@ struct GP_EXT { char **snapins; char **snapins_guid; }; + +#define GPO_CACHE_DIR "gpo_cache" +#define GPT_INI "GPT.INI" diff --git a/source/include/includes.h b/source/include/includes.h index 9301f356e13..ea639d28a9b 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -627,6 +627,7 @@ typedef int BOOL; #include "nt_status.h" #include "ads.h" +#include "gpo.h" #include "ads_dns.h" #include "interfaces.h" #include "trans2.h" @@ -771,6 +772,10 @@ enum flush_reason_enum { #include "proto.h" #endif +#ifdef HAVE_LDAP +#include "ads_protos.h" +#endif + /* We need this after proto.h to reference GetTimeOfDay(). */ #include "smbprofile.h" |