summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-05 06:43:31 +0000
committerderaadt <deraadt@openbsd.org>2015-10-05 06:43:31 +0000
commit16c00009ff907ff99833265d5dd7f143d38cb7cf (patch)
tree5c74a25d67bbef20ed117bb36266f3aa2382f126
parenttame "stdio rpath" for the entire lifetime. newsyntax() could open a file (diff)
downloadwireguard-openbsd-16c00009ff907ff99833265d5dd7f143d38cb7cf.tar.xz
wireguard-openbsd-16c00009ff907ff99833265d5dd7f143d38cb7cf.zip
tame "stdio getpw" right at the top; this runs the whole gamut of
getpw/gr type functions allowed in that set. ok doug
-rw-r--r--usr.bin/id/id.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
index 59152954bb4..e6b3d20ae8b 100644
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: id.c,v 1.24 2015/10/05 06:30:37 deraadt Exp $ */
+/* $OpenBSD: id.c,v 1.25 2015/10/05 06:43:31 deraadt Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -58,6 +58,9 @@ main(int argc, char *argv[])
gid_t gid;
const char *opts;
+ if (tame("stdio getpw", NULL) == -1)
+ err(1, "tame");
+
cflag = Gflag = gflag = nflag = pflag = rflag = uflag = 0;
if (strcmp(getprogname(), "groups") == 0) {