This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove __wur from setfsuid and setfsgid.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Rich Felker <dalias at aerifal dot cx>
- Cc: Adam Conrad <adconrad at 0c3 dot net>, libc-alpha at sourceware dot org
- Date: Thu, 18 Apr 2013 15:51:31 +0200
- Subject: Re: [PATCH] Remove __wur from setfsuid and setfsgid.
- References: <20130418044529 dot GU29056 at 0c3 dot net> <516F830C dot 3010108 at redhat dot com> <20130418134759 dot GB20323 at brightrain dot aerifal dot cx>
On 04/18/2013 03:47 PM, Rich Felker wrote:
RETURN VALUE
On success, the previous value of fsuid is returned. On error,
the current value of fsuid is returned.
Huh? If the documentation is correct, checking for error is easy:
if (setfsuid(uid)!=uid) /* error */
Doesn't work because it returns the *previous* value in both cases. The
kernel sources are quite clear, exactly same value is returned on both
branches. 8-(
--
Florian Weimer / Red Hat Product Security Team