s3:winbindd: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>
Mon, 31 May 2010 15:34:02 +0000 (17:34 +0200)
source3/winbindd/idmap.c

index c1455a544ec7b329a462acd64f713628303b52d8..d9c0a791eb0549fc6d96bd1c471fef90eaa6bf1e 100644 (file)
@@ -631,74 +631,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;