This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.6
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Sat, 15 Nov 2014 15:45:19 +0100
- Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 1.7.33-0.6
- Authentication-results: sourceware.org; auth=none
- References: <545BD14A dot 8080803 at t-online dot de> <20141106200635 dot GP28195 at calimero dot vinschen dot de> <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>
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 cygpath)
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=$(/usr/bin/getent passwd "$username")
# Extract Windows username and domain
tmp="${pwd_entry#*:*:*:*U-}"
tmp="${pwd_entry%%,*}"
domain="${tmp%\\*}"
username="${tmp#*\\}"
Works, except when Cygwin does not provide a "U-*\NAME," in the gecos
field. This is the case for Local Service, Network Service and
Administrators.
Tested in db-only mode with 1.7.34-001:
$ getent passwd localservice
localservice:*:19:19:,S-1-5-19:/:/sbin/nologin
BTW, TrustedInstaller is not found by getent:
$ getent passwd TrustedInstaller ; echo $?
2
$ getent passwd 328384 ; echo $?
2
Same result for 'group'
but:
$ ls -l -d /cygdrive/c/Windows
drwxrwx---+ 1 TrustedInstaller TrustedInstaller 0 Nov 15 11:08
/cygdrive/c/Windows
$ ls -l -n -d /cygdrive/c/Windows
drwxrwx---+ 1 328384 328384 0 Nov 15 11:08 /cygdrive/c/Windows
$ getent passwd S-1-5-80-956008885-...
TrustedInstaller:*:328384:328384:,S-1-5-80-956008885-...:/:/sbin/nologin
What will be the future 'official' way for the opposite Windows->Cygwin
conversion? Some tool that uses CW_CYGNAME_FROM_WINNAME ?
Christian
--
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