/* Field names for the reboot(2) call. */
#define PM_REBOOT_HOW m1_i1 /* int */
-/* Field names for the PM_EXEC_NEW call. */
-#define PM_EXEC_NEW_ENDPT m1_i1 /* endpoint_t */
-#define PM_EXEC_NEW_PTR m1_p1 /* struct exec_info * */
-#define PM_EXEC_NEW_SUID m1_i2 /* int */
-
/* Field names for the PM_EXEC_RESTART call. */
#define PM_EXEC_RESTART_ENDPT m1_i1 /* endpoint_t */
#define PM_EXEC_RESTART_RESULT m1_i2 /* int */
} mess_lc_vfs_umount;
_ASSERT_MSG_SIZE(mess_lc_vfs_umount);
+typedef struct {
+ endpoint_t endpt;
+ vir_bytes ptr; /* struct exec_info * */
+
+ uint8_t padding[48];
+} mess_lexec_pm_exec_new;
+_ASSERT_MSG_SIZE(mess_lexec_pm_exec_new);
+
+typedef struct {
+ int suid;
+
+ uint8_t padding[52];
+} mess_pm_lexec_exec_new;
+_ASSERT_MSG_SIZE(mess_pm_lexec_exec_new);
+
typedef struct {
endpoint_t endpt;
mess_lc_vfs_umask m_lc_vfs_umask;
mess_lc_vfs_umount m_lc_vfs_umount;
+ mess_lexec_pm_exec_new m_lexec_pm_exec_new;
+
mess_lsys_pm_getepinfo m_lsys_pm_getepinfo;
mess_lsys_pm_getprocnr m_lsys_pm_getprocnr;
mess_lsys_vfs_copyfd m_lsys_vfs_copyfd;
mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver;
+ mess_pm_lexec_exec_new m_pm_lexec_exec_new;
+
mess_pm_lc_ptrace m_pm_lc_ptrace;
mess_pm_lc_time m_pm_lc_time;
mess_pm_lc_waitpid m_pm_lc_waitpid;
memset(&m, 0, sizeof(m));
m.m_type = PM_EXEC_NEW;
- m.PM_EXEC_NEW_ENDPT = proc_e;
- m.PM_EXEC_NEW_PTR = (char *)e;
+ m.m_lexec_pm_exec_new.endpt = proc_e;
+ m.m_lexec_pm_exec_new.ptr = (vir_bytes)e;
if ((r = ipc_sendrec(PM_PROC_NR, &m)) != OK) return(r);
- e->allow_setuid = !!m.PM_EXEC_NEW_SUID;
+ e->allow_setuid = !!m.m_pm_lexec_exec_new.suid;
return(m.m_type);
}
int do_newexec(void)
{
int proc_e, proc_n, allow_setuid;
- char *ptr;
+ vir_bytes ptr;
struct mproc *rmp;
struct exec_info args;
int r;
if (who_e != VFS_PROC_NR && who_e != RS_PROC_NR)
return EPERM;
- proc_e= m_in.PM_EXEC_NEW_ENDPT;
+ proc_e= m_in.m_lexec_pm_exec_new.endpt;
if (pm_isokendpt(proc_e, &proc_n) != OK) {
panic("do_newexec: got bad endpoint: %d", proc_e);
}
rmp= &mproc[proc_n];
- ptr= m_in.PM_EXEC_NEW_PTR;
- r= sys_datacopy(who_e, (vir_bytes)ptr,
- SELF, (vir_bytes)&args, sizeof(args));
+ ptr= m_in.m_lexec_pm_exec_new.ptr;
+ r= sys_datacopy(who_e, ptr, SELF, (vir_bytes)&args, sizeof(args));
if (r != OK)
panic("do_newexec: sys_datacopy failed: %d", r);
/* Kill process if something goes wrong after this point. */
rmp->mp_flags |= PARTIAL_EXEC;
- mp->mp_reply.PM_EXEC_NEW_SUID = (allow_setuid && args.allow_setuid);
+ mp->mp_reply.m_pm_lexec_exec_new.suid = (allow_setuid && args.allow_setuid);
return r;
}