X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=ozB/2 vwNEa6UrDVrWwYkE+RZFEZfR9P1eezX1YV7pal2vqDgDr9OtOZso+9CzR7JQVxad +Hw7E7JIVzWvWweKtBndzT1H1GxvY4y+24OUhmIQKkSiDbuO2drlv9/QdK2XQ7Ch PQm2z0tFz7V42sa4Ll72gR1/4MAMXOYbtuEdy8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=r8tEqkOiM3A x5EK28GSP+fE9tQg=; b=HRbpBhVx6asxoCc4kPDYvEOxHLTtmjG+DAagZgsAnK0 P98CSJdhD0QnwNfIySTGPrOMYg1slq6DYcZjsOIUa0ogif09dCsCDKxrXuUs2/ax Ws7+/ik3FImim9695leRY/jV8PQeK8ve9D0Vu+oPdnq3MfSwq7rA2ZvW4GzXCWII = Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=screen, H*c:HHHH X-HELO: conssluserg-06.nifty.com DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x28EkWK4012357 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1552056393; bh=NkwT5KjRYMPlWaYt690JUE3Ccc4qPSoDroTNoINeg/Q=; h=Date:From:To:Subject:In-Reply-To:References:From; b=jXaAwbRlrGdXBZM4uzDK5IO7auSCJf7JlLh6JcmGRWiYUWXM5c3p4Q3oKP6eRsUE0 ylJycr4BiVzsH7BzknGi8m91OcSURuMIKYbAYKVKJLOQs3Lwy398QiTd9k9HifyykE eTgL85RIcsUGo3NpTm1j4pfHtXpBjJdx16VSvYavjX5DYjmoo9nau1uaWfvzzMvCMr 9lZDf9mnSYQtGsxPPiVE7T4CcCFhOSPNrwUn2EsxwBkHUIsVr4hvlZUSZFHyLqDtds 3BuyF68QueRJ/AFYcXb4stYvtcB0mLF6uauk2I4ubbwGEnNsbxJ8D4VUtlQVvakFYt boOHBf1+kxjyg== Date: Fri, 8 Mar 2019 23:46:38 +0900 From: Takashi Yano To: cygwin AT cygwin DOT com Subject: Re: Logging-in using ssh elevates the user privilege. Message-Id: <20190308234638.0ada919bc31803cf064ca720@nifty.ne.jp> In-Reply-To: <20190308141118.GM3785@calimero.vinschen.de> References: <20190307010000 DOT fc28b73739c2dd66e609982b AT nifty DOT ne DOT jp> <381052629 DOT 20190307141955 AT yandex DOT ru> <51233666 DOT 20190307182445 AT yandex DOT ru> <20190308230138 DOT b7f6b5ac90c9a14cde2647c1 AT nifty DOT ne DOT jp> <20190308141118 DOT GM3785 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__8_Mar_2019_23_46_38_+0900_V4cULbvE+HkFexGj" X-IsSubscribed: yes --Multipart=_Fri__8_Mar_2019_23_46_38_+0900_V4cULbvE+HkFexGj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Corinna, Thanks for your advice. On Fri, 8 Mar 2019 15:11:18 +0100 Corinna Vinschen wrote: > > In Linux, connect() in the client returns befor the > > server calls accept(). However, in cygwin, connect() > > does not return until the server calls accept(). > > This is a result of the handshake to exchange credentials for > getpeereid(). To workaround this issue, try building screen > with a tweak. Server and as client should call > > setsockopt (sock, SOL_SOCKET, SO_PEERCRED, NULL, 0); > > before calling accept or connect. Following your advice, I tried the patch attached and confirmed the problem regarding -Q option is solved. -- Takashi Yano --Multipart=_Fri__8_Mar_2019_23_46_38_+0900_V4cULbvE+HkFexGj Content-Type: application/octet-stream; name="screen-peercred.patch" Content-Disposition: attachment; filename="screen-peercred.patch" Content-Transfer-Encoding: base64 LS0tIG9yaWdzcmMvc2NyZWVuLTQuNi4yL3NvY2tldC5jCTIwMTctMTAtMjMg MjA6MzI6NDEuMDAwMDAwMDAwICswOTAwCisrKyBzcmMvc2NyZWVuLTQuNi4y L3NvY2tldC5jCTIwMTktMDMtMDggMjM6MzE6MTEuMzczNTkyNDAwICswOTAw CkBAIC01MzcsNiArNTM3LDkgQEAKICAgeHNldGV1aWQocmVhbF91aWQpOwog ICB4c2V0ZWdpZChyZWFsX2dpZCk7CiAjIGVuZGlmCisjaWZkZWYgX19DWUdX SU5fXworICBzZXRzb2Nrb3B0KHMsIFNPTF9TT0NLRVQsIFNPX1BFRVJDUkVE LCBOVUxMLCAwKTsKKyNlbmRpZgogICBpZiAoY29ubmVjdChzLCAoc3RydWN0 IHNvY2thZGRyICopICZhLCBzdHJsZW4oU29ja1BhdGgpICsgMikgIT0gLTEp CiAgICAgewogICAgICAgZGVidWcoIm9vb29vaCEgc29ja2V0IGFscmVhZHkg aXMgYWxpdmUhXG4iKTsKQEAgLTYyOCw2ICs2MzEsOSBAQAogICAgICAgcmV0 dXJuIC0xOwogICAgIH0KICNlbmRpZgorI2lmZGVmIF9fQ1lHV0lOX18KKyAg c2V0c29ja29wdChzLCBTT0xfU09DS0VULCBTT19QRUVSQ1JFRCwgTlVMTCwg MCk7CisjZW5kaWYKICAgaWYgKGNvbm5lY3QocywgKHN0cnVjdCBzb2NrYWRk ciAqKSZhLCBzdHJsZW4oU29ja1BhdGgpICsgMikgPT0gLTEpCiAgICAgewog ICAgICAgaWYgKGVycikKQEAgLTEwNTgsNiArMTA2NCw5IEBACiAgICAgewog ICAgICAgbGVuID0gc2l6ZW9mKGEpOwogICAgICAgZGVidWcoIkhhLCB0aGVy ZSB3YXMgc29tZW9uZSBrbm9ja2luZyBvbiBteSBzb2NrZXQ/P1xuIik7Cisj aWZkZWYgX19DWUdXSU5fXworICAgICAgc2V0c29ja29wdChucywgU09MX1NP Q0tFVCwgU09fUEVFUkNSRUQsIE5VTEwsIDApOworI2VuZGlmCiAgICAgICBp ZiAoKG5zID0gYWNjZXB0KG5zLCAoc3RydWN0IHNvY2thZGRyICopJmEsICh2 b2lkICopJmxlbikpIDwgMCkKICAgICAgICAgewogICAgICAgICAgIE1zZyhl cnJubywgImFjY2VwdCIpOwpAQCAtMTMwOCw2ICsxMzE3LDkgQEAKICAgICB9 CiAgIGVsc2UKICAgICB7CisjaWZkZWYgX19DWUdXSU5fXworICAgICAgc2V0 c29ja29wdChzLCBTT0xfU09DS0VULCBTT19QRUVSQ1JFRCwgTlVMTCwgMCk7 CisjZW5kaWYKICAgICAgIGxlbiA9IHNpemVvZihhKTsKICAgICAgIHMgPSBh Y2NlcHQocywgKHN0cnVjdCBzb2NrYWRkciAqKSZhLCAodm9pZCAqKSZsZW4p OwogICAgICAgaWYgKHMgPCAwKQpAQCAtMTM0Myw2ICsxMzU1LDkgQEAKICAg aWYgKHN0YXQoc2FwLT5zdW5fcGF0aCwgJnN0KSkKICAgICByZXR1cm4gLTE7 CiAgIGNobW9kKHNhcC0+c3VuX3BhdGgsIDApOworI2lmZGVmIF9fQ1lHV0lO X18KKyAgc2V0c29ja29wdChzLCBTT0xfU09DS0VULCBTT19QRUVSQ1JFRCwg TlVMTCwgMCk7CisjZW5kaWYKICAgeCA9IGNvbm5lY3QocywgKHN0cnVjdCBz b2NrYWRkciAqKSBzYXAsIGxlbik7CiAgIGNobW9kKHNhcC0+c3VuX3BhdGgs IHN0LnN0X21vZGUpOwogICByZXR1cm4geDsK --Multipart=_Fri__8_Mar_2019_23_46_38_+0900_V4cULbvE+HkFexGj Content-Type: text/plain; charset=us-ascii -- 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 --Multipart=_Fri__8_Mar_2019_23_46_38_+0900_V4cULbvE+HkFexGj--