Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Oct 2018 17:42:50 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r339093 - stable/11/contrib/openbsm/libauditd
Message-ID:  <201810021742.w92HgoO7082483@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810021742.w92HgoO7082483>