Web lists-archives.com

Re: Logging-in using ssh elevates the user privilege.




Hi Corinna,

On Fri, 8 Mar 2019 15:11:18 +0100 Corinna Vinschen wrote:
>   setsockopt (sock, SOL_SOCKET, SO_PEERCRED, NULL, 0);
> before calling accept or connect.

I added this to the test code but it failed as:

Server: Created.
Server: Binded.
Server: Listened.
Client: Created.
Client: Connected.
Client: Written.
accept: Software caused connection abort

Of course, setsockopt() was added also before connect().

So, I moved the setsockopt() from just before accept()
to just before listen(), then it  succeeded.

Server: Created.
Server: Binded.
Server: Listened.
Client: Created.
Client: Connected.
Client: Written.
Server: Accepted.
10: 1234567890
Server: Read.

Does this affect to listen() as well?

-- 
Takashi Yano <takashi.yano@xxxxxxxxxxx>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple