The `too much stuff, just check the ChangeLog' update

This commit is contained in:
Wichert Akkerman 2000-05-01 01:53:59 +00:00
parent 10dfa564bd
commit 5ae21ead9f
20 changed files with 247 additions and 44 deletions

View File

@ -30,7 +30,7 @@ porting to new systems:
Richard Henderson <richard@twiddle.tamu.edu>
Tom Dyas <tdyas@eden.rutgers.edu>
Henrik Storner <storner@osiris.ping.dk>
David Mosberger-Tang <davidm@AZStarNet.com>
David Mosberger-Tang <davidm@hpl.hp.com>
Ulrich Drepper <drepper@cygnus.com>
Nate Eldredge <nate@cartsys.com>
Jakub Jelinek <jj@ultra.linux.cz>

View File

@ -1,3 +1,31 @@
2000-04-26 Wichert Akkerman <wakkerma@debian.org>
* defs.h: balance #if/#endif again
* system.c: fix return statements in sys_capget()
* Merge updates from Topi Miettinen <Topi.Miettinen@nic.fi>:
+ file.c: add F_[SG]ETSIG to fcntl flags
+ strace.c: don't setre[gu]id if not needed
+ system.c: handle sys_reboot for Linux
+ term.c: add baudrate constants up to B4000000
+ linux/**/syscallent.h: note that munlockall has no arguments
2000-04-25 David Mosberger <davidm@hpl.hp.com>
* CREDITS: fix email address
* process.c: handle PR_[GS]ET_UNALIGN and PR_[GS]ET_KEEPCAPS
* signal.c: honour offset of sigconfig in sigframe structure for
Linux/ia64
* linux/ia64/syscallent.h: Add perfmonctl, pivotroot, mincore, and
madvise syscalls.
* syscall.c (syscall_enter): With Kevin's latest ptrace patches,
AR_BSP points to the _end_ of the active register frame, so we need
to adjust bsp by moving it back by the size of the active frame
before using it.
2000-04-24 Wichert Akkerman <wakkerma@debian.org>
* process.c: add sparc support to change_syscall
2000-04-22 Wichert Akkerman <wakkerma@debian.org>
* linux/mips/syscallent.h: fix some typos
@ -51,7 +79,7 @@
2000-02-03 Wichert Akkerman <wakkerma@debian.org>
* Merge Trillian (ia64) patches
* Merge Linux/ia64 patches
2000-01-02 Pavel Machek <pavel@ucw.cz>

4
TODO
View File

@ -2,11 +2,11 @@
* clone doesn't work; cloned processes can hang
* partially done: finish up change_syscall using new setargs
* do setargs for non-ia64
* rename functions that are used for general things:
sys_chdir -> general_1stringarg
* generate syscallent.h from the kernel sources (asm/unistd.h)
* update linux/sparc syscall entries; Linux messed things up by overriding
all kinds of SunOS entries
* synchronize linux/**/syscallent.h, number of arguments for a syscal isn't
consistent across different architectures
-- old entries from jrs
attempt reopen of /proc file if we get EAGAIN from any /proc ioctl

1
defs.h
View File

@ -44,6 +44,7 @@
#else
#define MAX_QUALS 2048 /* maximum number of syscalls, signals, etc. */
#endif
#endif
#ifndef MAX_PROCS
#define MAX_PROCS 64 /* maximum number of processes tracable */
#endif

6
desc.c
View File

@ -57,6 +57,12 @@ static struct xlat fcntlcmds[] = {
#endif
#ifdef F_CNVT
{ F_CNVT, "F_CNVT" },
#endif
#ifdef F_SETSIG
{ F_SETSIG, "F_SETSIG" },
#endif
#ifdef F_GETSIG
{ F_GETSIG, "F_GETSIG" },
#endif
{ 0, NULL },
};

9
file.c
View File

@ -172,13 +172,16 @@ struct xlat openmodes[] = {
{ O_PRIV, "O_PRIV" },
#endif
#ifdef O_DIRECT
{ O_DIRECT, "O_DIRECT" },
{ O_DIRECT, "O_DIRECT" },
#endif
#ifdef O_LARGEFILE
{ O_LARGEFILE, "O_LARGEFILE" },
{ O_LARGEFILE, "O_LARGEFILE" },
#endif
#ifdef O_DIRECTORY
{ O_DIRECTORY, "O_DIRECTORY" },
{ O_DIRECTORY, "O_DIRECTORY" },
#endif
#ifdef O_NOFOLLOW
{ O_NOFOLLOW, "O_NOFOLLOW" },
#endif
#ifdef FNDELAY

View File

@ -345,7 +345,7 @@
{ 2, 0, sys_mlock, "mlock" }, /* 314 */
{ 2, 0, sys_munlock, "munlock" }, /* 315 */
{ 1, 0, sys_mlockall, "mlockall" }, /* 316 */
{ 1, 0, sys_munlockall, "munlockall" }, /* 317 */
{ 0, 0, sys_munlockall, "munlockall" }, /* 317 */
{ 1, 0, sys_sysinfo, "sysinfo" }, /* 318 */
{ 1, 0, sys_sysctl, "sysctl" }, /* 319 */
{ 0, 0, sys_idle, "idle" }, /* 320 */

View File

@ -29,7 +29,6 @@
*/
/* still unfinished */
#define sys_reboot printargs
#define sys_ioperm printargs
#define sys_syslog printargs
#define sys_iopl printargs
@ -205,4 +204,5 @@
#define sys_init_module printargs
#define sys_quotactl printargs
#define sys_mlockall printargs
#define sys_reboot printargs
#endif

View File

@ -198,7 +198,7 @@
{ 3, 0, printargs, "nfsservctl" }, /* 169 */
{ 3, 0, sys_setresgid, "setresgid" }, /* 170 */
{ 3, 0, sys_getresgid, "getresgid" }, /* 171 */
{ 5, 0, printargs, "prctl" }, /* 172 */
{ 5, 0, sys_prctl, "prctl" }, /* 172 */
{ 1, TS, printargs, "rt_sigreturn" }, /* 173 */
{ 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 174 */
{ 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 175 */
@ -1199,18 +1199,18 @@
{ 2, 0, sys_sched_rr_get_interval,"sched_rr_get_interval"}, /* 1167 */
{ 2, 0, sys_nanosleep, "nanosleep" }, /* 1168 */
{ 3, 0, printargs, "nfsservctl" }, /* 1169 */
{ 5, 0, printargs, "prctl" }, /* 1170 */
{ 5, 0, sys_prctl, "prctl" }, /* 1170 */
{ 1, 0, sys_getpagesize, "getpagesize" }, /* 1171 */
{ 6, 0, sys_mmap, "mmap2" }, /* 1172 */
{ 5, 0, printargs, "pciconfig_read"}, /* 1173 */
{ 5, 0, printargs, "pciconfig_write"}, /* 1174 */
{ 8, 0, printargs, "SYS_1175" }, /* 1175 */
{ 8, 0, printargs, "perfmonctl" }, /* 1175 */
{ 2, TS, sys_sigaltstack, "sigaltstack" }, /* 1176 */
{ 4, TS, sys_rt_sigaction, "rt_sigaction" }, /* 1177 */
{ 2, TS, sys_rt_sigpending, "rt_sigpending" }, /* 1178 */
{ 4, TS, sys_rt_sigprocmask, "rt_sigprocmask"}, /* 1179 */
{ 3, TS, sys_rt_sigqueueinfo, "rt_sigqueueinfo"}, /* 1180 */
{ 0, TS, printargs, "rt_sigreturn" }, /* 1181 */
{ 0, TS, sys_sigreturn, "rt_sigreturn" }, /* 1181 */
{ 2, TS, sys_rt_sigsuspend, "rt_sigsuspend" }, /* 1182 */
{ 4, TS, sys_rt_sigtimedwait, "rt_sigtimedwait"}, /* 1183 */
{ 2, TF, sys_getcwd, "getcwd" }, /* 1184 */
@ -1237,8 +1237,8 @@
{ 3, TN, sys_sendmsg, "sendmsg" }, /* 1205 */
{ 3, TN, sys_recvmsg, "recvmsg" }, /* 1206 */
{ 2, TF, sys_pivotroot, "pivot_root" }, /* 1207 */
{ 8, 0, printargs, "SYS_1208" }, /* 1208 */
{ 8, 0, printargs, "SYS_1209" }, /* 1209 */
{ 3, 0, printargs, "mincore" }, /* 1208 */
{ 3, 0, sys_madvise, "madvise" }, /* 1209 */
{ 8, 0, printargs, "SYS_1210" }, /* 1210 */
{ 8, 0, printargs, "SYS_1211" }, /* 1211 */
{ 8, 0, printargs, "SYS_1212" }, /* 1212 */

View File

@ -4155,7 +4155,7 @@
{ 5, 0, sys_mlock, "mlock" }, /* 4154 */
{ 5, 0, sys_munlock, "munlock" }, /* 4155 */
{ 5, 0, sys_mlockall, "mlockall" }, /* 4156 */
{ 5, 0, sys_munlockall, "munlockall" }, /* 4157 */
{ 0, 0, sys_munlockall, "munlockall" }, /* 4157 */
{ 5, 0, sys_sched_setparam, "sched_setparam"}, /* 4158 */
{ 5, 0, sys_sched_getparam, "sched_getparam"}, /* 4159 */
{ 5, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 4160 */

View File

@ -181,7 +181,7 @@
{ 2, 0, sys_mlock, "mlock" }, /* 150 */
{ 2, 0, sys_munlock, "munlock" }, /* 151 */
{ 1, 0, sys_mlockall, "mlockall" }, /* 152 */
{ 1, 0, sys_munlockall, "munlockall" }, /* 153 */
{ 0, 0, sys_munlockall, "munlockall" }, /* 153 */
{ 2, 0, sys_sched_setparam, "sched_setparam" }, /* 154 */
{ 2, 0, sys_sched_getparam, "sched_getparam" }, /* 155 */
{ 3, 0, sys_sched_setscheduler, "sched_setscheduler" }, /* 156 */

View File

@ -242,7 +242,7 @@
{ 5, 0, sys_mlock, "mlock" }, /* 237 */
{ 5, 0, sys_munlock, "munlock" }, /* 238 */
{ 5, 0, sys_mlockall, "mlockall" }, /* 239 */
{ 5, 0, sys_munlockall, "munlockall" }, /* 240 */
{ 0, 0, sys_munlockall, "munlockall" }, /* 240 */
{ 5, 0, sys_sched_setparam,"sched_setparam"}, /* 241 */
{ 5, 0, sys_sched_getparam,"sched_getparam"}, /* 242 */
{ 5, 0, sys_sched_setscheduler,"sched_setscheduler"}, /* 243 */

View File

@ -189,7 +189,7 @@
{ 1, 0, sys_mlock, "mlock" }, /* 150 */
{ 2, 0, sys_munlock, "munlock" }, /* 151 */
{ 2, 0, sys_mlockall, "mlockall" }, /* 152 */
{ 1, 0, sys_munlockall, "munlockall" }, /* 153 */
{ 0, 0, sys_munlockall, "munlockall" }, /* 153 */
{ 0, 0, sys_sched_setparam, "sched_setparam"}, /* 154 */
{ 2, 0, sys_sched_getparam, "sched_getparam"}, /* 155 */
{ 3, 0, sys_sched_setscheduler, "sched_setscheduler"}, /* 156 */

4
mem.c
View File

@ -231,8 +231,8 @@ struct tcb *tcp;
#ifdef LINUX
static struct xlat mremap_flags[] = {
{ MREMAP_MAYMOVE, "MREMAP_MAYMOVE" },
{ 0, NULL }
{ MREMAP_MAYMOVE, "MREMAP_MAYMOVE" },
{ 0, NULL }
};
int

View File

@ -144,10 +144,45 @@ static struct xlat prctl_options[] = {
#endif
#ifdef PR_GET_PDEATHSIG
{ PR_GET_PDEATHSIG, "PR_GET_PDEATHSIG" },
#endif
#ifdef PR_GET_UNALIGN
{ PR_GET_UNALIGN, "PR_GET_UNALIGN" },
#endif
#ifdef PR_SET_UNALIGN
{ PR_SET_UNALIGN, "PR_SET_UNALIGN" },
#endif
#ifdef PR_GET_KEEPCAPS
{ PR_GET_KEEPCAPS, "PR_GET_KEEP_CAPS" },
#endif
#ifdef PR_SET_KEEPCAPS
{ PR_SET_KEEPCAPS, "PR_SET_KEEP_CAPS" },
#endif
{ 0, NULL },
};
const char *
unalignctl_string (unsigned int ctl)
{
static char buf[16];
switch (ctl) {
#ifdef PR_UNALIGN_NOPRINT
case PR_UNALIGN_NOPRINT:
return "NOPRINT";
#endif
#ifdef PR_UNALIGN_SIGBUS
case PR_UNALIGN_SIGBUS:
return "SIGBUS";
#endif
default:
break;
}
sprintf(buf, "%x", ctl);
return buf;
}
int
sys_prctl(tcp)
struct tcb *tcp;
@ -164,6 +199,16 @@ struct tcb *tcp;
#ifdef PR_SET_DEATHSIG
case PR_GET_PDEATHSIG:
break;
#endif
#ifdef PR_SET_UNALIGN
case PR_SET_UNALIGN:
tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
break;
#endif
#ifdef PR_GET_UNALIGN
case PR_GET_UNALIGN:
tprintf(", %#lx", tcp->u_arg[1]);
break;
#endif
default:
for (i = 1; i < tcp->u_nargs; i++)
@ -177,6 +222,20 @@ struct tcb *tcp;
for (i=1; i<tcp->u_nargs; i++)
tprintf(", %#lx", tcp->u_arg[i]);
break;
#endif
#ifdef PR_SET_UNALIGN
case PR_SET_UNALIGN:
break;
#endif
#ifdef PR_GET_UNALIGN
case PR_GET_UNALIGN:
{
int ctl;
umove(tcp, tcp->u_arg[1], &ctl);
tcp->auxstr = unalignctl_string(ctl);
return RVAL_STR;
}
#endif
default:
break;
@ -395,6 +454,14 @@ int new;
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_ORIG_D0), new)<0)
return -1;
return 0;
#elif defined(SPARC)
struct pt_regs regs;
if (ptrace(PTRACE_GETREGS, tcp->pid, (char*)&regs, 0)<0)
return -1;
reg.r_g1=new;
if (ptrace(PTRACE_SETREGS, tcp->pid, (char*)&regs, 0)<0)
return -1;
return 0;
#elif defined(MIPS)
if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_V0), new)<0)
return -1;

View File

@ -752,19 +752,24 @@ struct tcb *tcp;
long sp;
if (entering(tcp)) {
/* offset of sigcontext in the kernel's sigframe structure: */
# define SIGFRAME_SC_OFFSET 0x90
tcp->u_arg[0] = 0;
if (upeek(tcp->pid, PT_R12, &sp) < 0)
return 0;
if (umove(tcp, sp + 16, &sc) < 0)
if (umove(tcp, sp + 16 + SIGFRAME_SC_OFFSET, &sc) < 0)
return 0;
tcp->u_arg[0] = 1;
memcpy(tcp->u_arg + 1, &sc.sc_mask, sizeof(tcp->u_arg[1]));
memcpy(tcp->u_arg + 1, &sc.sc_mask, sizeof(sc.sc_mask));
}
else {
sigset_t sigm;
memcpy(&sigm, tcp->u_arg + 1, sizeof (sigm));
tcp->u_rval = tcp->u_error = 0;
if (tcp->u_arg[0] == 0)
return 0;
tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]);
tcp->auxstr = sprintsigmask("mask now ", &sigm, 0);
return RVAL_NONE | RVAL_STR;
}
return 0;

View File

@ -439,18 +439,19 @@ char *argv[];
* It is important to set groups before we
* lose privileges on setuid.
*/
if (username != NULL
&& initgroups(username, run_gid) < 0) {
perror("initgroups");
exit(1);
}
if (setregid(run_gid, run_egid) < 0) {
perror("setregid");
exit(1);
}
if (setreuid(run_uid, run_euid) < 0) {
perror("setreuid");
exit(1);
if (username != NULL) {
if (initgroups(username, run_gid) < 0) {
perror("initgroups");
exit(1);
}
if (setregid(run_gid, run_egid) < 0) {
perror("setregid");
exit(1);
}
if (setreuid(run_uid, run_euid) < 0) {
perror("setreuid");
exit(1);
}
}
}
else

View File

@ -775,7 +775,8 @@ struct tcb *tcp;
scno = tcp->status.PR_WHAT;
#endif /* !HAVE_PR_SYSCALL */
#endif
tcp->scno = scno;
if (!(tcp->flags & TCB_INSYSCALL))
tcp->scno = scno;
return 1;
}
@ -1074,10 +1075,14 @@ struct tcb *tcp;
}
#elif defined (IA64)
{
unsigned long *bsp, i;
unsigned long *bsp, cfm, i;
if (upeek(pid, PT_AR_BSP, (long *) &bsp) < 0)
return -1;
if (upeek(pid, PT_CFM, (long *) &cfm) < 0)
return -1;
bsp = ia64_rse_skip_regs(bsp, -(cfm & 0x7f));
tcp->u_nargs = sysent[tcp->scno].nargs;
for (i = 0; i < tcp->u_nargs; ++i) {

View File

@ -68,9 +68,7 @@ struct pt_regs;
#include <asm/cachectl.h>
#endif
#ifdef LINUX
#include <linux/sysctl.h>
#endif
static struct xlat mount_flags[] = {
{ MS_RDONLY, "MS_RDONLY" },
@ -158,6 +156,50 @@ struct tcb *tcp;
return 0;
}
#include <linux/reboot.h>
static struct xlat bootflags1[] = {
{ LINUX_REBOOT_MAGIC1, "LINUX_REBOOT_MAGIC1" },
{ 0, NULL },
};
static struct xlat bootflags2[] = {
{ LINUX_REBOOT_MAGIC2, "LINUX_REBOOT_MAGIC2" },
{ LINUX_REBOOT_MAGIC2A, "LINUX_REBOOT_MAGIC2A" },
{ LINUX_REBOOT_MAGIC2B, "LINUX_REBOOT_MAGIC2B" },
{ 0, NULL },
};
static struct xlat bootflags3[] = {
{ LINUX_REBOOT_CMD_CAD_OFF, "LINUX_REBOOT_CMD_CAD_OFF" },
{ LINUX_REBOOT_CMD_RESTART, "LINUX_REBOOT_CMD_RESTART" },
{ LINUX_REBOOT_CMD_HALT, "LINUX_REBOOT_CMD_HALT" },
{ LINUX_REBOOT_CMD_CAD_ON, "LINUX_REBOOT_CMD_CAD_ON" },
{ LINUX_REBOOT_CMD_POWER_OFF, "LINUX_REBOOT_CMD_POWER_OFF" },
{ LINUX_REBOOT_CMD_RESTART2, "LINUX_REBOOT_CMD_RESTART2" },
{ 0, NULL },
};
int
sys_reboot(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
if (!printflags(bootflags1, tcp->u_arg[0]))
tprintf("LINUX_REBOOT_MAGIC???");
tprintf(", ");
if (!printflags(bootflags2, tcp->u_arg[1]))
tprintf("LINUX_REBOOT_MAGIC???");
tprintf(", ");
if (!printflags(bootflags3, tcp->u_arg[2]))
tprintf("LINUX_REBOOT_CMD_???");
if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
tprintf(", ");
printstr(tcp, tcp->u_arg[3], -1);
}
}
return 0;
}
#ifdef M68K
static struct xlat cacheflush_scope[] = {
#ifdef FLUSH_SCOPE_LINE
@ -1409,14 +1451,14 @@ struct tcb *tcp;
if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
fprintf(stderr, "sys_capget: no memory\n");
tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
return;l
return -1;
}
}
if (!arg1) {
if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
fprintf(stderr, "sys_capget: no memory\n");
tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
return;
return -1;
}
}
@ -1461,14 +1503,14 @@ struct tcb *tcp;
if ((arg0 = malloc(sizeof(*arg0))) == NULL) {
fprintf(stderr, "sys_capset: no memory\n");
tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
return;l
return -1;
}
}
if (!arg1) {
if ((arg1 = malloc(sizeof(*arg1))) == NULL) {
fprintf(stderr, "sys_capset: no memory\n");
tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
return;
return -1;
}
}

45
term.c
View File

@ -75,6 +75,51 @@ static struct xlat baud_options[] = {
#ifdef B38400
{ B38400, "B38400" },
#endif
#ifdef B57600
{ B57600, "B57600" },
#endif
#ifdef B115200
{ B115200, "B115200" },
#endif
#ifdef B230400
{ B230400, "B230400" },
#endif
#ifdef B460800
{ B460800, "B460800" },
#endif
#ifdef B500000
{ B500000, "B500000" },
#endif
#ifdef B576000
{ B576000, "B576000" },
#endif
#ifdef B921600
{ B921600, "B921600" },
#endif
#ifdef B1000000
{ B1000000, "B1000000" },
#endif
#ifdef B1152000
{ B1152000, "B1152000" },
#endif
#ifdef B1500000
{ B1500000, "B1500000" },
#endif
#ifdef B2000000
{ B2000000, "B2000000" },
#endif
#ifdef B2500000
{ B2500000, "B2500000" },
#endif
#ifdef B3000000
{ B3000000, "B3000000" },
#endif
#ifdef B3500000
{ B3500000, "B3500000" },
#endif
#ifdef B4000000
{ B4000000, "B4000000" },
#endif
#ifdef EXTA
{ EXTA, "EXTA" },
#endif