some more debugging in case of failure
authorSimo Sorce <idra@samba.org>
Tue, 8 Apr 2003 10:46:46 +0000 (10:46 +0000)
committerSimo Sorce <idra@samba.org>
Tue, 8 Apr 2003 10:46:46 +0000 (10:46 +0000)
(This used to be commit 9374f8692f6587b5f773c72b7847b64edeee9614)

source3/sam/idmap.c
source3/sam/idmap_tdb.c

index 00b45565bb01bd449ee8e6b38b36dd678ce9b612..06fcc5a9566567705005f55c3add35a95195f3ac 100644 (file)
@@ -91,6 +91,7 @@ NTSTATUS idmap_set_mapping(const DOM_SID *sid, unid_t id, int id_type)
        ret = local_map->set_mapping(sid, id, id_type);
        if (NT_STATUS_IS_ERR(ret)) {
                DEBUG (0, ("idmap_set_mapping: Error, unable to modify local cache!\n"));
+               DEBUGADD(0, ("Error num. %d", NT_STATUS_V(ret)));
                return ret;
        }
 
@@ -100,6 +101,7 @@ NTSTATUS idmap_set_mapping(const DOM_SID *sid, unid_t id, int id_type)
                remote_map->set_mapping(sid, id, id_type);
                if (NT_STATUS_IS_ERR(ret)) {
                        DEBUG (0, ("idmap_set_mapping: Error, unable to modify remote cache!\n"));
+                       DEBUGADD(0, ("Error num. %d", NT_STATUS_V(ret)));
                }
        }
 
index 8ecf4d6e7eff49923b67237db5435b1df75a939b..7080ac56e6cb9004acdd01cf35ffc64dbbe1c750 100644 (file)
@@ -224,7 +224,6 @@ static NTSTATUS db_set_mapping(DOM_SID *sid, unid_t id, int id_type)
        ksid.dptr = ksidstr;
        ksid.dsize = strlen(ksidstr) + 1;
 
-       id_type &= ID_TYPEMASK;
        if (id_type & ID_USERID) {
                slprintf(kidstr, sizeof(kidstr), "UID %d", id.uid);
        } else if (id_type & ID_GROUPID) {
@@ -237,11 +236,11 @@ static NTSTATUS db_set_mapping(DOM_SID *sid, unid_t id, int id_type)
        kid.dsize = strlen(kidstr) + 1;
 
        if (tdb_store(idmap_tdb, ksid, kid, TDB_INSERT) == -1) {
-               /* TODO: print tdb error !! */
+               DEBUG(0, ("idb_set_mapping: tdb_store 1 error: %s", tdb_errorstr(idmap_tdb)));
                return NT_STATUS_UNSUCCESSFUL;
        }
        if (tdb_store(idmap_tdb, kid, ksid, TDB_INSERT) == -1) {
-               /* TODO: print tdb error !! */
+               DEBUG(0, ("idb_set_mapping: tdb_store 2 error: %s", tdb_errorstr(idmap_tdb)));
                return NT_STATUS_UNSUCCESSFUL;
        }
        return NT_STATUS_OK;