diff options
author | eivind <eivind@FreeBSD.org> | 1997-02-23 03:29:36 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1997-02-23 03:29:36 +0000 |
commit | 9b98797d2988c73c3264b3c18a8268a7168be61b (patch) | |
tree | debc3789ae84410cbd1a48a42efcf48895929832 /games/cribbage | |
parent | 374ff5ff08a60888d0667a306e2a68abb168a370 (diff) | |
download | FreeBSD-src-9b98797d2988c73c3264b3c18a8268a7168be61b.zip FreeBSD-src-9b98797d2988c73c3264b3c18a8268a7168be61b.tar.gz |
Add setuid() before running the pager - from the code audit.
Submitted by: Mark Huizer <xaa@stack.nl>
Diffstat (limited to 'games/cribbage')
-rw-r--r-- | games/cribbage/instr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index a0414d8..5df7dae 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -74,6 +74,10 @@ instructions() if (pager = rindex(path, '/')) ++pager; pager = path; + if (setuid(getuid()) < 0) { + (void)fprintf(stderr, "cribbage: unable to setuid\n"); + _exit(1); + } execlp(path, pager, _PATH_INSTR, (char *)NULL); (void)fprintf(stderr, "cribbage: %s.\n", strerror(errno)); _exit(1); |