2003-09-06 Dmitry V. Levin <ldv@altlinux.org>

* util.c (printuid): New function.
	* defs.h: Declare it.
	* file.c (sys_chown): Use it.
	* file.c (sys_fchown): Likewise.
	* process.c (sys_setreuid, sys_setregid, sys_setresuid,
	sys_setresgid): Likewise.
This commit is contained in:
Roland McGrath 2003-11-13 22:32:27 +00:00
parent 83bd47a91e
commit 6bc1220fe3
3 changed files with 15 additions and 3 deletions

1
defs.h
View File

@ -441,6 +441,7 @@ extern void printsiginfo P((siginfo_t *, int));
extern void printsock P((struct tcb *, long, int));
extern void print_sock_optmgmt P((struct tcb *, long, int));
extern void printrusage P((struct tcb *, long));
extern void printuid P((const char *, unsigned long));
extern int clearbpt P((struct tcb *));
extern int setbpt P((struct tcb *));
extern int sigishandled P((struct tcb *, int));

8
file.c
View File

@ -1721,7 +1721,8 @@ struct tcb *tcp;
{
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprintf(", %lu, %lu", tcp->u_arg[1], tcp->u_arg[2]);
printuid(", ", tcp->u_arg[1]);
printuid(", ", tcp->u_arg[2]);
}
return 0;
}
@ -1731,8 +1732,9 @@ sys_fchown(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
tprintf("%ld, %lu, %lu",
tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
tprintf("%ld", tcp->u_arg[0]);
printuid(", ", tcp->u_arg[1]);
printuid(", ", tcp->u_arg[2]);
}
return 0;
}

9
util.c
View File

@ -313,6 +313,15 @@ char *fmt;
tprintf("]");
}
void
printuid(text, uid)
const char *text;
unsigned long uid;
{
tprintf("%s", text);
tprintf((uid == -1) ? "%ld" : "%lu", uid);
}
static char path[MAXPATHLEN + 1];
void