1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

s3:passdb: remove the uid_to_rid method - we only need uid_to_sid

Michael
This commit is contained in:
Michael Adam 2009-11-14 01:06:35 +01:00
parent 3b7448de14
commit 30ab3a762e
5 changed files with 1 additions and 42 deletions

View File

@ -385,8 +385,6 @@ struct pdb_methods
struct pdb_search *search,
const DOM_SID *sid);
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,

View File

@ -4624,7 +4624,6 @@ NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value);
bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value);
bool pdb_get_seq_num(time_t *seq_num);
bool pdb_uid_to_rid(uid_t uid, uint32 *rid);
bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid);
bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid);
bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,

View File

@ -1129,19 +1129,16 @@ void store_gid_sid_cache(const DOM_SID *psid, gid_t gid)
static void legacy_uid_to_sid(DOM_SID *psid, uid_t uid)
{
uint32 rid;
bool ret;
ZERO_STRUCTP(psid);
become_root();
ret = pdb_uid_to_rid(uid, &rid);
ret = pdb_uid_to_sid(uid, psid);
unbecome_root();
if (ret) {
/* This is a mapped user */
sid_copy(psid, get_global_sam_sid());
sid_append_rid(psid, rid);
goto done;
}

View File

@ -1917,12 +1917,6 @@ static bool pdb_ads_search_aliases(struct pdb_methods *m,
return true;
}
static bool pdb_ads_uid_to_rid(struct pdb_methods *m, uid_t uid,
uint32 *rid)
{
return false;
}
static bool pdb_ads_uid_to_sid(struct pdb_methods *m, uid_t uid,
DOM_SID *sid)
{
@ -2072,7 +2066,6 @@ static void pdb_ads_init_methods(struct pdb_methods *m)
m->search_users = pdb_ads_search_users;
m->search_groups = pdb_ads_search_groups;
m->search_aliases = pdb_ads_search_aliases;
m->uid_to_rid = pdb_ads_uid_to_rid;
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;

View File

@ -1024,12 +1024,6 @@ bool pdb_get_seq_num(time_t *seq_num)
return NT_STATUS_IS_OK(pdb->get_seq_num(pdb, seq_num));
}
bool pdb_uid_to_rid(uid_t uid, uint32 *rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->uid_to_rid(pdb, uid, rid);
}
bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
@ -1229,27 +1223,6 @@ static bool pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid,
return True;
}
static bool pdb_default_uid_to_rid(struct pdb_methods *methods, uid_t uid,
uint32 *rid)
{
DOM_SID sid;
bool ret;
ret = pdb_default_uid_to_sid(methods, uid, &sid);
if (!ret) {
return ret;
}
ret = sid_peek_check_rid(get_global_sam_sid(), &sid, rid);
if (!ret) {
DEBUG(1, ("Could not peek rid out of sid %s\n",
sid_string_dbg(&sid)));
}
return ret;
}
static bool pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid,
DOM_SID *sid)
{
@ -2057,7 +2030,6 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods )
(*methods)->get_account_policy = pdb_default_get_account_policy;
(*methods)->set_account_policy = pdb_default_set_account_policy;
(*methods)->get_seq_num = pdb_default_get_seq_num;
(*methods)->uid_to_rid = pdb_default_uid_to_rid;
(*methods)->uid_to_sid = pdb_default_uid_to_sid;
(*methods)->gid_to_sid = pdb_default_gid_to_sid;
(*methods)->sid_to_id = pdb_default_sid_to_id;