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:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=SIBidhqccIRmTxt7jjEF0KeJAPgZshfgsUKK6TVsY4QebVQiwqC2X eX0YRynHx4r0sfFdf/H+PivwiNKK5dXS6HhG4qZCEUAfnSugNcFKPwkijpf+PVvc b+rRccjuwZVTazc+HzVJ76AEKpyA2e8DubizVOa8Rggl6LE4S2MlQM= 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:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=CUeY33VvknnrUw/HR8mdFLqnauU=; b=sT1UTxiLd9bodfNWjy4mDowNeVN6 vC+qcBqsBTE2/SM9MXI/KUCYDfj52YKljMLzFg7guGX89g/IzZ92bSmbUbenqShY zqdWZwBiVMl6LFCljIAocutp7GCLs6skKkxPCX1YYnCt4Ls/eImPDZE7KJ8KzME5 lOPgCEMOXq5uCJU= 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-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Date: Mon, 17 Nov 2014 11:11:25 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.6 Message-ID: <20141117101125.GC3151@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20141106204222 DOT GQ28195 AT calimero DOT vinschen DOT de> <545C68BA DOT 3050007 AT t-online DOT de> <20141107101659 DOT GU28195 AT calimero DOT vinschen DOT de> <545D30DA DOT 9040507 AT t-online DOT de> <20141110105151 DOT GB2782 AT calimero DOT vinschen DOT de> <54611048 DOT 4000404 AT t-online DOT de> <20141110204500 DOT GB13071 AT calimero DOT vinschen DOT de> <5461AF09 DOT 5010809 AT t-online DOT de> <20141111113656 DOT GP2782 AT calimero DOT vinschen DOT de> <546766FF DOT 9010602 AT t-online DOT de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MnLPg7ZWsaic7Fhd" Content-Disposition: inline In-Reply-To: <546766FF.9010602@t-online.de> User-Agent: Mutt/1.5.23 (2014-03-12) --MnLPg7ZWsaic7Fhd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Nov 15 15:45, Christian Franke wrote: > Corinna Vinschen wrote: > >>The actual test scripts & tools from this use case pass local usernames > >>from/to non-Cygwin programs and rely on the fact that Cygwin and Windows > >>username match. > >> > >>For the long term, have some cyguser, cyggroup tools (similar to cygpat= h) > >>which convert the names would be helpful. > >Feel free to provide them. I'm not quite sure what kind of conversion > >you're thinking about. Cygwin->Windows? If so, you can get that > >with simple scripts: > > > > pwd_entry=3D$(/usr/bin/getent passwd "$username") > > # Extract Windows username and domain > > tmp=3D"${pwd_entry#*:*:*:*U-}" > > tmp=3D"${pwd_entry%%,*}" > > domain=3D"${tmp%\\*}" > > username=3D"${tmp#*\\}" >=20 > Works, except when Cygwin does not provide a "U-*\NAME," in the gecos fie= ld. > This is the case for Local Service, Network Service and Administrators. This can be fixed easily. > Tested in db-only mode with 1.7.34-001: >=20 > $ getent passwd localservice > localservice:*:19:19:,S-1-5-19:/:/sbin/nologin >=20 >=20 > BTW, TrustedInstaller is not found by getent: >=20 > $ getent passwd TrustedInstaller ; echo $? > 2 >=20 > $ getent passwd 328384 ; echo $? > 2 Oh, right. This affects all "NT SERVICE" accounts. However, this also shows another problem. Every service has its own SID under=20 the NT SERVICE scheme. This allows to print any service as a passwd or group entry. To avoid collisions I think the right thing to do here is to always prefix NT SERVICE accounts, including TrustedInstaller: NT SERVICE+TrustedInstaller:*:328384:328384:U-NT SERVICE\TrustedInstaller= ,S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464:/:/sbin/nol= ogin I applied a patch for both of the above to CVS. > What will be the future 'official' way for the opposite Windows->Cygwin > conversion? Some tool that uses CW_CYGNAME_FROM_WINNAME ? In theory, the right tool for this would be... getent. Just as I added a way to use the S- syntax, I can add a way to use the U-domain\username syntax. This allows to use the same tool for both directions and then simply filter out the account name you need. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --MnLPg7ZWsaic7Fhd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUacnNAAoJEPU2Bp2uRE+g8eoP/1+JLRfSoMntRrEUWQ7xkTcK SVdrz8N6/SC9GUMkTK/s//R84O7I2r76B2TnJiHeyD9yVsWi5Y6jfrqb+aes6fpB +TOgdP5B3mMRT5JuUy6P35MMZPS4Y0P1UHyA4Z4ZWGClaGGQ3gNFA5X+0zVFWTkZ 1nbWcsD+cmR9/TwtJ7wpmxHY2F6bCo9iQtBxmWHNRLMge+qzjI/AJYuBF99JP6sH JsPTqRvr6CDIh2fWs7YuXb2kg/fGy41Fa+qCz6/HO0kuwuwFoEXgYZK5v0noErcA BwJ4taAQWHIjLmaYwMg2IRKrX3DFDvNgoxjALssL196SYmHTZ60H7V+wJZVx+Fdx EM477W3XPzeFNbAkFrAS2svuzHQ61YFcmiXNEVxCjGabBM4NKBlg0Aid5sUsqUua TMLOwu4GxxRKTe0C6Mp9EzGYw7Y1fCcsDZscBVT1oJ6RcITyhrNCQRtCLO6Ci35O ZMWBPa/m1587vRyJ3KSDiqiMTxChcLZxNAaz92qiVNMI3GuF/Pd8/etAfhdNRhvM zUtpa81iusFNe9V/obwILCP1cXdzWdw0KfPzyIx1oSYGi8e6Ytz86izu7LISRjQb w2rHx1rDfjq52kDRr+iMCtDm6Mzx2BxiqxcUWcH3Rmmt2FkGLofuFFvMCKaCkuGv 4GraY9/9IVowYwHFKEl/ =2drv -----END PGP SIGNATURE----- --MnLPg7ZWsaic7Fhd--