From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63422 invoked by alias); 17 Apr 2015 09:58:57 -0000 Mailing-List: contact cygwin-developers-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com Received: (qmail 63407 invoked by uid 89); 17 Apr 2015 09:58:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Apr 2015 09:58:56 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id C3B4BA80551; Fri, 17 Apr 2015 11:58:53 +0200 (CEST) Date: Fri, 17 Apr 2015 09:58:00 -0000 From: Corinna Vinschen To: cygwin-developers@cygwin.com Cc: Bryan Berns Subject: Re: "Unknown" Groups Not Caching - Debugging Message-ID: <20150417095853.GQ3657@calimero.vinschen.de> Reply-To: cygwin-developers@cygwin.com Mail-Followup-To: cygwin-developers@cygwin.com, Bryan Berns References: <20150417082301.GP3657@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="THYEXwetZJOK3OLY" Content-Disposition: inline In-Reply-To: <20150417082301.GP3657@calimero.vinschen.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-04/txt/msg00004.txt.bz2 --THYEXwetZJOK3OLY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 2151 On Apr 17 10:23, Corinna Vinschen wrote: > On Apr 16 22:50, Bryan Berns wrote: > > Posting here because that's what Corinna told me to do. > >=20 > > So I was looking into the issue I found with Cygwin not caching > > orphaned / unknown groups. At least for my test case, this appears to > > be rooted in the RID getting striped from the end of the SID just > > prior to the line being outputted (line 2464 from the exert below) > > within fetch_account_from_windows(). > >=20 > > uinfo.cc: 2460: /* Check if we know the domain. If so, create a passwd= /group > > uinfo.cc: 2461: entry with domain prefix and RID as username. */ > > uinfo.cc: 2462: PDS_DOMAIN_TRUSTSW td =3D NULL; > > uinfo.cc: 2463: > > uinfo.cc: 2464: sid_sub_auth_count (sid) =3D sid_sub_auth_count (sid) -= 1; > >=20 > > It's not clear to me, in general, why we're interested in creating a > > "passwd/group entry with domain prefix and RID as username". >=20 > Counter question. Why not? The result is that you know it's some > account from a known domain, and the combination of the domain name > and the RID results in a unique account name. >=20 > Thanks for looking into this and tracking it down to this point. > The problem in your case is that the sid isn't reverted in the > following !domain branch. >=20 > Please try this patch: >=20 > diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc > index 6186327..91d1d1c 100644 > --- a/winsup/cygwin/uinfo.cc > +++ b/winsup/cygwin/uinfo.cc > @@ -2475,10 +2475,10 @@ pwdgrp::fetch_account_from_windows (fetch_user_ar= g_t &arg, cyg_ldap *pldap) > posix_offset =3D fetch_posix_offset (td, &loc_ldap); > break; > } > + sid_sub_auth_count (sid) =3D sid_sub_auth_count (sid) + 1; > } > if (domain) > { > - sid_sub_auth_count (sid) =3D sid_sub_auth_count (sid) + 1; > wcscpy (dom, domain); > __small_swprintf (name =3D namebuf, L"%W(%u)", > is_group () ? L"Group" : L"User", >=20 I applied this patch to git HEAD. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --THYEXwetZJOK3OLY Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVMNldAAoJEPU2Bp2uRE+gdE0P/Rid1l7/j4S4M/diRV52M5F8 pDnGwzagVJmBXiNS5G4NhjwvJmAa7avfO7h3XYPoDGrUXfPRgG1gIDgcR6npj2Iw SZI+u8KZaITx9MQICBEbaipaa7OIDBOCiFp4OX1A5Cp+EAOS4gZ4Dr9JbGSBxBHR u49pBfWbLdtXUunVsN74/Xw0cxM6Wo6cHup1PV3aqDcGd1yQO+MUTugwmOdc82Gz zE5VHmzk1RfKHpGEp8CKywjNAd008LniMJh8sI0LLeymZY3JEqA9dFE/I0RYHWQU NaFeMJf3Vn0wNUCxEl7L3yWRYFAf/gtFxIwB5TZJNFo2dt/QW0exBakvOn6BP1b4 b3zPqtlLHanBr5x2XCbYI1womRqs2bWnbRYBhlr+oup35qEv5SZRON8+zrKsyQLi UTEb1ZRi3D7NfdVdouYibhlBKbhB5SiAYhYGaT+aIfObQxFsoru3tNY9HAOTa+5L 3LpC9XYubBxsEKi8e6ZEdfGcA92eL7PDp5mMQSFrEZhtQhOL+rl57Xepxkxtf0K7 RT4PLShBgnBxeICULC4PcoHZ1mbi2Cs6o5V74B8bJZlWz0w0278iSeB2Hxp2CfjM +FqFrCrMR1sabzUoXGPddchUFsarzONPuLTcTQ3iRZavGVFams8cDlOd0VTI1QlV 6o71f3xlraICx3PQtXNI =2Gk3 -----END PGP SIGNATURE----- --THYEXwetZJOK3OLY--