Mail Archives: cygwin/2009/03/21/05:10:29
On Mar 20 18:43, Julio Emanuel wrote:
> Hi,
>
> I've been tracing some problems related to the installation scripts of
> ssh (more info on another mail later), and the root cause for one of
> the problems is the passwd misbehaving.
> The test case is very simple. Log on with a domain user on a cygwin
> shell. My particular case, it's an local Administrator, but not Domain
> Admin (as 99% of users in a corporate network out there, I suppose).
>
> ~ $ id
> uid=18606(security) gid=10513(Domain Users)
> groups=0(root),544(Administrators),545(Users),10513(Domain Users)
>
> Now, just try to do pretty much anything with passwd:
>
> ~ $ passwd -v
> passwd (cygwin) 1.5
> Password Utility
> Copyright 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
> Compiled on Mar 11 2009
>
> ~ $ passwd
> passwd: unknown user security
>
> ~ $ passwd SYSTEM
> passwd: unknown user security
>
> ~ $ passwd Administrator
> passwd: unknown user security
>
> Am I missing something here?
> How can I make it work with local users, when I'm logged on with a Domain user?
That doesn't look too well, but I can't reproduce the effect. If you
have a look into the source of passwd
http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/utils/passwd.c?rev=1.15&content-type=text/x-cvsweb-markup&cvsroot=src
you'll see a function GetPW (line 114ff) which calls a Cygwin internal
function to fetch the Windows username and the domain from the cygwin
passwd entry and then it calls
NetUserGetInfo (server, name, 3, (void *) &ui);
(The server is fetched in main(), line 516ff. from the $LOGONSERVER
variable). Apparently this function returns the error code
NERR_UserNotFound. Your problem is to find out why it does that.
It's very simple to build passwd for debugging yourself. Just fetch
the above source and build it like this:
$ gcc -g passwd.c -o my_passwd -lnetapi32
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -