summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-15 07:44:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-15 07:44:39 +0000
commit616e165e71ddb02533c12b4fdf778413826d5b1a (patch)
treeea1439b0c9b3e4a6703a106509d66777cf219a64 /usr.bin
parent6d1f59c6940f9f1ac0f56962df14033c55c8fa2e (diff)
very simple pledges, stdio and rpath, very boring
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/locate/bigram/locate.bigram.c7
-rw-r--r--usr.bin/locate/locate/locate.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c
index 8e944e1c087..58c1c030906 100644
--- a/usr.bin/locate/bigram/locate.bigram.c
+++ b/usr.bin/locate/bigram/locate.bigram.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: locate.bigram.c,v 1.13 2015/01/16 06:40:09 deraadt Exp $
+ * $OpenBSD: locate.bigram.c,v 1.14 2015/11/15 07:44:38 deraadt Exp $
*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
* Copyright (c) 1989, 1993
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locate.bigram.c,v 1.13 2015/01/16 06:40:09 deraadt Exp $
+ * $Id: locate.bigram.c,v 1.14 2015/11/15 07:44:38 deraadt Exp $
*/
/*
@@ -59,6 +59,9 @@ main(void)
u_char *oldpath = buf1, *path = buf2;
u_int i, j;
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
while (fgets(path, sizeof(buf2), stdin) != NULL) {
/*
diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c
index 66f34a209b9..1b38ced9c96 100644
--- a/usr.bin/locate/locate/locate.c
+++ b/usr.bin/locate/locate/locate.c
@@ -1,5 +1,5 @@
/*
- * $OpenBSD: locate.c,v 1.29 2015/10/23 14:16:02 tedu Exp $
+ * $OpenBSD: locate.c,v 1.30 2015/11/15 07:44:38 deraadt Exp $
*
* Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
* Copyright (c) 1989, 1993
@@ -32,7 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: locate.c,v 1.29 2015/10/23 14:16:02 tedu Exp $
+ * $Id: locate.c,v 1.30 2015/11/15 07:44:38 deraadt Exp $
*/
/*
@@ -132,6 +132,9 @@ main(int argc, char *argv[])
char **dbv = NULL;
(void) setlocale(LC_ALL, "");
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
+
while ((ch = getopt(argc, argv, "bScd:il:")) != -1)
switch (ch) {
case 'b':