Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Message-ID: <20000929222753.1859.qmail@web109.yahoomail.com> Date: Fri, 29 Sep 2000 15:27:53 -0700 (PDT) From: Earnie Boyd Subject: Re: seteuid ? To: cygdev MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii --- Corinna Vinschen wrote: > Earnie Boyd wrote: > > > > Hey Corinna, > > > > I've copied my Domain User /etc/passwd record and changed the User=root and > > UID=0. If I put this record first in /etc/passwd file I could `su -' just > fine > > and dandy. However, that ended up as the user record when starting bash. > > Moving the record to the end of the file, I `su -' and I would the EPERM > error. > > This is due to the test of pw_cur != pw_new. I removed the set_errno and > > return -1 statements and su now changes the effective user. Comments? > > What you have done is _not_ changing the user context. It only looks as > if the context has changed. The test in seteuid() is intended to check > if a previous cygwin_logon_user()/cygwin_set_impersonation_token() pair > was called prior to using seteuid(). I have described that in detail in > the documentation. You can't change the user context without providing > a password. I have finally managed to update the net documentation to > contain the "New setuid concept" chapter. Take a look. > I understand and I'll take a look at your documentation. In my particular instance not changing the NT user context was what needed to happen. It did change the emulated UNIX user context so that the Cygwin functions reported that I was root. BTW, su doesn't ask for a password if the password field from getpwent() is NULL. Cheers, Earnie. __________________________________________________ Do You Yahoo!? Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free! http://photos.yahoo.com/