s3:idmap: remove idmap_new_mapping() - now implemented in the backends
authorMichael Adam <obnox@samba.org>
Thu, 20 May 2010 08:28:03 +0000 (10:28 +0200)
committerMichael Adam <obnox@samba.org>
Sat, 14 Aug 2010 00:10:36 +0000 (02:10 +0200)
source3/winbindd/idmap.c

index d6f37b80b9084b721c83f38a3c0c9cc737fa809d..a0c083c24875d159758e8b011e7ca6f3122e6878 100644 (file)
@@ -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;