openbsd-ports/games/nethack/patches/patch-src_files_c
otto 51e6ffdaf6 Make sure we clear the saved id, by calling sete{u,g}id() before
set{g,u}id(); this makes gzip able to open /dev/stdin again. Problem
seen by Joachim Schipper in PR 5015. ok espie@
2006-02-11 16:15:46 +00:00

14 lines
471 B
Plaintext

$OpenBSD: patch-src_files_c,v 1.1 2006/02/11 16:15:46 otto Exp $
--- src/files.c.orig Sat Feb 11 09:31:55 2006
+++ src/files.c Sat Feb 11 09:32:01 2006
@@ -1153,7 +1153,9 @@ boolean uncomp;
redirect(filename, RDBMODE, stdin, uncomp);
redirect(cfn, WRBMODE, stdout, uncomp);
}
+ (void) setegid(getgid());
(void) setgid(getgid());
+ (void) seteuid(getuid());
(void) setuid(getuid());
(void) execv(args[0], (char *const *) args);
perror((char *)0);