]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbind:varlink: Print varlink replies
authorSamuel Cabrero <scabrero@samba.org>
Fri, 7 Feb 2025 14:18:45 +0000 (15:18 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 20 Feb 2025 08:07:32 +0000 (08:07 +0000)
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/winbindd_varlink_getgrouprecord.c
source3/winbindd/winbindd_varlink_getmemberships.c
source3/winbindd/winbindd_varlink_getuserrecord.c

index 794a3c57ba60b4d088beb8911763e7ea9422aba5..1514079398ac550da440d651d65713552772c09a 100644 (file)
@@ -70,6 +70,16 @@ static void group_record_reply(VarlinkCall *call,
        WB_VL_ERR_CHECK_GOTO(varlink_object_set_object(
                out, "record", record), err_free_out);
 
+       if (CHECK_DEBUGLVL(DBGLVL_DEBUG)) {
+               char *json = NULL;
+               varlink_object_to_json(out, &json);
+               if (json != NULL) {
+                       DBG_DEBUG("Sending group record reply (continues='%s'): '%s'",
+                                 continues ? "y":"n", json);
+                       free(json);
+               }
+       }
+
        varlink_call_reply(call, out, continues ? VARLINK_REPLY_CONTINUES : 0);
        varlink_object_unref(out);
        return;
index 14c91fa344bba65ee460fa6ff9fe7ee6e8169906..d917072a0ccbd08691acec4ae7fbe6fd084cc260 100644 (file)
@@ -34,6 +34,17 @@ static void membership_reply(VarlinkCall *call,
                out, "userName", username), err_free_out);
        WB_VL_ERR_CHECK_GOTO(varlink_object_set_string(
                out, "groupName", groupname), err_free_out);
+
+       if (CHECK_DEBUGLVL(DBGLVL_DEBUG)) {
+               char *json = NULL;
+               varlink_object_to_json(out, &json);
+               if (json != NULL) {
+                       DBG_DEBUG("Sending membership reply (continues='%s'): '%s'",
+                                 continues ? "y":"n", json);
+                       free(json);
+               }
+       }
+
        varlink_call_reply(call, out, continues ? VARLINK_REPLY_CONTINUES : 0);
 
 err_free_out:
index a8051c97d0794e618b47309f640c4def8ac1f972..bd2cd1844d29a19ce77f7e272cffa7825fa1a8ab 100644 (file)
@@ -57,6 +57,15 @@ user_record_reply(VarlinkCall *call, struct winbindd_pw *pw, bool continues)
        WB_VL_ERR_CHECK_GOTO(varlink_object_set_bool(out, "incomplete", false), err_free_out);
        WB_VL_ERR_CHECK_GOTO(varlink_object_set_object(out, "record", record), err_free_out);
 
+       if (CHECK_DEBUGLVL(DBGLVL_DEBUG)) {
+               char *json = NULL;
+               varlink_object_to_json(out, &json);
+               if (json != NULL) {
+                       DBG_DEBUG("Sending user record reply: '%s'", json);
+                       free(json);
+               }
+       }
+
        varlink_call_reply(call, out, continues ? VARLINK_REPLY_CONTINUES : 0);
        varlink_object_unref(out);
        return;