This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/2329] [rs]etres[gu]id have misordered arguments


------- Additional Comments From tschwinge at gnu dot org  2006-02-15 20:22 -------
(In reply to comment #5)
> Do you have a small testcase to demonstrate the problem?

Just have a look at the corresponding Linux code, which is where these functions
come from as I understand it.

[glibc]/sysdeps/unix/sysv/linux/i386/getresuid.c
#v+
[...]
int
__getresuid (uid_t *ruid, uid_t *euid, uid_t *suid)
{
# if __ASSUME_32BITUIDS > 0
  return INLINE_SYSCALL (getresuid32, 3, CHECK_1 (ruid),
                         CHECK_1 (euid), CHECK_1 (suid));
# else
[...]
  result = INLINE_SYSCALL (getresuid, 3, __ptrvalue (&k_ruid),
                           __ptrvalue (&k_euid), __ptrvalue (&k_suid));

  if (result == 0)
    {
      *ruid = (uid_t) k_ruid;
      *euid = (uid_t) k_euid;
      *suid = (uid_t) k_suid;
    }

  return result;
# endif
}
[...]
#v-

The syscall looks like this:
[linux]/kernel/sys.c
#v+
[...]
asmlinkage long sys_getresuid(uid_t __user *ruid, uid_t __user *euid, uid_t
__user *suid)
{
        int retval;

        if (!(retval = put_user(current->uid, ruid)) &&
            !(retval = put_user(current->euid, euid)))
                retval = put_user(current->suid, suid);

        return retval;
}
[...]
#v-


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=2329

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]