Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Feb 2003 14:12:12 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Anoop Ranganath <anoop@ranganath.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: tmpfile breakage on setuid executables
Message-ID:  <3E418C3C.F4B99C78@mindspring.com>
References:  <00e201c2cd5b$14f31c30$0c02040a@ranganath> <3E41846A.39AAE406@mindspring.com> <015c01c2cd60$7b6dc0a0$0c02040a@ranganath>

next in thread | previous in thread | raw e-mail | index | archive | help
Anoop Ranganath wrote:
> > > I've used the code at the bottom of this message to isolate this
> > > bug.  The summary is that when I compile the code as root, and then
> > > make it setuid (chmod u+s a.out) and then try to run it as a user, the
> > > tmpfile() fails.  If I run it as root, it works fine.  Conversely, I
> > > can give user ownership of the executable, and then run it as user, and
> > > it works great, but if fails for root.  Again this is only with the
> > > setuid bit set.
> >
> > Probably your real and effective UID's aren't the same.  Does your
> > SUID root program set the real UID from the effective UID?
> 
> Well, the code sample I submitted in my original email doesn't set any UID.
> It just creates a tmpfile() and then verifies that it succeeded.  This is
> definitely a regression from 4.7 though.  Running the same code on 4.7
> succeeds, as it does on several other unix boxes.

We need to know how we think it's supposed to work, not how you
think it's supposed to work to determine if the error is in the
code OR in the fact some old bug was fixed going from 4.7->5.0,
and the fix is biting you, OR it's a real bug.

So if you don't want to answer the question about whether or not
the UID root program sets the real UID from the effective UID,
then you need to answer a different one:

Are you saying that the code you posted, without calling the
"setuid(geteuid());" worked on 4.7 and not on 5.0, when you
"chown root, chmod 4755" it?

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E418C3C.F4B99C78>