diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/passdb.h | 86 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 3 | ||||
-rw-r--r-- | source3/include/smbldap.h | 1 |
3 files changed, 56 insertions, 34 deletions
diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 624f0c5fea..0c816271b0 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -232,6 +232,30 @@ struct acct_info uint32 rid; /* domain-relative RID */ }; +struct samr_displayentry { + uint32 rid; + uint16 acct_flags; + const char *account_name; + const char *fullname; + const char *description; +}; + +enum pdb_search_type { + PDB_USER_SEARCH, + PDB_GROUP_SEARCH, + PDB_ALIAS_SEARCH +}; + +struct pdb_search { + TALLOC_CTX *mem_ctx; + enum pdb_search_type type; + struct samr_displayentry *cache; + uint32 num_entries; + ssize_t cache_size; + BOOL search_ended; + void *private; +}; + /***************************************************************** Functions to be implemented by the new (v2) passdb API ****************************************************************/ @@ -310,12 +334,6 @@ typedef struct pdb_context NTSTATUS (*pdb_delete_alias)(struct pdb_context *context, const DOM_SID *sid); - NTSTATUS (*pdb_enum_aliases)(struct pdb_context *context, - const DOM_SID *domain_sid, - uint32 start_idx, uint32 num_entries, - uint32 *num_aliases, - struct acct_info **aliases); - NTSTATUS (*pdb_get_aliasinfo)(struct pdb_context *context, const DOM_SID *sid, struct acct_info *info); @@ -352,6 +370,20 @@ typedef struct pdb_context const char ***names, uint32 **attrs); + BOOL (*pdb_search_users)(struct pdb_context *context, + struct pdb_search *search, + uint16 acct_flags); + BOOL (*pdb_search_groups)(struct pdb_context *context, + struct pdb_search *search); + BOOL (*pdb_search_aliases)(struct pdb_context *context, + struct pdb_search *search, + const DOM_SID *sid); + BOOL (*pdb_search_next_entry)(struct pdb_context *context, + struct pdb_search *search, + struct samr_displayentry *entry); + void (*pdb_search_end)(struct pdb_context *context, + struct pdb_search *search); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -426,11 +458,6 @@ typedef struct pdb_methods NTSTATUS (*delete_alias)(struct pdb_methods *methods, const DOM_SID *sid); - NTSTATUS (*enum_aliases)(struct pdb_methods *methods, - const DOM_SID *domain_sid, - uint32 start_idx, uint32 max_entries, - uint32 *num_aliases, struct acct_info **info); - NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods, const DOM_SID *sid, struct acct_info *info); @@ -461,6 +488,20 @@ typedef struct pdb_methods const char ***names, uint32 **attrs); + BOOL (*search_users)(struct pdb_methods *methods, + struct pdb_search *search, + uint16 acct_flags); + BOOL (*search_groups)(struct pdb_methods *methods, + struct pdb_search *search); + BOOL (*search_aliases)(struct pdb_methods *methods, + struct pdb_search *search, + const DOM_SID *sid); + BOOL (*search_next_entry)(struct pdb_methods *methods, + struct pdb_search *search, + struct samr_displayentry *entry); + void (*search_end)(struct pdb_methods *methods, + struct pdb_search *search); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); @@ -480,27 +521,4 @@ struct pdb_init_function_entry { enum sql_search_field { SQL_SEARCH_NONE = 0, SQL_SEARCH_USER_SID = 1, SQL_SEARCH_USER_NAME = 2}; -struct samr_displayentry { - uint32 rid; - uint16 acct_flags; - const char *account_name; - const char *fullname; - const char *description; -}; - -enum pdb_search_type { - PDB_USER_SEARCH, - PDB_GROUP_SEARCH, - PDB_ALIAS_SEARCH -}; - -struct pdb_search { - TALLOC_CTX *mem_ctx; - enum pdb_search_type type; - struct samr_displayentry *cache; - uint32 cache_size; - BOOL search_ended; - void *private; -}; - #endif /* _PASSDB_H */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index b7a3a68bec..04616eb8ab 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -362,4 +362,7 @@ do { \ (*(num)) += 1; \ } while (0) +#define ADD_TO_LARGE_ARRAY(mem_ctx, type, elem, array, num, size) \ + add_to_large_array((mem_ctx), sizeof(type), &(elem), (void **)(array), (num), (size)); + #endif /* _SMB_MACROS_H */ diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h index e6a6a1b7c6..b54b3f4325 100644 --- a/source3/include/smbldap.h +++ b/source3/include/smbldap.h @@ -185,5 +185,6 @@ struct ldapsam_privates { struct smbldap_state; #define LDAP_CONNECT_DEFAULT_TIMEOUT 15 +#define LDAP_PAGE_SIZE 1024 #endif /* _SMBLDAP_H */ |