<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>After implementing <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">DetermineClientCmd for darwin (</span><a href="https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1040">https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1040</a><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">), we still have an issue. We still do not know the pid of the peer (which we need to pass </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">DetermineClientCmd).</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></span></div><div><font color="#000000">We expect to determine the pid in GetLocalClientCreds(). Looking into that function, I expect it to be failing on other UNIX as well. </font><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">GetLocalClientCreds() prefers </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeereid() if </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeereid() is available. </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeereid(), however, only returns uid and gid. If </span><font color="#000000"><span style="caret-color: rgb(0, 0, 0);">getpeereid() is not available, the implementation will try </span></font><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeerucred() or SO_PEERCRED (both of which *DO* return the pid in addition to uid/gid). So it looks like this should only be working if </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeereid() is NOT available and </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeerucred() or </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">SO_PEERCRED</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> are available.</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Am I missing something? How is </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">this ssh detection working on other UNIX systems that have </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">getpeereid </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">right now (or is it not)?.</span></div><div><div><br><blockquote type="cite"><div>On Jan 17, 2023, at 01:06, Jeremy Huddleston Sequoia <jeremyhu@apple.com> wrote:</div><br class="Apple-interchange-newline"><div><div>Yep, thanks for the pointer. Looks like DetermineClientCmd() needs to be implemented for darwin.<br><br><blockquote type="cite">On Jan 16, 2023, at 01:14, Michel Dänzer <michel@daenzer.net> wrote:<br><br>On 1/16/23 06:31, Jeremy Huddleston Sequoia wrote:<br><blockquote type="cite"><br>How should this work? Why hasn't this been reported as an issue on other platforms? This all seems pretty platform agnostic, so I'd expect this to be an issue on other platforms as well. Is it not? If not, why not?<br></blockquote><br>ComputeLocalClient attempts to detect SSH clients and treats them as non-local. Maybe this isn't working on macos for some reason?<br><br><br>-- <br>Earthling Michel Dänzer | https://redhat.com<br>Libre software enthusiast | Mesa and Xwayland developer<br><br></blockquote><br></div></div></blockquote></div><br></div></body></html>