TMP: extreme debugging in idmap_tdb_init_hwm
authorMichael Adam <obnox@samba.org>
Thu, 5 Feb 2015 15:42:32 +0000 (16:42 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 25 May 2016 10:33:51 +0000 (12:33 +0200)
source3/winbindd/idmap_tdb.c

index a04295f3abbf57d09b78050b9d283d8e1508473b..4df78d28b3a73a53e185e079d05aa3de587ff724 100644 (file)
@@ -229,13 +229,15 @@ static bool idmap_tdb_upgrade(struct idmap_domain *dom, struct db_context *db)
 
 static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
 {
-       uint32_t low_uid;
-       uint32_t low_gid;
+       uint32_t low_uid = 0;
+       uint32_t low_gid = 0;
        bool update_uid = false;
        bool update_gid = false;
        struct idmap_tdb_common_context *ctx;
        NTSTATUS status;
 
+DEBUG(0, ("OBNOX - idmap_tdb_init_hwm enter\n"));
+
        ctx = talloc_get_type(dom->private_data,
                              struct idmap_tdb_common_context);
 
@@ -244,11 +246,15 @@ static NTSTATUS idmap_tdb_init_hwm(struct idmap_domain *dom)
                update_uid = true;
        }
 
+DEBUG(0, ("OBNOX - idmap_tdb_init_hwm fetched hwm_user: %d (%s), resetting to %d: %s\n", (int)low_uid, nt_errstr(status), (int)dom->low_id, update_uid?"yes":"no"));
+
        status = dbwrap_fetch_uint32_bystring(ctx->db, HWM_GROUP, &low_gid);
        if (!NT_STATUS_IS_OK(status) || low_gid < dom->low_id) {
                update_gid = true;
        }
 
+DEBUG(0, ("OBNOX - idmap_tdb_init_hwm fetched hwm_group: %d (%s), resetting to %d: %s\n", (int)low_gid, nt_errstr(status), (int)dom->low_id, update_gid?"yes":"no"));
+
        if (!update_uid && !update_gid) {
                return NT_STATUS_OK;
        }
@@ -298,6 +304,8 @@ static NTSTATUS idmap_tdb_open_db(struct idmap_domain *dom)
        bool config_error = false;
        struct idmap_tdb_common_context *ctx;
 
+DEBUG(0, ("OBNOX - idmap_tdb_open_db enter\n"));
+
        ctx = talloc_get_type(dom->private_data,
                              struct idmap_tdb_common_context);