From nobody Fri Jun 17 08:28:26 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4EE40852E2C; Fri, 17 Jun 2022 08:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPXHb1XnGz4VJy; Fri, 17 Jun 2022 08:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655454507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsvSJ/+sktLoMYS5OAfWyYbC6IKAYjiX2b846VYgT94=; b=p7dfQog5tAAUVTPGjGxBq7DqAqMmtPGu9g2BS1McPW5edgaBVR8fdfGlbBbXmGMwhCPS5J qVKJFH5NVVkwHI9j72q7jhEZmrge1Fpz52jBLWFXFoVRemp8GKQ+Sxqu02/F8pXfdIlt3h w2ZXHuIGkGU4oFs4EpLNkC46Hmw4WAEQpBV3j9efBZpVGL9ykLT4/G4Alj6rAENi+cl4X6 kPcfSoXA+JfC14Ay61L8t9z38UCVuu8YzGY81dc6jKERUnhyYT8Q6lBLipc6c2MwiqG8hn rfEHHpOFijx0AKsbAgSFnNezsyp8FFLSD4fW8q1CYsNdPvzS8ii38Kns/vEdwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 118511C513; Fri, 17 Jun 2022 08:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25H8SQga005531; Fri, 17 Jun 2022 08:28:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25H8SQMt005530; Fri, 17 Jun 2022 08:28:26 GMT (envelope-from git) Date: Fri, 17 Jun 2022 08:28:26 GMT Message-Id: <202206170828.25H8SQMt005530@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Palle Girgensohn Subject: git: 329f3e8d8b54 - main - security/ossec-hids-*: fix broken config scripts List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: girgen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 329f3e8d8b5441522a078c74e594a14651a00075 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655454507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsvSJ/+sktLoMYS5OAfWyYbC6IKAYjiX2b846VYgT94=; b=EMcMH4KYEVWXrb5JHGWSsAvUH+4+G5RTMzCNb0gsfZOC1JVLTrl+sIAa5inyMebzJYBvzp WX28Kc11HwFRhypdVGLe50jDlqvZZoRTvlAR2qFhnxN3h3baPrHXZU44fwfnTUjljdL91t n9urhYmuulRiGvCK66HXvqotoqueZdbBzPPYIbZnt6JJpXxFkiV/KYNImjGYHiT8ftB3Ha cq3lOTrNqzk9F8kU8p8REn1un0gjlT571zLlTQVyLn4kR+SgLg4KxHJOjpk5uxcr2/t1xv mAqmSt/Uc2KrJ17BaUhd9d/zwdopIRjLjeVCUWv4vK24VNQVmMI6/QzuZCD5PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655454507; a=rsa-sha256; cv=none; b=OCW5N/ZMsCMuBozB7qVarLOKouPpzBFyFkpwRmkQKG8fXkruHWJxkI6urMAqFpDj7Pn+8/ 83EyvdBFGSzdMpgKj2UI2Kh5fpH33dXYENujtSPubIv11PGfNdfVOq4PZGwyiH6aGz0zEq PDsHSe9pybMLFklMSepci0uk1FLXZLgDkxJ9KHjHc99WZY1eYhdcm8k4CC609hI+gsY8hC 6v8+fIOSucLEYVOO53WRad9cG3hsLQ8RxEEUoDl1s0jR/xOetCEx8BQaP5Ayn/EYzlKSIi NuZpOQLZkxh61w1vjhINAVm2geKmPz83QmsZ4RH1InDjhgr8KgO9IOHcK7zA/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by girgen: URL: https://cgit.FreeBSD.org/ports/commit/?id=329f3e8d8b5441522a078c74e594a14651a00075 commit 329f3e8d8b5441522a078c74e594a14651a00075 Author: Palle Girgensohn AuthorDate: 2022-06-17 08:07:25 +0000 Commit: Palle Girgensohn CommitDate: 2022-06-17 08:28:22 +0000 security/ossec-hids-*: fix broken config scripts - No binary changes - Replaced all 'sed' invocations with 'sed -E' and adjusted regexes accordingly PR: 256545 Submitted by: Dominik Lisiak (maintainer) --- security/ossec-hids-local-config/Makefile | 1 + security/ossec-hids-local-config/files/agent-conf.in | 4 ++-- security/ossec-hids-local-config/files/ossec-conf.in | 6 +++--- security/ossec-hids-local-config/scripts/plist.sh | 4 ++-- security/ossec-hids-local-config/scripts/template-to-agent.sh | 5 +++-- security/ossec-hids-local-config/scripts/template-to-ossec.sh | 8 +++++--- security/ossec-hids-local/files/ossec-hids.in | 2 +- security/ossec-hids-local/scripts/plist.sh | 4 ++-- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/security/ossec-hids-local-config/Makefile b/security/ossec-hids-local-config/Makefile index c021e6464248..fa4509d26524 100644 --- a/security/ossec-hids-local-config/Makefile +++ b/security/ossec-hids-local-config/Makefile @@ -1,3 +1,4 @@ +PORTREVISION?= 2 PKGNAMESUFFIX?= -${OSSEC_TYPE}-config COMMENT?= Configuration manager for ossec-hids-${OSSEC_TYPE} OSSEC_TYPE?= local diff --git a/security/ossec-hids-local-config/files/agent-conf.in b/security/ossec-hids-local-config/files/agent-conf.in index 673d0f668631..a1da79d894b5 100644 --- a/security/ossec-hids-local-config/files/agent-conf.in +++ b/security/ossec-hids-local-config/files/agent-conf.in @@ -8,7 +8,7 @@ agent_conf_files="${agent_conf_dir}/*.conf" select_elements() { local element="$1" - sed -n "/<${element}.*>/,/<\/${element}>/p" + sed -En "/<${element}.*>/,/<\/${element}>/p" } remove_comments() { @@ -17,7 +17,7 @@ remove_comments() { } remove_empty_lines() { - sed '/^\s*$/d' + sed -E '/^[[:space:]]*$/d' } agent_conf() { diff --git a/security/ossec-hids-local-config/files/ossec-conf.in b/security/ossec-hids-local-config/files/ossec-conf.in index d28d238bc212..1afdb5466774 100644 --- a/security/ossec-hids-local-config/files/ossec-conf.in +++ b/security/ossec-hids-local-config/files/ossec-conf.in @@ -8,12 +8,12 @@ ossec_conf_files="${ossec_conf_dir}/*.conf" select_elements_content() { local element="$1" - sed -n "/<${element}>/,/<\/${element}>/{ /<${element}>/d; /<\/${element}>/d; p; }" + sed -En "/<${element}>/,/<\/${element}>/{ /<${element}>/d; /<\/${element}>/d; p; }" } remove_elements() { local element="$1" - sed -e "/<${element}>/,/<\/${element}>/d" + sed -E "/<${element}>/,/<\/${element}>/d" } remove_comments() { @@ -22,7 +22,7 @@ remove_comments() { } remove_empty_lines() { - sed '/^\s*$/d' + sed -E '/^[[:space:]]*$/d' } ossec_conf() { diff --git a/security/ossec-hids-local-config/scripts/plist.sh b/security/ossec-hids-local-config/scripts/plist.sh index b1915c47ce7b..07fbcd5d4097 100644 --- a/security/ossec-hids-local-config/scripts/plist.sh +++ b/security/ossec-hids-local-config/scripts/plist.sh @@ -61,10 +61,10 @@ while read line; do path="" case ${line} in "@dir %%OSSEC_HOME%%"*) - path=`echo "${line}" | sed -e "s|@dir %%OSSEC_HOME%%||g"` + path=`echo "${line}" | sed -E 's|@dir %%OSSEC_HOME%%||g'` ;; "%%OSSEC_HOME%%"*) - path=`echo "${line}" | sed -e "s|%%OSSEC_HOME%%||g"` + path=`echo "${line}" | sed -E 's|%%OSSEC_HOME%%||g'` ;; "%%"*) unchanged_lines="${unchanged_lines}${NL}${line}" diff --git a/security/ossec-hids-local-config/scripts/template-to-agent.sh b/security/ossec-hids-local-config/scripts/template-to-agent.sh index 3034b1fe1254..7c11b820f646 100644 --- a/security/ossec-hids-local-config/scripts/template-to-agent.sh +++ b/security/ossec-hids-local-config/scripts/template-to-agent.sh @@ -19,7 +19,8 @@ ossec_syscheck_bin_dirs="${ossec_prefix}/bin,${ossec_prefix}/active-response" ossec_syscheck_etc_dirs="${ossec_prefix}/etc" replace() { - sed -e 's|||' \ + sed -E \ + -e 's|||' \ -e 's|||' \ -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \ -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \ @@ -27,7 +28,7 @@ replace() { } extract() { - sed -n '/^$/,/^<\/agent_config>$/p' + sed -En '/^$/,/^<\/agent_config>$/p' } replace | extract diff --git a/security/ossec-hids-local-config/scripts/template-to-ossec.sh b/security/ossec-hids-local-config/scripts/template-to-ossec.sh index 39334462a987..5ad322893370 100644 --- a/security/ossec-hids-local-config/scripts/template-to-ossec.sh +++ b/security/ossec-hids-local-config/scripts/template-to-ossec.sh @@ -24,13 +24,15 @@ fi replace() { if grep -q "" "${ossec_file}"; then - sed -e 's|||' \ + sed -E \ + -e 's|||' \ -e 's|||' \ -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \ -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \ "${ossec_file}" else - sed -e 's|||' \ + sed -E \ + -e 's|||' \ -e 's|||' \ -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \ -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \ @@ -39,7 +41,7 @@ replace() { } extract() { - sed -n '/^$/,/^<\/ossec_config>$/p' + sed -En '/^$/,/^<\/ossec_config>$/p' } replace | extract diff --git a/security/ossec-hids-local/files/ossec-hids.in b/security/ossec-hids-local/files/ossec-hids.in index 6c580f268b37..87783766b839 100644 --- a/security/ossec-hids-local/files/ossec-hids.in +++ b/security/ossec-hids-local/files/ossec-hids.in @@ -486,7 +486,7 @@ ossec_hids_fetch_config() { echo "${ossec_rc_path} reset_counter" echo "${ossec_rc_path} fetch_config" echo - echo "If this does't help, you need to reset counter on the server." + echo "If this doesn't help, you need to reset counter on the server." echo "If the server runs FreeBSD port of OSSEC, run:" echo "On the agent:" echo "${ossec_rc_path} reset_counter" diff --git a/security/ossec-hids-local/scripts/plist.sh b/security/ossec-hids-local/scripts/plist.sh index b1915c47ce7b..07fbcd5d4097 100644 --- a/security/ossec-hids-local/scripts/plist.sh +++ b/security/ossec-hids-local/scripts/plist.sh @@ -61,10 +61,10 @@ while read line; do path="" case ${line} in "@dir %%OSSEC_HOME%%"*) - path=`echo "${line}" | sed -e "s|@dir %%OSSEC_HOME%%||g"` + path=`echo "${line}" | sed -E 's|@dir %%OSSEC_HOME%%||g'` ;; "%%OSSEC_HOME%%"*) - path=`echo "${line}" | sed -e "s|%%OSSEC_HOME%%||g"` + path=`echo "${line}" | sed -E 's|%%OSSEC_HOME%%||g'` ;; "%%"*) unchanged_lines="${unchanged_lines}${NL}${line}"