From afba5b8efdf1bac2c02ca787840a2be053c800f7 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 23 Dec 2013 06:49:38 -0600 Subject: Fix some issues raised (albeit indirectly) by Isaac Dunham. POLL_IN defined as a constant by some libc. Factor out login.c's change_identity() to xwrap.c as xsetuser(). Replace xsetuid() with xsetuser() Put a space between argument globals and non-argument globals. TT starts zeroed, don't need to re-zero entries in it. STDIN_FILENO has been 0 since 1969, even DOS copied that. Just say 0. Added an xchroot() using xchdir() to lib/xwrap.c. Remove endgrent() call until somebody can explain why it was there. --- toys/lsb/su.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/lsb') diff --git a/toys/lsb/su.c b/toys/lsb/su.c index 52d20244..04b0dc1d 100644 --- a/toys/lsb/su.c +++ b/toys/lsb/su.c @@ -60,7 +60,7 @@ void su_main() if (!passhash || strcmp(passhash, shp->sp_pwdp)) goto deny; up = xgetpwnam(name); - xsetuid(up->pw_uid); + xsetuser(up); argv = argu = xmalloc(sizeof(char *)*(toys.optc + 4)); *(argv++) = TT.s ? TT.s : up->pw_shell; -- cgit v1.2.3