[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFDTedoBOijJdw4zAEYgHzJL8GEoe32Uxy5Em-qaxqFFx0L2UQ@mail.gmail.com>
Date: Tue, 17 Jul 2012 17:56:42 +0100
From: Adrián <adrianbn@...il.com>
To: "Theodore Ts'o" <tytso@....edu>,
Adrián <adrianbn@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: Setreuid distinction about (uid_t)-1
On Tue, Jul 17, 2012 at 5:24 PM, Theodore Ts'o <tytso@....edu> wrote:
> On Tue, Jul 17, 2012 at 03:13:18PM +0100, Adrián wrote:
>>
>> Thanks a lot Athanasius. What I still can't see is why is the -1
>> exception there, as I assume that if you want to leave one of the ids
>> unchaged you can call:
>>
>> setreuid(0,geteuid());
>>
>> If you want to leave euid unchanged, right? Is there a need or reason
>> to be doing this differentiation in the setreuid code?
>
> Unix systems for multiple decades have done things this way, and it's
> ensrined in POSIX and the Single Unix Specification. Changing it
> would potentially open up security holes for programs which expect the
> standard-specificed behavior.
>
> (Note, BTW, that decades ago system calls weren't cheap, and CPU's
> were much slower, and that may have driven the historical behavior.
> Sometimes we get forget how spoiled we are that Linux's system call
> overhead is as low as it is...)
>
> - Ted
Thanks for that Theo!
Adrian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists