Message type for PM_SET{,E}UID
Change-Id: I5421646713e74562400e705b4a0f8b99f1325d64
This commit is contained in:
parent
b9939b3ed8
commit
a6c5528e96
4 changed files with 11 additions and 6 deletions
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue