summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-20 10:28:03 +0200
committerMichael Adam <obnox@samba.org>2010-08-14 02:10:36 +0200
commit95617a03db896a2ac2051f74e7d7ba1209fbc61b (patch)
tree5e8b2368fbffef1fe4d953af6f0f72c081ba0008
parente2968160a4649573e7820b72589042e4208ccee8 (diff)
downloadsamba-95617a03db896a2ac2051f74e7d7ba1209fbc61b.tar.gz
samba-95617a03db896a2ac2051f74e7d7ba1209fbc61b.tar.bz2
samba-95617a03db896a2ac2051f74e7d7ba1209fbc61b.zip
s3:idmap: remove idmap_new_mapping() - now implemented in the backends
-rw-r--r--source3/winbindd/idmap.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index d6f37b80b9..a0c083c248 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -646,74 +646,6 @@ NTSTATUS idmap_allocate_gid(struct unixid *id)
return ctx->methods->allocate_id(id);
}
-NTSTATUS idmap_new_mapping(const struct dom_sid *psid, enum id_type type,
- struct unixid *pxid)
-{
- struct dom_sid sid;
- struct idmap_domain *dom;
- struct id_map map;
- NTSTATUS status;
-
- dom = idmap_find_domain(NULL);
- if (dom == NULL) {
- DEBUG(3, ("no default domain, no place to write\n"));
- return NT_STATUS_ACCESS_DENIED;
- }
- if (dom->methods->set_mapping == NULL) {
- DEBUG(3, ("default domain not writable\n"));
- return NT_STATUS_MEDIA_WRITE_PROTECTED;
- }
-
- sid_copy(&sid, psid);
- map.sid = &sid;
- map.xid.type = type;
-
- switch (type) {
- case ID_TYPE_UID:
- status = idmap_allocate_uid(&map.xid);
- break;
- case ID_TYPE_GID:
- status = idmap_allocate_gid(&map.xid);
- break;
- default:
- status = NT_STATUS_INVALID_PARAMETER;
- break;
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(3, ("Could not allocate id: %s\n", nt_errstr(status)));
- return status;
- }
-
- map.status = ID_MAPPED;
-
- DEBUG(10, ("Setting mapping: %s <-> %s %lu\n",
- sid_string_dbg(map.sid),
- (map.xid.type == ID_TYPE_UID) ? "UID" : "GID",
- (unsigned long)map.xid.id));
-
- status = dom->methods->set_mapping(dom, &map);
-
- if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
- struct id_map *ids[2];
- DEBUG(5, ("Mapping for %s exists - retrying to map sid\n",
- sid_string_dbg(map.sid)));
- ids[0] = &map;
- ids[1] = NULL;
- status = dom->methods->sids_to_unixids(dom, ids);
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- DEBUG(3, ("Could not store the new mapping: %s\n",
- nt_errstr(status)));
- return status;
- }
-
- *pxid = map.xid;
-
- return NT_STATUS_OK;
-}
-
NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id)
{
struct idmap_domain *dom;