]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbind:varlink: Always reply with the requested username
authorSamuel Cabrero <scabrero@samba.org>
Fri, 7 Feb 2025 15:10:47 +0000 (16:10 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 20 Feb 2025 09:05:46 +0000 (09:05 +0000)
The service io.systemd.Multiplexer will drop responses if the username in the
response does not match the requested name. This happens when the requested
username is an UPN and the response is a down-level user name (DOMAIN\user).

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 20 09:05:46 UTC 2025 on atb-devel-224

source3/winbindd/winbindd_varlink_getuserrecord.c

index bd2cd1844d29a19ce77f7e272cffa7825fa1a8ab..ea9ece94c81e85ebd55f65f9084f42b2afd1673d 100644 (file)
@@ -583,6 +583,11 @@ static void user_by_name_getpwnam_done(struct tevent_req *req)
                goto out;
        }
 
+       // The systemd multiplexer service expects the returned username to
+       // match the requested one. If we were asked for an UPN like
+       // user1@aforest.ad don't reply with AFOREST\\user1 or the record will
+       // be ignored.
+       fstrcpy(response->data.pw.pw_name, s->fake_req->data.username);
        user_record_reply(s->call, &response->data.pw, false);
 out:
        TALLOC_FREE(s);