svn commit: r339093 - stable/11/contrib/openbsm/libauditd

Alan Somers asomers at FreeBSD.org
Tue Oct 2 17:42:51 UTC 2018


Author: asomers
Date: Tue Oct  2 17:42:50 2018
New Revision: 339093
URL: https://svnweb.freebsd.org/changeset/base/339093

Log:
  MFC r336613:
  
  auditd(8): Log a better error when no hostname is set in audit_control
  
  Cherry-pick from https://github.com/openbsm/openbsm/commit/01ba03b
  
  Reviewed by:	cem
  Obtained from:	OpenBSM
  Pull Request:	https://github.com/openbsm/openbsm/pull/38

Modified:
  stable/11/contrib/openbsm/libauditd/auditd_lib.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/openbsm/libauditd/auditd_lib.c
==============================================================================
--- stable/11/contrib/openbsm/libauditd/auditd_lib.c	Tue Oct  2 17:38:58 2018	(r339092)
+++ stable/11/contrib/openbsm/libauditd/auditd_lib.c	Tue Oct  2 17:42:50 2018	(r339093)
@@ -255,7 +255,8 @@ auditd_set_host(void)
 	struct auditinfo_addr aia;
 	int error, ret = ADE_NOERR;
 
-	if (getachost(auditd_host, sizeof(auditd_host)) != 0) {
+	if ((getachost(auditd_host, sizeof(auditd_host)) != 0) ||
+	    ((auditd_hostlen = strlen(auditd_host)) == 0)) {
 		ret = ADE_PARSE;
 
 		/*
@@ -272,7 +273,6 @@ auditd_set_host(void)
 			ret = ADE_AUDITON;
 		return (ret);
 	}
-	auditd_hostlen = strlen(auditd_host);
 	error = getaddrinfo(auditd_host, NULL, NULL, &res);
 	if (error)
 		return (ADE_GETADDR);


More information about the svn-src-stable-11 mailing list