net-misc/openssh: fix duplicate slash

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This commit is contained in:
Mathieu Tortuyaux 2023-11-30 11:29:09 +01:00
parent 29c322791c
commit c927a7aeef
No known key found for this signature in database
GPG Key ID: AC5CCFB52545D9B8

View File

@ -232,6 +232,10 @@ insert_include() {
local src_config="${1}" options="${2}" includedir="${3}"
local name copy regexp_options regexp lineno comment_options
if [[ ! "${includedir}" =~ ^/.* ]]; then
die "includir must be an absolute path (i.e, starting with /). Got: ${includedir}"
fi
name=${src_config##*/}
copy="${T}/${name}"
cp -a "${src_config}" "${copy}" || die
@ -251,7 +255,7 @@ insert_include() {
head -n "${lineno}" "${copy}" || die
cat <<-EOF || die
# Make sure that all ${comment_options} options are below this Include!
Include "${EPREFIX}/${includedir}/*.conf"
Include "${EPREFIX}${includedir}/*.conf"
EOF
tail -n "+${lineno}" "${copy}" || die