diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2023-07-24 01:02:48 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2023-07-24 01:02:48 +0000 |
commit | c184061587cca1e314c1e659ad6d04f789346960 (patch) | |
tree | a3965dbcc478a359d7a1244a99ede86381a5b924 | |
parent | d996aac500be9c2888fc3fc9561d1ba2a9da7dcc (diff) |
I added the 2nd argument (execpromises) to pledge(2), and then hunted
for more than a year code which could use it; but in all non-trivial
circumstances (programs which would benefit), I was stopped by issues
(in particular by environment variable behavious). But I never looked
in ldd(1). This is the FIRST one which is completely obvious.
spledge(NULL, "stdio rpath")
ok guenther
-rw-r--r-- | libexec/ld.so/ldd/ldd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/ldd/ldd.c b/libexec/ld.so/ldd/ldd.c index 860f46318d2..9e8c5065cd8 100644 --- a/libexec/ld.so/ldd/ldd.c +++ b/libexec/ld.so/ldd/ldd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldd.c,v 1.23 2023/07/13 19:04:50 jasper Exp $ */ +/* $OpenBSD: ldd.c,v 1.24 2023/07/24 01:02:47 deraadt Exp $ */ /* * Copyright (c) 2001 Artur Grabowski <art@openbsd.org> * All rights reserved. @@ -183,6 +183,8 @@ doit(char *name) _exit(0); } + if (pledge(NULL, "stdio rpath") == -1) + err(1, "pledge"); execl(name, name, (char *)NULL); perror(name); _exit(1); |