summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-12-12 14:52:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:25 -0500
commit4225f9a4bd5eece4d57820bbabb7b882610aa7cc (patch)
treee9dc08eba6d786b9ca17d784244cea7f3829d832 /source3/include
parent18f9156d96cba17adc199d0e8c4cf1d6c9ae1960 (diff)
downloadsamba-4225f9a4bd5eece4d57820bbabb7b882610aa7cc.tar.gz
samba-4225f9a4bd5eece4d57820bbabb7b882610aa7cc.tar.bz2
samba-4225f9a4bd5eece4d57820bbabb7b882610aa7cc.zip
r20116: Start merging in the work done to create the new idmap subsystem.
Simo. (This used to be commit 50cd8bffeeed2cac755f75fc3d76fe41c451976b)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/dlinklist.h2
-rw-r--r--source3/include/idmap.h46
-rw-r--r--source3/include/passdb.h2
-rw-r--r--source3/include/smb.h16
-rw-r--r--source3/include/smbldap.h4
5 files changed, 56 insertions, 14 deletions
diff --git a/source3/include/dlinklist.h b/source3/include/dlinklist.h
index f267e77ea6..e590bc3e7e 100644
--- a/source3/include/dlinklist.h
+++ b/source3/include/dlinklist.h
@@ -59,7 +59,7 @@ do { \
DLIST_ADD(list, p); \
} while (0)
-/* hook into the end of the list - needs a tmp pointer */
+/* hook into the end of the list - needs the entry type */
#define DLIST_ADD_END(list, p, type) \
do { \
if (!(list)) { \
diff --git a/source3/include/idmap.h b/source3/include/idmap.h
index ee248ef26f..069aaa73a3 100644
--- a/source3/include/idmap.h
+++ b/source3/include/idmap.h
@@ -32,29 +32,49 @@
/* The interface version specifier.
Updated to 3 for enum types by JRA. */
-#define SMB_IDMAP_INTERFACE_VERSION 3
+/* Updated to 4, completely new interface, SSS */
-enum idmap_type { ID_USERID, ID_GROUPID };
+#define SMB_IDMAP_INTERFACE_VERSION 4
-#define IDMAP_FLAG_NONE 0x0
-#define IDMAP_FLAG_QUERY_ONLY 0x1 /* Don't ever allocate, just query. */
-#define IDMAP_FLAG_CACHE_ONLY 0x2 /* Only look in our local cache, not remote. */
+struct idmap_domain {
+ DOM_SID *sid;
+ const char *name;
+ BOOL default_domain;
+ BOOL readonly;
+ void *private_data;
+ struct idmap_methods *methods;
+};
/* Filled out by IDMAP backends */
struct idmap_methods {
/* Called when backend is first loaded */
- NTSTATUS (*init)( const char *params );
+ NTSTATUS (*init)(struct idmap_domain *dom, const char *compat_params);
+
+ NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids);
+ NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids);
+ NTSTATUS (*set_mapping)(struct idmap_domain *dom, const struct id_map *map);
+ NTSTATUS (*remove_mapping)(struct idmap_domain *dom, const struct id_map *map);
- NTSTATUS (*allocate_id)(unid_t *id, enum idmap_type id_type);
- NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, enum idmap_type id_type, int flags);
- NTSTATUS (*get_id_from_sid)(unid_t *id, enum idmap_type *id_type, const DOM_SID *sid, int flags);
- NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, enum idmap_type id_type);
+ /* Called to dump backends data */
+ /* NOTE: caller must use talloc_free to free maps when done */
+ NTSTATUS (*dump_data)(struct idmap_domain *dom, struct id_map **maps, int *num_maps);
/* Called when backend is unloaded */
- NTSTATUS (*close_fn)(void);
+ NTSTATUS (*close_fn)(struct idmap_domain *dom);
+};
+
+struct idmap_alloc_methods {
- /* Called to dump backend status */
- void (*status)(void);
+ /* Called when backend is first loaded */
+ NTSTATUS (*init)(const char *compat_params);
+
+ NTSTATUS (*allocate_id)(struct unixid *id);
+ NTSTATUS (*get_id_hwm)(struct unixid *id);
+ NTSTATUS (*set_id_hwm)(struct unixid *id);
+
+ /* Called when backend is unloaded */
+ NTSTATUS (*close_fn)(void);
};
+
#endif /* _IDMAP_H_ */
diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index 9dc6d60eb0..092904ab60 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -393,6 +393,8 @@ struct pdb_methods
BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid,
uint32 *rid);
+ BOOL (*uid_to_sid)(struct pdb_methods *methods, uid_t uid,
+ DOM_SID *sid);
BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid,
DOM_SID *sid);
BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid,
diff --git a/source3/include/smb.h b/source3/include/smb.h
index aefc06548e..0e06ce1d79 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -273,6 +273,22 @@ typedef struct dom_sid {
#define dom_sid2 dom_sid
#define dom_sid28 dom_sid
+enum id_type {
+ ID_TYPE_UID,
+ ID_TYPE_GID
+};
+
+struct unixid {
+ uint32_t id;
+ enum id_type type;
+};
+
+struct id_map {
+ DOM_SID *sid;
+ struct unixid xid;
+ BOOL mapped;
+};
+
#include "librpc/ndr/misc.h"
#include "librpc/ndr/security.h"
#include "librpc/ndr/libndr.h"
diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h
index ae54e66b36..b261ca82fd 100644
--- a/source3/include/smbldap.h
+++ b/source3/include/smbldap.h
@@ -158,8 +158,12 @@ struct smbldap_state {
time_t last_ping;
/* retrive-once info */
const char *uri;
+
+ /* credentials */
+ BOOL anonimous;
char *bind_dn;
char *bind_secret;
+
BOOL paged_results;
unsigned int num_failures;