From owner-p4-projects@FreeBSD.ORG Mon Feb 6 16:33:26 2006 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 9174C16A423; Mon, 6 Feb 2006 16:33:25 +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 4FDB316A420 for ; Mon, 6 Feb 2006 16:33:25 +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 175C043D49 for ; Mon, 6 Feb 2006 16:33:25 +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 k16GXOmk060007 for ; Mon, 6 Feb 2006 16:33:24 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 k16GXOY4060004 for perforce@freebsd.org; Mon, 6 Feb 2006 16:33:24 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 6 Feb 2006 16:33:24 GMT Message-Id: <200602061633.k16GXOY4060004@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 91241 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: Mon, 06 Feb 2006 16:33:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=91241 Change 91241 by rwatson@rwatson_zoo on 2006/02/06 16:33:03 Fix a number of bugs relating to queue handling. Audit pipes now appear to work at a fairly basic level. You can test this with praudit /dev/auditpipe. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#2 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#2 (text+ko) ==== @@ -183,13 +183,14 @@ if (ap->ap_qlen >= ap->ap_qlimit) { ape_remove = TAILQ_FIRST(&ap->ap_queue); TAILQ_REMOVE(&ap->ap_queue, ape_remove, ape_queue); - audit_pipe_entry_free(ape); + audit_pipe_entry_free(ape_remove); ap->ap_drops++; audit_pipe_drops++; } TAILQ_INSERT_TAIL(&ap->ap_queue, ape, ape_queue); ap->ap_inserts++; + ap->ap_qlen++; } /* @@ -250,6 +251,7 @@ if (ap == NULL) return (NULL); ap->ap_qlimit = AUDIT_PIPE_QLIMIT_DEFAULT; + TAILQ_INIT(&ap->ap_queue); TAILQ_INSERT_HEAD(&audit_pipe_list, ap, ap_list); audit_pipe_count++; audit_pipe_ever++; @@ -321,12 +323,13 @@ mtx_lock(&audit_pipe_mtx); ap = dev->si_drv1; - if (ap != NULL) { + if (ap == NULL) { ap = audit_pipe_alloc(); if (ap == NULL) { mtx_unlock(&audit_pipe_mtx); return (ENOMEM); } + dev->si_drv1 = ap; } else if (ap->ap_open) { mtx_unlock(&audit_pipe_mtx); return (EBUSY);