From owner-p4-projects@FreeBSD.ORG Thu Aug 13 12:11:25 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 171971065673; Thu, 13 Aug 2009 12:11:25 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA3F5106564A for ; Thu, 13 Aug 2009 12:11:24 +0000 (UTC) (envelope-from marinosi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B92138FC3D for ; Thu, 13 Aug 2009 12:11:24 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7DCBOJD070719 for ; Thu, 13 Aug 2009 12:11:24 GMT (envelope-from marinosi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7DCBOaA070717 for perforce@freebsd.org; Thu, 13 Aug 2009 12:11:24 GMT (envelope-from marinosi@FreeBSD.org) Date: Thu, 13 Aug 2009 12:11:24 GMT Message-Id: <200908131211.n7DCBOaA070717@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marinosi@FreeBSD.org using -f From: Ilias Marinos To: Perforce Change Reviews Cc: Subject: PERFORCE change 167283 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2009 12:11:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=167283 Change 167283 by marinosi@marinosi_redrum on 2009/08/13 12:10:38 Implemented a new command A_LISTSLICES for the auditing syscalls. Affected files ... .. //depot/projects/soc2009/marinosi_appaudit/src/sys/bsm/audit.h#6 edit .. //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit.c#21 edit Differences ... ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/bsm/audit.h#6 (text) ==== @@ -130,6 +130,7 @@ #define A_UPDATESLICE 40 #define A_GETSLICE 41 #define A_REMOVESLICE 42 +#define A_LISTSLICES 43 /* * Audit policy controls. ==== //depot/projects/soc2009/marinosi_appaudit/src/sys/security/audit/audit.c#21 (text) ==== @@ -988,6 +988,7 @@ { struct audit_slice *as = NULL; + struct audit_slice *cur = NULL; struct ucred *cred, *newcred, *oldcred; int error; union auditon_udata udata; @@ -1000,9 +1001,9 @@ /* * The only way for 'as' to be NULL is when we want to create a new - * slice. + * slice or when we want to list all available slices. */ - if ((as == NULL) && (cmd != A_CREATESLICE)) + if ((as == NULL) && (cmd != A_CREATESLICE) && (cmd != A_LISTSLICES)) return (EINVAL); memset((void *)&udata, 0, sizeof(udata)); @@ -1402,6 +1403,19 @@ audit_slice_destroy(as); break; + case A_LISTSLICES: + /* + * Use lock to prevent slice creation/removal while iterating through + * the queue, listing the slices. + */ + uprintf("Slices List:\n"); + AUDIT_SLICES_LOCK(); + TAILQ_FOREACH(cur, &audit_slice_q, as_q) { + uprintf("%s\n", cur->as_name); + } + AUDIT_SLICES_UNLOCK(); + break; + default: return (EINVAL); }