diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-03-18 18:31:24 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-03-18 18:31:24 +0000 |
commit | 7c231dc685e975ee45b3a9f198684ded82df4369 (patch) | |
tree | 23d296a0736176d58edef3baf847374d8aa13145 /sys/security | |
parent | 7484436a849b8e0e6e8ffe1ad230e0c8aafce285 (diff) | |
download | FreeBSD-src-7c231dc685e975ee45b3a9f198684ded82df4369.zip FreeBSD-src-7c231dc685e975ee45b3a9f198684ded82df4369.tar.gz |
Merge perforce change 93199:
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).
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/security')
-rw-r--r-- | sys/security/audit/audit.c | 6 | ||||
-rw-r--r-- | sys/security/audit/audit_private.h | 2 | ||||
-rw-r--r-- | sys/security/audit/audit_syscalls.c | 2 | ||||
-rw-r--r-- | sys/security/audit/audit_trigger.c | 5 |
4 files changed, 8 insertions, 7 deletions
diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c index 5eaa0be..47de6ee 100644 --- a/sys/security/audit/audit.c +++ b/sys/security/audit/audit.c @@ -305,7 +305,7 @@ audit_record_write(struct vnode *vp, struct kaudit_record *ar, * 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. @@ -328,7 +328,7 @@ audit_record_write(struct vnode *vp, struct kaudit_record *ar, 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 @@ -340,7 +340,7 @@ audit_record_write(struct vnode *vp, struct kaudit_record *ar, (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); } /* diff --git a/sys/security/audit/audit_private.h b/sys/security/audit/audit_private.h index 3ca0115..41efe90 100644 --- a/sys/security/audit/audit_private.h +++ b/sys/security/audit/audit_private.h @@ -287,7 +287,7 @@ void canon_path(struct thread *td, char *path, char *cpath); * asynchronously. */ void audit_trigger_init(void); -void send_trigger(unsigned int trigger); +int send_trigger(unsigned int trigger); /* * General audit related functions. diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index 19f1d30..091e023 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -335,7 +335,7 @@ auditon(struct thread *td, struct auditon_args *uap) 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 */ diff --git a/sys/security/audit/audit_trigger.c b/sys/security/audit/audit_trigger.c index 081858b..44b6de3 100644 --- a/sys/security/audit/audit_trigger.c +++ b/sys/security/audit/audit_trigger.c @@ -122,14 +122,14 @@ audit_write(struct cdev *dev, struct uio *uio, int ioflag) 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 @@ send_trigger(unsigned int trigger) TAILQ_INSERT_TAIL(&trigger_list, ti, list); wakeup(&trigger_list); mtx_unlock(&audit_trigger_mtx); + return (0); } static struct cdevsw audit_cdevsw = { |