This is the mail archive of the
cygwin-developers@sources.redhat.com
mailing list for the Cygwin project.
Re: seteuid ?
- To: cygwin developers <cygwin-developers at sourceware dot cygnus dot com>
- Subject: Re: seteuid ?
- From: Corinna Vinschen <vinschen at cygnus dot com>
- Date: Fri, 29 Sep 2000 22:59:01 +0200
- References: <20000929203651.1115.qmail@web106.yahoomail.com>
- Reply-To: cygdev <cygwin-developers at sources dot redhat dot com>
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.
Hope, that helps,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:cygwin@sources.redhat.com
Red Hat, Inc.
mailto:vinschen@cygnus.com