[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#10021: [PATCH id] Add error-checking on GNU

From: Alan Curry
Subject: Re: bug#10021: [PATCH id] Add error-checking on GNU
Date: Sun, 13 Nov 2011 17:32:22 -0500 (GMT+5)

Ludovic =?UTF-8?Q?Court=C3=A8s?= writes:
> OTOH, on POSIX-conforming systems (which includes GNU/Linux, so it may
> be the majority of systems in use), -1 may well be a valid UID/GID.

That's a bizarre statement.

  3.428 User ID

  A non-negative integer that is used to identify a system user. When the
  identity of a user is associated with a process, a user ID value is
  referred to as a real user ID, an effective user ID, or a saved

chown(2) uses (uid_t)-1 and (gid_t)-1 as the "don't change" special values.
So does setreuid(2)/setregid(2).

setuid(-1) isn't documented as special. Trying it out, it seems to be treated
as equivalent to setuid(1). Not what I expected, but it doesn't really
support your "-1 is a valid uid" theory.

Alan Curry

reply via email to

[Prev in Thread] Current Thread [Next in Thread]