X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Sat, 21 Mar 2009 11:10:04 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: [1.7] passwd: useless if used with a logged on domain user Message-ID: <20090321101004.GU9322@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-02-20) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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/