summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2013-05-27 12:24:22 +0200
committerMichael Adam <obnox@samba.org>2013-06-21 10:44:19 +0200
commit0ad38d777f442b5da10c39c9c5695c4d857d7141 (patch)
tree22e761a5661b321999b1d7b375856e94a681c8c1
parent9eb67f259f91e31dfb6a7abf2b42ec8a4ce9f837 (diff)
downloadsamba-0ad38d777f442b5da10c39c9c5695c4d857d7141.tar.gz
samba-0ad38d777f442b5da10c39c9c5695c4d857d7141.tar.bz2
samba-0ad38d777f442b5da10c39c9c5695c4d857d7141.zip
s3:passdb add pdb_*_is_responsible_for* functions
allows PDB modules to specify for which special domains they are responsible when it comes to SID->xid conversion By default, passdb modules will be responsible for local BUILTIN, local SAM and Unix Users/Groups Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Christian Ambach <ambi@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/include/passdb.h5
-rw-r--r--source3/passdb/ABI/pdb-0.sigs5
-rw-r--r--source3/passdb/pdb_interface.c74
3 files changed, 84 insertions, 0 deletions
diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index e032ae1014..793c7667cc 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -934,6 +934,11 @@ NTSTATUS pdb_enum_upn_suffixes(TALLOC_CTX *mem_ctx,
NTSTATUS pdb_set_upn_suffixes(uint32_t num_suffixes,
const char **suffixes);
+bool pdb_is_responsible_for_our_sam(void);
+bool pdb_is_responsible_for_builtin(void);
+bool pdb_is_responsible_for_wellknown(void);
+bool pdb_is_responsible_for_unix_users(void);
+bool pdb_is_responsible_for_unix_groups(void);
/* The following definitions come from passdb/pdb_util.c */
diff --git a/source3/passdb/ABI/pdb-0.sigs b/source3/passdb/ABI/pdb-0.sigs
index 51810efeca..09563f5089 100644
--- a/source3/passdb/ABI/pdb-0.sigs
+++ b/source3/passdb/ABI/pdb-0.sigs
@@ -90,6 +90,11 @@ pdb_default_get_aliasinfo: NTSTATUS (struct pdb_methods *, const struct dom_sid
pdb_default_getgrgid: NTSTATUS (struct pdb_methods *, GROUP_MAP *, gid_t)
pdb_default_getgrnam: NTSTATUS (struct pdb_methods *, GROUP_MAP *, const char *)
pdb_default_getgrsid: NTSTATUS (struct pdb_methods *, GROUP_MAP *, struct dom_sid)
+pdb_is_responsible_for_our_sam: bool (void)
+pdb_is_responsible_for_builtin: bool (void)
+pdb_is_responsible_for_wellknown: bool (void)
+pdb_is_responsible_for_unix_users: bool (void)
+pdb_is_responsible_for_unix_groups: bool (void)
pdb_default_set_aliasinfo: NTSTATUS (struct pdb_methods *, const struct dom_sid *, struct acct_info *)
pdb_default_update_group_mapping_entry: NTSTATUS (struct pdb_methods *, GROUP_MAP *)
pdb_del_aliasmem: NTSTATUS (const struct dom_sid *, const struct dom_sid *)
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 36dde6f8e6..b45b4d66bb 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -2374,6 +2374,69 @@ NTSTATUS pdb_set_upn_suffixes(uint32_t num_suffixes,
}
/*******************************************************************
+ idmap control methods
+ *******************************************************************/
+static bool pdb_default_is_responsible_for_our_sam(
+ struct pdb_methods *methods)
+{
+ return true;
+}
+
+static bool pdb_default_is_responsible_for_builtin(
+ struct pdb_methods *methods)
+{
+ return true;
+}
+
+static bool pdb_default_is_responsible_for_wellknown(
+ struct pdb_methods *methods)
+{
+ return false;
+}
+
+static bool pdb_default_is_responsible_for_unix_users(
+ struct pdb_methods *methods)
+{
+ return true;
+}
+
+static bool pdb_default_is_responsible_for_unix_groups(
+ struct pdb_methods *methods)
+{
+ return true;
+}
+
+bool pdb_is_responsible_for_our_sam(void)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->is_responsible_for_our_sam(pdb);
+}
+
+bool pdb_is_responsible_for_builtin(void)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->is_responsible_for_builtin(pdb);
+}
+
+bool pdb_is_responsible_for_wellknown(void)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->is_responsible_for_wellknown(pdb);
+}
+
+bool pdb_is_responsible_for_unix_users(void)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->is_responsible_for_unix_users(pdb);
+}
+
+bool pdb_is_responsible_for_unix_groups(void)
+{
+ struct pdb_methods *pdb = pdb_get_methods();
+ return pdb->is_responsible_for_unix_groups(pdb);
+}
+
+/*******************************************************************
secret methods
*******************************************************************/
@@ -2523,5 +2586,16 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods )
(*methods)->enum_upn_suffixes = pdb_default_enum_upn_suffixes;
(*methods)->set_upn_suffixes = pdb_default_set_upn_suffixes;
+ (*methods)->is_responsible_for_our_sam =
+ pdb_default_is_responsible_for_our_sam;
+ (*methods)->is_responsible_for_builtin =
+ pdb_default_is_responsible_for_builtin;
+ (*methods)->is_responsible_for_wellknown =
+ pdb_default_is_responsible_for_wellknown;
+ (*methods)->is_responsible_for_unix_users =
+ pdb_default_is_responsible_for_unix_users;
+ (*methods)->is_responsible_for_unix_groups =
+ pdb_default_is_responsible_for_unix_groups;
+
return NT_STATUS_OK;
}