Bug 16281 - winbindd: set_remote_addresses() fails on illumos, every request to a domain child is denied
Summary: winbindd: set_remote_addresses() fails on illumos, every request to a domain ...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.25.0
Hardware: x64 Solaris
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-10-17 14:55 UTC by Luca Lenardi
Modified: 2026-10-17 14:55 UTC (History)
0 users

See Also:


Attachments
Patches for master (4.58 KB, patch)
2026-10-17 14:55 UTC, Luca Lenardi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Lenardi 2026-10-17 14:55:04 UTC
On OpenIndiana (illumos) with Samba 4.25.0 as an AD domain member, winbindd
contacts the DC, but every request forwarded to a domain child fails:
wbinfo -t, -P and all user and group lookups fail. The child logs:

  winbindd_dual_ndr.c:492 set_remote_addresses: tsocket_address_bsd_from_sockaddr failed: NT_STATUS_ACCESS_DENIED

set_remote_addresses() calls getpeername() and getsockname() on the unnamed
AF_UNIX socketpair between the winbindd parent and the child. On illumos both
succeed with a zero length address (Linux returns the address family only,
length 2). tsocket_address_bsd_from_sockaddr() rejects an address shorter
than sa_family with EINVAL. The error path then passes the return value -1,
not errno, to map_nt_error_from_unix(), which maps unknown values to
NT_STATUS_ACCESS_DENIED, hence the misleading status.

The code is unchanged in current master. Two patches against master are
attached: the first passes errno, the second fills in AF_UNIX when the
returned address is shorter than the family.

Tested on OpenIndiana 2026.04 with current master (6365593b), winbindd from
the build tree joined to a Samba AD domain:
- master: wbinfo -P, -t, -n and -i fail, the log shows the error above;
- with the first patch: same failures, the log now says
  NT_STATUS_INVALID_PARAMETER;
- with both patches: wbinfo -P, -t, -n and -i succeed and set_remote_addresses
  logs nothing.
The same changes applied to 4.25.0 are in production since 2026-10-06
(Windows clients): net ads testjoin, wbinfo -t/-P/-r, id and getent.
Comment 1 Luca Lenardi 2026-10-17 14:55:50 UTC
Created attachment 19298 [details]
Patches for master