From owner-p4-projects@FreeBSD.ORG Sun Mar 12 15:37:43 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 7CD3016A547; Sun, 12 Mar 2006 15:37:43 +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 9338416A4EA for ; Sun, 12 Mar 2006 15:37:39 +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 A578F43D45 for ; Sun, 12 Mar 2006 15:37:26 +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 k2CFbQ1C008114 for ; Sun, 12 Mar 2006 15:37:26 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 k2CFbQxk008111 for perforce@freebsd.org; Sun, 12 Mar 2006 15:37:26 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 12 Mar 2006 15:37:26 GMT Message-Id: <200603121537.k2CFbQxk008111@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 93199 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: Sun, 12 Mar 2006 15:37:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=93199 Change 93199 by rwatson@rwatson_zoo on 2006/03/12 15:36:37 Change send_trigger() prototype to return an int, so that user space callers can tell if the message was successfully placed in the trigger queue. This isn't quite the same as it being successfully received, but is close enough that we can generate a more useful warning message in audit(8). Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#17 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_private.h#20 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_syscalls.c#11 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_trigger.c#9 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#17 (text+ko) ==== @@ -307,7 +307,7 @@ * then kindly suggest to the audit daemon to do something. */ if (mnt_stat->f_bfree < AUDIT_HARD_LIMIT_FREE_BLOCKS) { - send_trigger(AUDIT_TRIGGER_NO_SPACE); + (void)send_trigger(AUDIT_TRIGGER_NO_SPACE); /* Hopefully userspace did something about all the previous * triggers that were sent prior to this critical condition. * If fail-stop is set, then we're done; goodnight Gracie. @@ -330,7 +330,7 @@ temp = mnt_stat->f_blocks / (100 / audit_qctrl.aq_minfree); if (mnt_stat->f_bfree < temp) - send_trigger(AUDIT_TRIGGER_LOW_SPACE); + (void)send_trigger(AUDIT_TRIGGER_LOW_SPACE); } /* Check if the current log file is full; if so, call for @@ -342,7 +342,7 @@ (audit_file_rotate_wait == 0) && (vattr.va_size >= audit_fstat.af_filesz)) { audit_file_rotate_wait = 1; - send_trigger(AUDIT_TRIGGER_OPEN_NEW); + (void)send_trigger(AUDIT_TRIGGER_OPEN_NEW); } /* ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_private.h#20 (text+ko) ==== @@ -295,7 +295,7 @@ * asynchronously. */ void audit_trigger_init(void); -void send_trigger(unsigned int trigger); +int send_trigger(unsigned int trigger); /* * General audit related functions. ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_syscalls.c#11 (text+ko) ==== @@ -340,7 +340,7 @@ if ((udata.au_trigger < AUDIT_TRIGGER_MIN) || (udata.au_trigger > AUDIT_TRIGGER_MAX)) return (EINVAL); - send_trigger(udata.au_trigger); + return (send_trigger(udata.au_trigger)); break; } /* Copy data back to userspace for the GET comands */ ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_trigger.c#9 (text+ko) ==== @@ -122,14 +122,14 @@ return (EOPNOTSUPP); } -void +int send_trigger(unsigned int trigger) { struct trigger_info *ti; /* If nobody's listening, we ain't talking. */ if (!audit_isopen) - return; + return (ENODEV); /* * XXXAUDIT: Use a condition variable instead of msleep/wakeup? @@ -140,6 +140,7 @@ TAILQ_INSERT_TAIL(&trigger_list, ti, list); wakeup(&trigger_list); mtx_unlock(&audit_trigger_mtx); + return (0); } static struct cdevsw audit_cdevsw = {