From owner-p4-projects@FreeBSD.ORG Wed Sep 21 10:59:10 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 49E8416A421; Wed, 21 Sep 2005 10:59:10 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24A9316A41F for ; Wed, 21 Sep 2005 10:59:10 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2B4E43D45 for ; Wed, 21 Sep 2005 10:59:09 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8LAx9rn040780 for ; Wed, 21 Sep 2005 10:59:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8LAx9JB040777 for perforce@freebsd.org; Wed, 21 Sep 2005 10:59:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 21 Sep 2005 10:59:09 GMT Message-Id: <200509211059.j8LAx9JB040777@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 84045 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: Wed, 21 Sep 2005 10:59:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=84045 Change 84045 by rwatson@rwatson_zoo on 2005/09/21 10:58:23 Switch to switch() in audit_arg_file(). Use f_vnode pointer instead of f_data, which lets us audit paths for fifos. wsalamon suggests in the future we might actually want to audit f_vnode unconditionally, if non-NULL, regardless of f_type. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#32 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#32 (text+ko) ==== @@ -2159,17 +2159,18 @@ /* * XXXAUDIT: Why is the (ar == NULL) test only in the socket case? */ - if (fp->f_type == DTYPE_VNODE) { - vp = fp->f_data; + switch (fp->f_type) { + case DTYPE_VNODE: + case DTYPE_FIFO: + vp = fp->f_vnode; vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); audit_arg_vnpath(vp, ARG_VNODE1); VOP_UNLOCK(vp, 0, curthread); VFS_UNLOCK_GIANT(vfslocked); - return; - } + break; - if (fp->f_type == DTYPE_SOCKET) { + case DTYPE_SOCKET: ar = currecord(); if (ar == NULL) return; @@ -2198,7 +2199,11 @@ pcb->inp_lport; ar->k_ar.ar_valid_arg |= ARG_SOCKINFO; } + break; + + default: /* XXXAUDIT: else? */ + break; } }