Date: Sat, 23 Aug 2008 15:07:11 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 148193 for review Message-ID: <200808231507.m7NF7BFP008578@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=148193 Change 148193 by rwatson@rwatson_freebsd_capabilities on 2008/08/23 15:06:56 Allow procstat -s to print CRED_FLAG_CAPMODE on capability-mode processes. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/lib/libkvm/kvm_proc.c#3 edit .. //depot/projects/trustedbsd/capabilities/src/usr.bin/procstat/procstat_cred.c#2 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/lib/libkvm/kvm_proc.c#3 (text+ko) ==== @@ -148,6 +148,7 @@ bcopy(ucred.cr_groups, kp->ki_groups, NGROUPS * sizeof(gid_t)); kp->ki_uid = ucred.cr_uid; + kp->ki_cr_flags = ucred.cr_flags if (ucred.cr_prison != NULL) { if (KREAD(kd, (u_long)ucred.cr_prison, &pr)) { _kvm_err(kd, kd->program, ==== //depot/projects/trustedbsd/capabilities/src/usr.bin/procstat/procstat_cred.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Robert N. M. Watson + * Copyright (c) 2007-2008 Robert N. M. Watson * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,9 +41,9 @@ int i; if (!hflag) - printf("%5s %-16s %5s %5s %5s %5s %5s %5s %-20s\n", "PID", + printf("%5s %-16s %5s %5s %5s %5s %5s %5s %4s %-15s\n", "PID", "COMM", "EUID", "RUID", "SVUID", "EGID", "RGID", "SVGID", - "GROUPS"); + "FLAG", "GROUPS"); printf("%5d ", pid); printf("%-16s ", kipp->ki_comm); @@ -53,6 +53,8 @@ printf("%5d ", kipp->ki_groups[0]); printf("%5d ", kipp->ki_rgid); printf("%5d ", kipp->ki_svgid); + printf("%s", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? "C" : "-"); + printf(" "); for (i = 0; i < kipp->ki_ngroups; i++) printf("%s%d", (i > 0) ? "," : "", kipp->ki_groups[i]); printf("\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808231507.m7NF7BFP008578>