summaryrefslogtreecommitdiff
path: root/usr.bin/fstat/fstat.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-04-06 14:05:07 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-04-06 14:05:07 +0000
commit2d2537b3985221b371b2a4a1471fa2e56b846bf0 (patch)
tree92346bc366843c127a486ef2212082ecf58f70e5 /usr.bin/fstat/fstat.c
parent9fb732d8c6cc9cb7729cd15de5b371b2806394fa (diff)
Print a 'p' flag for file descriptors that were opened after pledge(2).
OK deraadt@
Diffstat (limited to 'usr.bin/fstat/fstat.c')
-rw-r--r--usr.bin/fstat/fstat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index f5cf38cd703..414302c9de1 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fstat.c,v 1.91 2017/12/08 17:51:26 deraadt Exp $ */
+/* $OpenBSD: fstat.c,v 1.92 2018/04/06 14:05:06 bluhm Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -452,6 +452,8 @@ vtrans(struct kinfo_file *kf)
strlcat(rwep, "w", sizeof rwep);
if (kf->fd_ofileflags & UF_EXCLOSE)
strlcat(rwep, "e", sizeof rwep);
+ if (kf->fd_ofileflags & UF_PLEDGED)
+ strlcat(rwep, "p", sizeof rwep);
printf(" %4s", rwep);
switch (kf->v_type) {
case VBLK: