From: Lionel Sambuc Date: Tue, 13 May 2014 12:55:47 +0000 (+0200) Subject: Message type for PM_SET{,E}GID X-Git-Tag: v3.3.0~281 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/processing.js?a=commitdiff_plain;h=cc852e7783409dd0d5b970627fcf89f85d456f0d;p=minix.git Message type for PM_SET{,E}GID Change-Id: I489d9290553b28361344e0cfd59c31e7e672c22c --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index c38fb14fa..8cfc1fcf0 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 setgid(2)/setegid(2) calls. */ -#define PM_SETGID_GID m1_i1 /* gid_t */ - /* Field names for the getppid(2) call. */ #define PM_GETPID_PARENT m2_i1 /* pid_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 3789153d4..9906261a1 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 { + gid_t gid; + + uint8_t padding[52]; +} mess_lc_pm_setgid; +_ASSERT_MSG_SIZE(mess_lc_pm_setgid); + typedef struct { uid_t uid; @@ -1041,6 +1048,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_setgid m_lc_pm_setgid; mess_lc_pm_setuid m_lc_pm_setuid; mess_lc_pm_sysuname m_lc_pm_sysuname; mess_lc_pm_time m_lc_pm_time; diff --git a/lib/libc/sys-minix/setgid.c b/lib/libc/sys-minix/setgid.c index 269e0cdb6..a34f8c9af 100644 --- a/lib/libc/sys-minix/setgid.c +++ b/lib/libc/sys-minix/setgid.c @@ -11,7 +11,7 @@ int setgid(gid_t grp) message m; memset(&m, 0, sizeof(m)); - m.PM_SETGID_GID = (int) grp; + m.m_lc_pm_setgid.gid = grp; return(_syscall(PM_PROC_NR, PM_SETGID, &m)); } @@ -20,6 +20,6 @@ int setegid(gid_t grp) message m; memset(&m, 0, sizeof(m)); - m.PM_SETGID_GID = (int) grp; + m.m_lc_pm_setgid.gid = grp; return(_syscall(PM_PROC_NR, PM_SETEGID, &m)); } diff --git a/servers/pm/getset.c b/servers/pm/getset.c index bc4039765..ac4f2f78c 100644 --- a/servers/pm/getset.c +++ b/servers/pm/getset.c @@ -123,7 +123,7 @@ int do_set() case PM_SETGID: case PM_SETEGID: - gid = (gid_t) m_in.PM_SETGID_GID; + gid = m_in.m_lc_pm_setgid.gid; if (rmp->mp_realgid != gid && rmp->mp_effuid != SUPER_USER) return(EPERM); if(call_nr == PM_SETGID) rmp->mp_realgid = gid;