diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2019-01-09 01:16:35 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2019-01-09 01:16:35 +0000 |
commit | 6d4db583932349d47c0ed42f7fa4d14aac52482c (patch) | |
tree | dc349cbf212579c8aa7136782c2150643fb0df3e /contrib/openbsm | |
parent | a68cc388790587b330a01380a0c1864fb9ff3f1e (diff) | |
download | src-test-6d4db583932349d47c0ed42f7fa4d14aac52482c.tar.gz src-test-6d4db583932349d47c0ed42f7fa4d14aac52482c.zip |
In r316006 the getstrfromtype_locked() function was modified to return
an empty string, instead of NULL, if an entry is missing in the audit_control
file. Because of that change the getachost() function started to return
success even if the host name was not defined in the audit_control.
This in turn led to auditd_hostlen always being set (for an empty host it was
set to 0). If auditd_hostlen was not equal to -1 we were trying to append
the host name to trail file name. All this led to situation where when host
name is not defined in audit_control, auditd will create trail files with
a leading '.', which breaks auditdistd as it doesn't work with longer audit
trail file names.
Fix this by appending host name to the trail file name only if the host name
is not empty.
Notes
Notes:
svn path=/head/; revision=342873
Diffstat (limited to 'contrib/openbsm')
-rw-r--r-- | contrib/openbsm/libauditd/auditd_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/openbsm/libauditd/auditd_lib.c b/contrib/openbsm/libauditd/auditd_lib.c index a6733bcf88a91..1e21adb39bb76 100644 --- a/contrib/openbsm/libauditd/auditd_lib.c +++ b/contrib/openbsm/libauditd/auditd_lib.c @@ -193,7 +193,7 @@ affixdir(char *name, struct dir_ent *dirent) /* * If the host is set then also add the hostname to the filename. */ - if (auditd_hostlen != -1) + if (auditd_hostlen > 0) asprintf(&fn, "%s/%s.%s", dirent->dirname, name, auditd_host); else asprintf(&fn, "%s/%s", dirent->dirname, name); |