From: Lionel Sambuc Date: Tue, 13 May 2014 12:52:48 +0000 (+0200) Subject: Message type for PM_SET{,E}UID X-Git-Tag: v3.3.0~282 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.named-rrchecker.html?a=commitdiff_plain;h=a6c5528e962d8f90f7be02ae8ab96349893e45d4;p=minix.git Message type for PM_SET{,E}UID Change-Id: I5421646713e74562400e705b4a0f8b99f1325d64 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 9646a8e9b..c38fb14fa 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 setuid(2)/seteuid(2) calls. */ -#define PM_SETUID_UID m1_i1 /* uid_t */ - /* Field names for the setgid(2)/setegid(2) calls. */ #define PM_SETGID_GID m1_i1 /* gid_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 9aebc8442..3789153d4 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -195,6 +195,13 @@ typedef struct { } mess_lc_pm_reboot; _ASSERT_MSG_SIZE(mess_lc_pm_reboot); +typedef struct { + uid_t uid; + + uint8_t padding[52]; +} mess_lc_pm_setuid; +_ASSERT_MSG_SIZE(mess_lc_pm_setuid); + typedef struct { int req; int field; @@ -1034,6 +1041,7 @@ typedef struct { mess_lc_pm_priority m_lc_pm_priority; mess_lc_pm_ptrace m_lc_pm_ptrace; mess_lc_pm_reboot m_lc_pm_reboot; + mess_lc_pm_setuid m_lc_pm_setuid; mess_lc_pm_sysuname m_lc_pm_sysuname; mess_lc_pm_time m_lc_pm_time; mess_lc_pm_waitpid m_lc_pm_waitpid; diff --git a/lib/libc/sys-minix/setuid.c b/lib/libc/sys-minix/setuid.c index 4732950b9..e14ad4ced 100644 --- a/lib/libc/sys-minix/setuid.c +++ b/lib/libc/sys-minix/setuid.c @@ -10,7 +10,7 @@ int setuid(uid_t usr) message m; memset(&m, 0, sizeof(m)); - m.PM_SETUID_UID = usr; + m.m_lc_pm_setuid.uid = usr; return(_syscall(PM_PROC_NR, PM_SETUID, &m)); } @@ -19,6 +19,6 @@ int seteuid(uid_t usr) message m; memset(&m, 0, sizeof(m)); - m.PM_SETUID_UID = usr; + m.m_lc_pm_setuid.uid = usr; return(_syscall(PM_PROC_NR, PM_SETEUID, &m)); } diff --git a/servers/pm/getset.c b/servers/pm/getset.c index 6a0f09426..bc4039765 100644 --- a/servers/pm/getset.c +++ b/servers/pm/getset.c @@ -108,7 +108,7 @@ int do_set() switch(call_nr) { case PM_SETUID: case PM_SETEUID: - uid = (uid_t) m_in.PM_SETUID_UID; + uid = m_in.m_lc_pm_setuid.uid; if (rmp->mp_realuid != uid && rmp->mp_effuid != SUPER_USER) return(EPERM); if(call_nr == PM_SETUID) rmp->mp_realuid = uid;