Message type for PM_SRV_FORK

Change-Id: I0e112da380805d40901a4041fd82da6e842e1f9b
This commit is contained in:
Lionel Sambuc 2014-05-13 13:35:40 +02:00
parent 7fb63c6182
commit 594521214a
4 changed files with 17 additions and 12 deletions

View file

@ -85,10 +85,6 @@
#define PM_SIG_SET m2_sigset /* sigset_t */
#define PM_SIG_CTX m2_p1 /* struct sigcontext * */
/* Field names for the srv_fork(2) call. */
#define PM_SRV_FORK_UID m1_i1 /* uid_t */
#define PM_SRV_FORK_GID m1_i2 /* gid_t */
/* Field names for the getuid(2) call. */
#define PM_GETUID_EUID m1_i1 /* uid_t */

View file

@ -495,6 +495,14 @@ typedef struct {
} mess_pm_lsys_getprocnr;
_ASSERT_MSG_SIZE(mess_pm_lsys_getprocnr);
typedef struct {
uid_t uid;
gid_t gid;
uint8_t padding[48];
} mess_lsys_pm_srv_fork;
_ASSERT_MSG_SIZE(mess_lsys_pm_srv_fork);
typedef struct {
endpoint_t endpt;
cp_grant_id_t grant;
@ -1018,6 +1026,7 @@ typedef struct {
mess_lsys_pm_getepinfo m_lsys_pm_getepinfo;
mess_lsys_pm_getprocnr m_lsys_pm_getprocnr;
mess_lsys_pm_srv_fork m_lsys_pm_srv_fork;
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;

View file

@ -8,7 +8,7 @@ srv_fork(uid_t reuid, gid_t regid)
message m;
memset(&m, 0, sizeof(m));
m.PM_SRV_FORK_UID = (int) reuid;
m.PM_SRV_FORK_GID = (int) regid;
m.m_lsys_pm_srv_fork.uid = reuid;
m.m_lsys_pm_srv_fork.gid = regid;
return _taskcall(PM_PROC_NR, PM_SRV_FORK, &m);
}

View file

@ -194,10 +194,10 @@ int do_srv_fork()
rmc->mp_exitstatus = 0;
rmc->mp_sigstatus = 0;
rmc->mp_endpoint = child_ep; /* passed back by VM */
rmc->mp_realuid = (uid_t) m_in.PM_SRV_FORK_UID;
rmc->mp_effuid = (uid_t) m_in.PM_SRV_FORK_UID;
rmc->mp_realgid = (uid_t) m_in.PM_SRV_FORK_GID;
rmc->mp_effgid = (uid_t) m_in.PM_SRV_FORK_GID;
rmc->mp_realuid = m_in.m_lsys_pm_srv_fork.uid;
rmc->mp_effuid = m_in.m_lsys_pm_srv_fork.uid;
rmc->mp_realgid = m_in.m_lsys_pm_srv_fork.gid;
rmc->mp_effgid = m_in.m_lsys_pm_srv_fork.gid;
for (i = 0; i < NR_ITIMERS; i++)
rmc->mp_interval[i] = 0; /* reset timer intervals */
@ -210,8 +210,8 @@ int do_srv_fork()
m.VFS_PM_ENDPT = rmc->mp_endpoint;
m.VFS_PM_PENDPT = rmp->mp_endpoint;
m.VFS_PM_CPID = rmc->mp_pid;
m.VFS_PM_REUID = m_in.PM_SRV_FORK_UID;
m.VFS_PM_REGID = m_in.PM_SRV_FORK_GID;
m.VFS_PM_REUID = m_in.m_lsys_pm_srv_fork.uid;
m.VFS_PM_REGID = m_in.m_lsys_pm_srv_fork.gid;
tell_vfs(rmc, &m);