Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2021 21:27:48 +0300
From:      Gleb Popov <arrowd@freebsd.org>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: A bug with getsockopt(SOL_LOCAL, LOCAL_PEERCRED) ?
Message-ID:  <CALH631mi0xOQGjd6F3Beu_BQdqAx8RYCrbkUi524F8S4rwo1aA@mail.gmail.com>
In-Reply-To: <E6626DFC-2014-412C-AEA2-ECE57835B058@yahoo.com>
References:  <CALH631kLCApctk4iQJj6br0Pzeb6qsh9g3jz_SA8hH91ftQGDQ@mail.gmail.com> <YHiQ6qEjS2w8uYpS@kib.kiev.ua> <CALH631=3hqvfraume467OM%2BqGqp854sGJFfhO8b61mF%2BkbsJ2Q@mail.gmail.com> <E6626DFC-2014-412C-AEA2-ECE57835B058@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Apr 15, 2021 at 10:58 PM Mark Millard <marklmi@yahoo.com> wrote:

> The way I read the above quote and your code and
> related documentation: s2 after the accept4 assignment
> is specific to the client's specific connect and
> will give access to the connected user's credentials
> --but s is not specific to the specific connect in
> question (after that assignment or later) and would
> not give the information that you indicate that you
> want: you need a connection-specific identifier.
>
> In other words, it looks to me like what you quoted
> agrees with what Konstantin reported.
>
> ===
> Mark Millard
> marklmi at yahoo.com
> ( dsl-only.net went
> away in early 2018-Mar)
>
>
This makes sense, thanks.

However, this code works on Linux and seems to return credentials of the
user that started the process. I actually stumbled upon this when porting
this code:
https://github.com/CollaboraOnline/online/blob/master/net/Socket.cpp#L805

Would it make sense if FreeBSD followed Linux semantics in this case? If
not, what are my options for porting the software?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALH631mi0xOQGjd6F3Beu_BQdqAx8RYCrbkUi524F8S4rwo1aA>