summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/kdump/kdump.c9
-rw-r--r--usr.bin/kdump/mksubr1
-rw-r--r--usr.bin/procstat/procstat_files.c51
3 files changed, 44 insertions, 17 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 2769832..82317f2 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1008,6 +1008,7 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags)
narg--;
break;
case SYS_cap_new:
+ case SYS_cap_rights_limit:
print_number(ip, narg, c);
putchar(',');
arg = *ip;
@@ -1035,6 +1036,14 @@ ktrsyscall(struct ktr_syscall *ktr, u_int flags)
}
capname(arg);
break;
+ case SYS_cap_fcntls_limit:
+ print_number(ip, narg, c);
+ putchar(',');
+ arg = *ip;
+ ip++;
+ narg--;
+ capfcntlname(arg);
+ break;
case SYS_posix_fadvise:
print_number(ip, narg, c);
print_number(ip, narg, c);
diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index d56f030..aed8291 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -361,6 +361,7 @@ _EOF_
auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h"
auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h"
auto_or_type "capname" "CAP_[A-Z]+[[:space:]]+0x[01248]{16}ULL" "sys/capability.h"
+auto_or_type "capfcntlname" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capability.h"
auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h"
auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h"
auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c
index 3773900..030bba1 100644
--- a/usr.bin/procstat/procstat_files.c
+++ b/usr.bin/procstat/procstat_files.c
@@ -139,33 +139,34 @@ static struct cap_desc {
/* General file I/O. */
{ CAP_READ, "rd" },
{ CAP_WRITE, "wr" },
+ { CAP_SEEK, "se" },
{ CAP_MMAP, "mm" },
- { CAP_MAPEXEC, "me" },
+ { CAP_CREATE, "cr" },
{ CAP_FEXECVE, "fe" },
{ CAP_FSYNC, "fy" },
{ CAP_FTRUNCATE, "ft" },
- { CAP_SEEK, "se" },
/* VFS methods. */
- { CAP_FCHFLAGS, "cf" },
{ CAP_FCHDIR, "cd" },
+ { CAP_FCHFLAGS, "cf" },
{ CAP_FCHMOD, "cm" },
{ CAP_FCHOWN, "cn" },
{ CAP_FCNTL, "fc" },
- { CAP_FPATHCONF, "fp" },
{ CAP_FLOCK, "fl" },
+ { CAP_FPATHCONF, "fp" },
{ CAP_FSCK, "fk" },
{ CAP_FSTAT, "fs" },
{ CAP_FSTATFS, "sf" },
{ CAP_FUTIMES, "fu" },
- { CAP_CREATE, "cr" },
- { CAP_DELETE, "de" },
- { CAP_MKDIR, "md" },
- { CAP_RMDIR, "rm" },
- { CAP_MKFIFO, "mf" },
- { CAP_MKNOD, "mn" },
-
- /* Lookups - used to constraint *at() calls. */
+ { CAP_LINKAT, "li" },
+ { CAP_MKDIRAT, "md" },
+ { CAP_MKFIFOAT, "mf" },
+ { CAP_MKNODAT, "mn" },
+ { CAP_RENAMEAT, "rn" },
+ { CAP_SYMLINKAT, "sl" },
+ { CAP_UNLINKAT, "un" },
+
+ /* Lookups - used to constrain *at() calls. */
{ CAP_LOOKUP, "lo" },
/* Extended attributes. */
@@ -213,6 +214,24 @@ static struct cap_desc {
{ CAP_PDGETPID, "pg" },
{ CAP_PDWAIT, "pw" },
{ CAP_PDKILL, "pk" },
+
+ /* Aliases and defines that combine multiple rights. */
+ { CAP_PREAD, "prd" },
+ { CAP_PWRITE, "pwr" },
+
+ { CAP_MMAP_R, "mmr" },
+ { CAP_MMAP_W, "mmw" },
+ { CAP_MMAP_X, "mmx" },
+ { CAP_MMAP_RW, "mrw" },
+ { CAP_MMAP_RX, "mrx" },
+ { CAP_MMAP_WX, "mwx" },
+ { CAP_MMAP_RWX, "mma" },
+
+ { CAP_RECV, "re" },
+ { CAP_SEND, "sd" },
+
+ { CAP_SOCK_CLIENT, "scl" },
+ { CAP_SOCK_SERVER, "ssr" },
};
static const u_int cap_desc_count = sizeof(cap_desc) /
sizeof(cap_desc[0]);
@@ -225,7 +244,7 @@ width_capability(cap_rights_t rights)
count = 0;
width = 0;
for (i = 0; i < cap_desc_count; i++) {
- if (rights & cap_desc[i].cd_right) {
+ if ((cap_desc[i].cd_right & ~rights) == 0) {
width += strlen(cap_desc[i].cd_desc);
if (count)
width++;
@@ -249,7 +268,7 @@ print_capability(cap_rights_t rights, u_int capwidth)
printf("-");
}
for (i = 0; i < cap_desc_count; i++) {
- if (rights & cap_desc[i].cd_right) {
+ if ((cap_desc[i].cd_right & ~rights) == 0) {
printf("%s%s", count ? "," : "", cap_desc[i].cd_desc);
width += strlen(cap_desc[i].cd_desc);
if (count)
@@ -261,7 +280,7 @@ print_capability(cap_rights_t rights, u_int capwidth)
void
procstat_files(struct procstat *procstat, struct kinfo_proc *kipp)
-{
+{
struct sockstat sock;
struct filestat_list *head;
struct filestat *fst;
@@ -423,8 +442,6 @@ procstat_files(struct procstat *procstat, struct kinfo_proc *kipp)
printf("%s", fst->fs_fflags & PS_FST_FFLAG_NONBLOCK ? "n" : "-");
printf("%s", fst->fs_fflags & PS_FST_FFLAG_DIRECT ? "d" : "-");
printf("%s", fst->fs_fflags & PS_FST_FFLAG_HASLOCK ? "l" : "-");
- printf("%s ", fst->fs_fflags & PS_FST_FFLAG_CAPABILITY ?
- "c" : "-");
if (!Cflag) {
if (fst->fs_ref_count > -1)
printf("%3d ", fst->fs_ref_count);
OpenPOWER on IntegriCloud