SCM_RIGHTS: XTrans vs ssh forwarding with MIT-SHM clients

Alan Coopersmith alan.coopersmith at oracle.com
Wed Jan 18 20:56:51 UTC 2023


Solaris only has getpeerucred(), not getpeereid(), so this hasn't affected us.

	-alan-

On 1/18/23 11:43, Jeremy Huddleston Sequoia wrote:
> After implementing DetermineClientCmd for darwin 
> (https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1040 
> <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1040>), we still 
> have an issue.  We still do not know the pid of the peer (which we need to pass 
> DetermineClientCmd).
> 
> We expect to determine the pid in GetLocalClientCreds().  Looking into that 
> function, I expect it to be failing on other UNIX as well. GetLocalClientCreds() 
> prefers getpeereid() if getpeereid() is available. getpeereid(), however, only 
> returns uid and gid.  If getpeereid() is not available, the implementation will 
> try 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 getpeereid() is 
> NOT available and getpeerucred() or SO_PEERCRED are available.
> 
> Am I missing something?  How is this ssh detection working on other UNIX systems 
> that have getpeereid right now (or is it not)?.
> 
>> On Jan 17, 2023, at 01:06, Jeremy Huddleston Sequoia <jeremyhu at apple.com> wrote:
>>
>> Yep, thanks for the pointer.  Looks like DetermineClientCmd() needs to be 
>> implemented for darwin.
>>
>>> On Jan 16, 2023, at 01:14, Michel Dänzer <michel at daenzer.net> wrote:
>>>
>>> On 1/16/23 06:31, Jeremy Huddleston Sequoia wrote:
>>>>
>>>> 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?
>>>
>>> ComputeLocalClient attempts to detect SSH clients and treats them as 
>>> non-local. Maybe this isn't working on macos for some reason?
>>>
>>>
>>> -- 
>>> Earthling Michel Dänzer            |                  https://redhat.com
>>> Libre software enthusiast          |         Mesa and Xwayland developer
>>>
>>
> 

-- 
         -Alan Coopersmith-                 alan.coopersmith at oracle.com
          Oracle Solaris Engineering - https://blogs.oracle.com/solaris



More information about the xorg-devel mailing list