summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-28 17:36:12 +0200
committerVolker Lendecke <vl@samba.org>2009-06-28 22:13:50 +0200
commit711544d4943a40649b6c590f8ee003093081889a (patch)
treeafee8fcd95e3a9b3844dccd9cb11b2418cf67fd8 /source3/passdb
parent325a58a6532e2a9bc7b8e21d55c9b1ccfb879bf9 (diff)
downloadsamba-711544d4943a40649b6c590f8ee003093081889a.tar.gz
samba-711544d4943a40649b6c590f8ee003093081889a.tar.bz2
samba-711544d4943a40649b6c590f8ee003093081889a.zip
Turn the pdb_rid_algorithm into a capabilities call that returns flags
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c2
-rw-r--r--source3/passdb/pdb_ads.c6
-rw-r--r--source3/passdb/pdb_interface.c12
-rw-r--r--source3/passdb/pdb_ldap.c6
-rw-r--r--source3/passdb/pdb_smbpasswd.c6
-rw-r--r--source3/passdb/pdb_tdb.c6
6 files changed, 19 insertions, 19 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 8efd6592dd..502c3728a3 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -207,7 +207,7 @@ static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *p
initialized and will fill in these fields later (such as from a
netr_SamInfo3 structure) */
- if ( create && !pdb_rid_algorithm() ) {
+ if ( create && (pdb_capabilities() & PDB_CAP_STORE_RIDS)) {
uint32 user_rid;
DOM_SID user_sid;
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index cdde30dcdc..b7c42c58c9 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -1920,9 +1920,9 @@ static bool pdb_ads_sid_to_id(struct pdb_methods *m, const DOM_SID *sid,
return false;
}
-static bool pdb_ads_rid_algorithm(struct pdb_methods *m)
+static uint32_t pdb_ads_capabilities(struct pdb_methods *m)
{
- return false;
+ return PDB_CAP_STORE_RIDS;
}
static bool pdb_ads_new_rid(struct pdb_methods *m, uint32 *rid)
@@ -2005,7 +2005,7 @@ static void pdb_ads_init_methods(struct pdb_methods *m)
m->uid_to_sid = pdb_ads_uid_to_sid;
m->gid_to_sid = pdb_ads_gid_to_sid;
m->sid_to_id = pdb_ads_sid_to_id;
- m->rid_algorithm = pdb_ads_rid_algorithm;
+ m->capabilities = pdb_ads_capabilities;
m->new_rid = pdb_ads_new_rid;
m->get_trusteddom_pw = pdb_ads_get_trusteddom_pw;
m->set_trusteddom_pw = pdb_ads_set_trusteddom_pw;
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index 6fe0979a50..a72409ea4a 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -574,12 +574,12 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods,
return NT_STATUS_ACCESS_DENIED;
}
- if (pdb_rid_algorithm()) {
- *rid = algorithmic_pdb_gid_to_group_rid( grp->gr_gid );
- } else {
+ if (pdb_capabilities() & PDB_CAP_STORE_RIDS) {
if (!pdb_new_rid(rid)) {
return NT_STATUS_ACCESS_DENIED;
}
+ } else {
+ *rid = algorithmic_pdb_gid_to_group_rid( grp->gr_gid );
}
sid_compose(&group_sid, get_global_sam_sid(), *rid);
@@ -1043,10 +1043,10 @@ bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,
return pdb->sid_to_id(pdb, sid, id, type);
}
-bool pdb_rid_algorithm(void)
+uint32_t pdb_capabilities(void)
{
struct pdb_methods *pdb = pdb_get_methods();
- return pdb->rid_algorithm(pdb);
+ return pdb->capabilities(pdb);
}
/********************************************************************
@@ -1065,7 +1065,7 @@ bool pdb_new_rid(uint32 *rid)
int i;
TALLOC_CTX *ctx;
- if (pdb_rid_algorithm()) {
+ if ((pdb_capabilities() & PDB_CAP_STORE_RIDS) == 0) {
DEBUG(0, ("Trying to allocate a RID when algorithmic RIDs "
"are active\n"));
return False;
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index dddde75a4e..c2230eb982 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -4728,9 +4728,9 @@ static bool ldapsam_search_aliases(struct pdb_methods *methods,
return ldapsam_search_grouptype(methods, search, sid, SID_NAME_ALIAS);
}
-static bool ldapsam_rid_algorithm(struct pdb_methods *methods)
+static uint32_t ldapsam_capabilities(struct pdb_methods *methods)
{
- return False;
+ return PDB_CAP_STORE_RIDS;
}
static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
@@ -6154,7 +6154,7 @@ static NTSTATUS pdb_init_ldapsam_common(struct pdb_methods **pdb_method, const c
(*pdb_method)->get_seq_num = ldapsam_get_seq_num;
- (*pdb_method)->rid_algorithm = ldapsam_rid_algorithm;
+ (*pdb_method)->capabilities = ldapsam_capabilities;
(*pdb_method)->new_rid = ldapsam_new_rid;
(*pdb_method)->get_trusteddom_pw = ldapsam_get_trusteddom_pw;
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index 8074b2e3a1..cac95c40a9 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -1520,9 +1520,9 @@ done:
return (ret);
}
-static bool smbpasswd_rid_algorithm(struct pdb_methods *methods)
+static uint32_t smbpasswd_capabilities(struct pdb_methods *methods)
{
- return True;
+ return 0;
}
static void free_private_data(void **vp)
@@ -1682,7 +1682,7 @@ static NTSTATUS pdb_init_smbpasswd( struct pdb_methods **pdb_method, const char
(*pdb_method)->rename_sam_account = smbpasswd_rename_sam_account;
(*pdb_method)->search_users = smbpasswd_search_users;
- (*pdb_method)->rid_algorithm = smbpasswd_rid_algorithm;
+ (*pdb_method)->capabilities = smbpasswd_capabilities;
/* Setup private data and free function */
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index dd6e678c99..4d2a1d830a 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -1066,9 +1066,9 @@ static NTSTATUS tdbsam_rename_sam_account(struct pdb_methods *my_methods,
return NT_STATUS_ACCESS_DENIED;
}
-static bool tdbsam_rid_algorithm(struct pdb_methods *methods)
+static uint32_t tdbsam_capabilities(struct pdb_methods *methods)
{
- return False;
+ return PDB_CAP_STORE_RIDS;
}
static bool tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid)
@@ -1246,7 +1246,7 @@ static NTSTATUS pdb_init_tdbsam(struct pdb_methods **pdb_method, const char *loc
(*pdb_method)->rename_sam_account = tdbsam_rename_sam_account;
(*pdb_method)->search_users = tdbsam_search_users;
- (*pdb_method)->rid_algorithm = tdbsam_rid_algorithm;
+ (*pdb_method)->capabilities = tdbsam_capabilities;
(*pdb_method)->new_rid = tdbsam_new_rid;
/* save the path for later */