Date: Mon, 6 Feb 2006 16:33:24 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 91241 for review Message-ID: <200602061633.k16GXOY4060004@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602061633.k16GXOY4060004>