diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 7a4031149..813d9d03f 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -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 */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 03463e7ef..721c3818d 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -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; diff --git a/lib/libc/sys-minix/geteuid.c b/lib/libc/sys-minix/geteuid.c index b19af9edb..30da04f1a 100644 --- a/lib/libc/sys-minix/geteuid.c +++ b/lib/libc/sys-minix/geteuid.c @@ -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); } diff --git a/servers/pm/getset.c b/servers/pm/getset.c index b6a21e0fc..a6c38c139 100644 --- a/servers/pm/getset.c +++ b/servers/pm/getset.c @@ -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: