svn commit: r208663 - projects/capabilities8/usr.bin/procstat

Robert Watson rwatson at FreeBSD.org
Sun May 30 23:00:36 UTC 2010


Author: rwatson
Date: Sun May 30 23:00:36 2010
New Revision: 208663
URL: http://svn.freebsd.org/changeset/base/208663

Log:
  Merge c174338 from the p4 TrustedBSD Capabilities branch to capabilities8:
  
    - Do not print process descriptor pid twice
    - Handle vnode, fifo, pts and procdesc with default case for network
      protocol
  
    Submitted by:   antoine
  
    Add new capability rights so that procstat can print them, update
    copyright.
  
  Sponsored by:	Google, Inc.

Modified:
  projects/capabilities8/usr.bin/procstat/procstat_files.c

Modified: projects/capabilities8/usr.bin/procstat/procstat_files.c
==============================================================================
--- projects/capabilities8/usr.bin/procstat/procstat_files.c	Sun May 30 22:59:05 2010	(r208662)
+++ projects/capabilities8/usr.bin/procstat/procstat_files.c	Sun May 30 23:00:36 2010	(r208663)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2007-2009 Robert N. M. Watson
+ * Copyright (c) 2007-2010 Robert N. M. Watson
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -168,6 +168,7 @@ static struct cap_desc {
 	{ CAP_MAC_GET,		"mg" },
 	{ CAP_MAC_SET,		"ms" },
 	{ CAP_ACCEPT,		"at" },
+	{ CAP_CONNECT,		"co" },
 	{ CAP_BIND,		"bd" },
 	{ CAP_GETSOCKOPT,	"gs" },
 	{ CAP_SETSOCKOPT,	"ss" },
@@ -182,6 +183,17 @@ static struct cap_desc {
 	{ CAP_PDGETPID,		"pg" },
 	{ CAP_PDWAIT,		"pw" },
 	{ CAP_PDKILL,		"pk" },
+	{ CAP_MAPEXEC,		"me" },
+	{ CAP_TTYHOOK,		"th" },
+	{ CAP_FCHDIR,		"cd" },
+	{ CAP_FSCK,		"fk" },
+	{ CAP_ATBASE,		"ab" },
+	{ CAP_ABSOLUTEPATH,	"ap" },
+	{ CAP_CREATE,		"cr" },
+	{ CAP_DELETE,		"de" },
+	{ CAP_MKDIR,		"md" },
+	{ CAP_RMDIR,		"rm" },
+	{ CAP_MKFIFO,		"mf" },
 };
 static const u_int	cap_desc_count = sizeof(cap_desc) /
 			    sizeof(cap_desc[0]);
@@ -414,22 +426,12 @@ procstat_files(pid_t pid, struct kinfo_p
 		}
 
 		switch (kif->kf_type) {
-		case KF_TYPE_VNODE:
-		case KF_TYPE_FIFO:
-		case KF_TYPE_PTS:
-			printf("%-3s ", "-");
-			break;
-
 		case KF_TYPE_SOCKET:
 			printf("%-3s ",
 			    protocol_to_string(kif->kf_sock_domain,
 			    kif->kf_sock_type, kif->kf_sock_protocol));
 			break;
 
-		case KF_TYPE_PROCDESC:
-			printf("%-3s %d", "-", kif->kf_pid);
-			break;
-
 		default:
 			printf("%-3s ", "-");
 		}


More information about the svn-src-projects mailing list