diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-08-08 19:29:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:36 -0500 |
commit | e1e62d89999629d41cc2b66b12eb37ce190d5db0 (patch) | |
tree | bb9732660ea085b6f13b1ddfa7140243e4624410 /source3/passdb | |
parent | be72e2de59b984bccd2e84e658bbbef379e6f13c (diff) | |
download | samba-e1e62d89999629d41cc2b66b12eb37ce190d5db0.tar.gz samba-e1e62d89999629d41cc2b66b12eb37ce190d5db0.tar.bz2 samba-e1e62d89999629d41cc2b66b12eb37ce190d5db0.zip |
r17463: A bit of cleanup work:
Remove some unused code: pdb_find_alias is not used anymore, and nobody I
think has ever used the pdb_nop operations for group mapping. smbpasswd and
tdb use the default ones and ldap has its own.
Make the functions pdb_getgr* return NTSTATUS instead of BOOL. Nobody right
now really makes use of it, but it feels wrong to throw away information so
early.
Volker
(This used to be commit f9856f6490fe44fdba97ea86062237d8c74d4bdc)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/lookup_sid.c | 4 | ||||
-rw-r--r-- | source3/passdb/passdb.c | 2 | ||||
-rw-r--r-- | source3/passdb/pdb_interface.c | 21 |
3 files changed, 10 insertions, 17 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index f6c15168a9..acfccfdd26 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -142,7 +142,7 @@ BOOL lookup_name(TALLOC_CTX *mem_ctx, GROUP_MAP map; - if (pdb_getgrgid(&map, grp->gr_gid)) { + if (NT_STATUS_IS_OK(pdb_getgrgid(&map, grp->gr_gid))) { /* The hack gets worse. Handle the case where we have * 'force group = +unixgroup' but "unixgroup" has a * group mapping */ @@ -1352,7 +1352,7 @@ BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid) if ((sid_check_is_in_builtin(psid) || sid_check_is_in_wellknown_domain(psid))) { - if (pdb_getgrsid(&map, psid)) { + if (NT_STATUS_IS_OK(pdb_getgrsid(&map, psid))) { *pgid = map.gid; goto done; } diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index f74b1fbe3b..ab8844f599 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -604,7 +604,7 @@ BOOL lookup_global_sam_name(const char *user, int flags, uint32_t *rid, */ become_root(); - ret = pdb_getgrnam(&map, user); + ret = NT_STATUS_IS_OK(pdb_getgrnam(&map, user)); unbecome_root(); if (!ret) { diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 4e30f92acf..6a9d072fbb 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -561,22 +561,22 @@ NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, BOOL success) return pdb->update_login_attempts(pdb, sam_acct, success); } -BOOL pdb_getgrsid(GROUP_MAP *map, const DOM_SID *sid) +NTSTATUS pdb_getgrsid(GROUP_MAP *map, const DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb->getgrsid(pdb, map, sid)); + return pdb->getgrsid(pdb, map, sid); } -BOOL pdb_getgrgid(GROUP_MAP *map, gid_t gid) +NTSTATUS pdb_getgrgid(GROUP_MAP *map, gid_t gid) { struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb->getgrgid(pdb, map, gid)); + return pdb->getgrgid(pdb, map, gid); } -BOOL pdb_getgrnam(GROUP_MAP *map, const char *name) +NTSTATUS pdb_getgrnam(GROUP_MAP *map, const char *name) { struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb->getgrnam(pdb, map, name)); + return pdb->getgrnam(pdb, map, name); } static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods, @@ -920,12 +920,6 @@ NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid, return pdb->del_groupmem(pdb, mem_ctx, group_rid, member_rid); } -BOOL pdb_find_alias(const char *name, DOM_SID *sid) -{ - struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb->find_alias(pdb, name, sid)); -} - NTSTATUS pdb_create_alias(const char *name, uint32 *rid) { struct pdb_methods *pdb = pdb_get_methods(); @@ -1522,7 +1516,7 @@ static BOOL lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid, } TALLOC_FREE(sam_account); - ret = pdb_getgrsid(&map, &sid); + ret = NT_STATUS_IS_OK(pdb_getgrsid(&map, &sid)); unbecome_root(); /* END BECOME_ROOT BLOCK */ @@ -2032,7 +2026,6 @@ NTSTATUS make_pdb_method( struct pdb_methods **methods ) (*methods)->set_unix_primary_group = pdb_default_set_unix_primary_group; (*methods)->add_groupmem = pdb_default_add_groupmem; (*methods)->del_groupmem = pdb_default_del_groupmem; - (*methods)->find_alias = pdb_default_find_alias; (*methods)->create_alias = pdb_default_create_alias; (*methods)->delete_alias = pdb_default_delete_alias; (*methods)->get_aliasinfo = pdb_default_get_aliasinfo; |