diff options
Diffstat (limited to 'usr.bin/msgs/msgs.c')
-rw-r--r-- | usr.bin/msgs/msgs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index 66091e883cb..d16e6fa93e4 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msgs.c,v 1.29 2004/10/02 04:14:39 deraadt Exp $ */ +/* $OpenBSD: msgs.c,v 1.30 2005/07/04 01:54:10 djm Exp $ */ /* $NetBSD: msgs.c,v 1.7 1995/09/28 06:57:40 tls Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: msgs.c,v 1.29 2004/10/02 04:14:39 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: msgs.c,v 1.30 2005/07/04 01:54:10 djm Exp $"; #endif #endif /* not lint */ @@ -173,8 +173,11 @@ main(int argc, char *argv[]) #endif time(&t); - seteuid(uid = getuid()); - setuid(uid); + uid = getuid(); + if (setresuid(uid, uid, uid) == -1) { + perror("setresuid"); + exit(1); + } ruptible = (signal(SIGINT, SIG_IGN) == SIG_DFL); if (ruptible) signal(SIGINT, SIG_DFL); |