Sort ID->pledge name translation in the same order as the manual page
authorderaadt <deraadt@openbsd.org>
Fri, 11 Jun 2021 04:44:25 +0000 (04:44 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 11 Jun 2021 04:44:25 +0000 (04:44 +0000)
(which are idiomatically sorted rather than numerically), so that ps(1)
"-o pledge" is easier to understand.
from Josh Rickmar
ok semarie kn dv

sys/sys/pledge.h

index 6dce461..a8e23ad 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pledge.h,v 1.41 2020/04/05 07:31:45 visa Exp $        */
+/*     $OpenBSD: pledge.h,v 1.42 2021/06/11 04:44:25 deraadt Exp $     */
 
 /*
  * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -76,42 +76,42 @@ static const struct {
        uint64_t        bits;
        const char      *name;
 } pledgenames[] = {
+       { PLEDGE_STDIO,         "stdio" },
        { PLEDGE_RPATH,         "rpath" },
        { PLEDGE_WPATH,         "wpath" },
        { PLEDGE_CPATH,         "cpath" },
-       { PLEDGE_STDIO,         "stdio" },
+       { PLEDGE_DPATH,         "dpath" },
        { PLEDGE_TMPPATH,       "tmppath" },
-       { PLEDGE_DNS,           "dns" },
        { PLEDGE_INET,          "inet" },
+       { PLEDGE_MCAST,         "mcast" },
+       { PLEDGE_FATTR,         "fattr" },
+       { PLEDGE_CHOWNUID,      "chown" },
        { PLEDGE_FLOCK,         "flock" },
        { PLEDGE_UNIX,          "unix" },
-       { PLEDGE_ID,            "id" },
-       { PLEDGE_TAPE,          "tape" },
+       { PLEDGE_DNS,           "dns" },
        { PLEDGE_GETPW,         "getpw" },
-       { PLEDGE_PROC,          "proc" },
-       { PLEDGE_SETTIME,       "settime" },
-       { PLEDGE_FATTR,         "fattr" },
-       { PLEDGE_PROTEXEC,      "prot_exec" },
-       { PLEDGE_TTY,           "tty" },
        { PLEDGE_SENDFD,        "sendfd" },
        { PLEDGE_RECVFD,        "recvfd" },
+       { PLEDGE_TAPE,          "tape" },
+       { PLEDGE_TTY,           "tty" },
+       { PLEDGE_PROC,          "proc" },
        { PLEDGE_EXEC,          "exec" },
-       { PLEDGE_ROUTE,         "route" },
-       { PLEDGE_MCAST,         "mcast" },
-       { PLEDGE_VMINFO,        "vminfo" },
+       { PLEDGE_PROTEXEC,      "prot_exec" },
+       { PLEDGE_SETTIME,       "settime" },
        { PLEDGE_PS,            "ps" },
-       { PLEDGE_DISKLABEL,     "disklabel" },
+       { PLEDGE_VMINFO,        "vminfo" },
+       { PLEDGE_ID,            "id" },
        { PLEDGE_PF,            "pf" },
+       { PLEDGE_ROUTE,         "route" },
+       { PLEDGE_WROUTE,        "wroute" },
        { PLEDGE_AUDIO,         "audio" },
-       { PLEDGE_DPATH,         "dpath" },
-       { PLEDGE_DRM,           "drm" },
-       { PLEDGE_VMM,           "vmm" },
-       { PLEDGE_CHOWNUID,      "chown" },
+       { PLEDGE_VIDEO,         "video" },
        { PLEDGE_BPF,           "bpf" },
-       { PLEDGE_ERROR,         "error" },
-       { PLEDGE_WROUTE,        "wroute" },
        { PLEDGE_UNVEIL,        "unveil" },
-       { PLEDGE_VIDEO,         "video" },
+       { PLEDGE_ERROR,         "error" },
+       { PLEDGE_DISKLABEL,     "disklabel" },
+       { PLEDGE_DRM,           "drm" },
+       { PLEDGE_VMM,           "vmm" },
        { 0, NULL },
 };
 #endif