Message type for PM_GETUID

Change-Id: I9a04f5a8b0e9099e0df543bcf76b2610a8803b9a
This commit is contained in:
Lionel Sambuc 2014-05-13 14:41:26 +02:00
parent 70a744da37
commit ba70f58845
4 changed files with 11 additions and 6 deletions

View file

@ -85,9 +85,6 @@
#define PM_SIG_SET m2_sigset /* sigset_t */
#define PM_SIG_CTX m2_p1 /* struct sigcontext * */
/* Field names for the getuid(2) call. */
#define PM_GETUID_EUID m1_i1 /* uid_t */
/* Field names for the getgid(2) call. */
#define PM_GETGID_EGID m1_i1 /* gid_t */

View file

@ -554,6 +554,13 @@ typedef struct {
} mess_lsys_vfs_mapdriver;
_ASSERT_MSG_SIZE(mess_lsys_vfs_mapdriver);
typedef struct {
uid_t euid;
uint8_t padding[52];
} mess_pm_lc_getuid;
_ASSERT_MSG_SIZE(mess_pm_lc_getuid);
typedef struct {
endpoint_t endpt;
int result;
@ -1061,6 +1068,7 @@ typedef struct {
mess_pm_lexec_exec_new m_pm_lexec_exec_new;
mess_pm_lc_getuid m_pm_lc_getuid;
mess_pm_lc_ptrace m_pm_lc_ptrace;
mess_pm_lc_time m_pm_lc_time;
mess_pm_lc_waitpid m_pm_lc_waitpid;

View file

@ -15,6 +15,6 @@ uid_t geteuid(void)
* are not always successful and Minix returns the unreserved value
* (uid_t) -1 when there is an error.
*/
if (_syscall(PM_PROC_NR, PM_GETUID, &m) < 0) return ( (uid_t) -1);
return( (uid_t) m.PM_GETUID_EUID);
if (_syscall(PM_PROC_NR, PM_GETUID, &m) < 0) return(-1);
return(m.m_pm_lc_getuid.euid);
}

View file

@ -49,7 +49,7 @@ int do_get()
break;
case PM_GETUID:
r = rmp->mp_realuid;
rmp->mp_reply.PM_GETUID_EUID = rmp->mp_effuid;
rmp->mp_reply.m_pm_lc_getuid.euid = rmp->mp_effuid;
break;
case PM_GETGID: