#define v12_super_block super_block
#define SUPER_V1 SUPER_MAGIC
-/* Only setuid() and setgid(). */
-#define seteuid(uid) setuid(uid)
-#define setegid(gid) setgid(gid)
#endif
#define ISDISK(mode) S_ISBLK(mode) /* || S_ISCHR for raw device??? */
-#define NCALLS 91 /* number of system calls allowed */
+#define NCALLS 93 /* number of system calls allowed */
#define EXIT 1
#define FORK 2
#define GETPRIORITY 88 /* to PM */
#define SETPRIORITY 89 /* to PM */
#define GETTIMEOFDAY 90 /* to PM */
+#define SETEUID 91 /* to PM (and PM -> FS) */
+#define SETEGID 92 /* to PM (and PM -> FS) */
_PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) );
_PROTOTYPE( int rmdir, (const char *_path) );
_PROTOTYPE( int setgid, (_mnx_Gid_t _gid) );
+_PROTOTYPE( int setegid, (_mnx_Gid_t _gid) );
_PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid) );
_PROTOTYPE( pid_t setsid, (void) );
_PROTOTYPE( int setuid, (_mnx_Uid_t _uid) );
+_PROTOTYPE( int seteuid, (_mnx_Uid_t _uid) );
_PROTOTYPE( unsigned int sleep, (unsigned int _seconds) );
_PROTOTYPE( long sysconf, (int _name) );
_PROTOTYPE( pid_t tcgetpgrp, (int _fd) );
#include <lib.h>
#define setgid _setgid
+#define setegid _setegid
#include <unistd.h>
PUBLIC int setgid(grp)
m.m1_i1 = (int) grp;
return(_syscall(MM, SETGID, &m));
}
+
+PUBLIC int setegid(grp)
+gid_t grp;
+{
+ message m;
+
+ m.m1_i1 = (int) grp;
+ return(_syscall(MM, SETEGID, &m));
+}
#include <lib.h>
#define setuid _setuid
+#define seteuid _seteuid
#include <unistd.h>
PUBLIC int setuid(usr)
m.m1_i1 = usr;
return(_syscall(MM, SETUID, &m));
}
+
+PUBLIC int seteuid(usr)
+_mnx_Uid_t usr;
+{
+ message m;
+
+ m.m1_i1 = usr;
+ return(_syscall(MM, SETEUID, &m));
+}
.sect .text
.extern __setgid
.define _setgid
+.define _setegid
.align 2
_setgid:
jmp __setgid
+
+_setegid:
+ jmp __setegid
.sect .text
.extern __setuid
.define _setuid
+.define _seteuid
.align 2
_setuid:
jmp __setuid
+
+_seteuid:
+ jmp __seteuid
no_sys, /* 88 = getpriority */
no_sys, /* 89 = setpriority */
no_sys, /* 90 = gettimeofday */
+ no_sys, /* 91 = seteuid */
+ no_sys, /* 92 = setegid */
};
/* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];
rmp->mp_reply.reply_res3 = mproc[m_in.procnr].mp_pid;
break;
+ case SETEUID:
case SETUID:
if (rmp->mp_realuid != (uid_t) m_in.usr_id &&
rmp->mp_effuid != SUPER_USER)
return(EPERM);
- rmp->mp_realuid = (uid_t) m_in.usr_id;
+ if(call_nr == SETUID) rmp->mp_realuid = (uid_t) m_in.usr_id;
rmp->mp_effuid = (uid_t) m_in.usr_id;
tell_fs(SETUID, who, rmp->mp_realuid, rmp->mp_effuid);
r = OK;
break;
+ case SETEGID:
case SETGID:
if (rmp->mp_realgid != (gid_t) m_in.grp_id &&
rmp->mp_effuid != SUPER_USER)
return(EPERM);
- rmp->mp_realgid = (gid_t) m_in.grp_id;
+ if(call_nr == SETGID) rmp->mp_realgid = (gid_t) m_in.grp_id;
rmp->mp_effgid = (gid_t) m_in.grp_id;
tell_fs(SETGID, who, rmp->mp_realgid, rmp->mp_effgid);
r = OK;
do_getsetpriority, /* 88 = getpriority */
do_getsetpriority, /* 89 = setpriority */
do_time, /* 90 = gettimeofday */
+ do_getset, /* 91 = seteuid */
+ do_getset /* 92 = setegid */
};
/* This should not fail with "array size is negative": */
extern int dummy[sizeof(call_vec) == NCALLS * sizeof(call_vec[0]) ? 1 : -1];