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/groupdb | |
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/groupdb')
-rw-r--r-- | source3/groupdb/mapping.c | 72 |
1 files changed, 4 insertions, 68 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 20bc63e56e..67b550680c 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -168,7 +168,7 @@ NTSTATUS map_unix_group(const struct group *grp, GROUP_MAP *pmap) const char *grpname, *dom, *name; uint32 rid; - if (pdb_getgrgid(&map, grp->gr_gid)) { + if (NT_STATUS_IS_OK(pdb_getgrgid(&map, grp->gr_gid))) { return NT_STATUS_GROUP_EXISTS; } @@ -811,7 +811,7 @@ BOOL get_domain_group_from_sid(const DOM_SID *sid, GROUP_MAP *map) /* if the group is NOT in the database, it CAN NOT be a domain group */ become_root(); - ret = pdb_getgrsid(map, sid); + ret = NT_STATUS_IS_OK(pdb_getgrsid(map, sid)); unbecome_root(); /* special case check for rid 513 */ @@ -1048,22 +1048,6 @@ NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; } -NTSTATUS pdb_default_find_alias(struct pdb_methods *methods, - const char *name, DOM_SID *sid) -{ - GROUP_MAP map; - - if (!pdb_getgrnam(&map, name)) - return NT_STATUS_NO_SUCH_ALIAS; - - if ((map.sid_name_use != SID_NAME_WKN_GRP) && - (map.sid_name_use != SID_NAME_ALIAS)) - return NT_STATUS_OBJECT_TYPE_MISMATCH; - - sid_copy(sid, &map.sid); - return NT_STATUS_OK; -} - NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, const char *name, uint32 *rid) { @@ -1138,7 +1122,7 @@ NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, { GROUP_MAP map; - if (!pdb_getgrsid(&map, sid)) + if (!NT_STATUS_IS_OK(pdb_getgrsid(&map, sid))) return NT_STATUS_NO_SUCH_ALIAS; if ((map.sid_name_use != SID_NAME_ALIAS) && @@ -1161,7 +1145,7 @@ NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, { GROUP_MAP map; - if (!pdb_getgrsid(&map, sid)) + if (!NT_STATUS_IS_OK(pdb_getgrsid(&map, sid))) return NT_STATUS_NO_SUCH_ALIAS; fstrcpy(map.nt_name, info->acct_name); @@ -1228,54 +1212,6 @@ NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, return NT_STATUS_OK; } -/********************************************************************** - no ops for passdb backends that don't implement group mapping - *********************************************************************/ - -NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid) -{ - return NT_STATUS_UNSUCCESSFUL; -} - -NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, - gid_t gid) -{ - return NT_STATUS_UNSUCCESSFUL; -} - -NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, - const char *name) -{ - return NT_STATUS_UNSUCCESSFUL; -} - -NTSTATUS pdb_nop_add_group_mapping_entry(struct pdb_methods *methods, - GROUP_MAP *map) -{ - return NT_STATUS_UNSUCCESSFUL; -} - -NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, - GROUP_MAP *map) -{ - return NT_STATUS_UNSUCCESSFUL; -} - -NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid) -{ - return NT_STATUS_UNSUCCESSFUL; -} - -NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, - enum SID_NAME_USE sid_name_use, - GROUP_MAP **rmap, size_t *num_entries, - BOOL unix_only) -{ - return NT_STATUS_UNSUCCESSFUL; -} - /**************************************************************************** These need to be redirected through pdb_interface.c ****************************************************************************/ |