This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [1.7] passwd: useless if used with a logged on domain user

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

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 Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]