bug-hurd
[Top][All Lists]
Advanced

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

setreuid/setresuid code.


From: Samuel Thibault
Subject: setreuid/setresuid code.
Date: Sat, 15 Oct 2011 23:16:10 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

I'm having a look at the setreuid code, and there's something I don't
understand:

      newaux = _hurd_id.aux.uids;
      naux = _hurd_id.aux.nuids;
      if (ruid != -1)
        {
          if (_hurd_id.aux.nuids == 0)
            {
              newaux = &ruid;
              naux = 1;
            }
          else
            {
              _hurd_id.aux.uids[0] = ruid;
              _hurd_id.valid = 0;
            }
        }

why is the valid field set to 0 in the case where it is actually updated
with the correct value?  In case the call fails?  Why don't we also set
valid to 0 in the first case, since _hurd_id is not updated in that
case?

Samuel



reply via email to

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