From 816f24331af490eb5be856abbb6b3ace4e9e1159 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 11 Jan 2025 17:20:10 -0700 Subject: [PATCH] cp: trim double // to / --- usr/local/share/bastille/cp.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 0dd0b0b0..a1dc0c15 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -89,8 +89,9 @@ set_target "${TARGET}" for _jail in ${JAILS}; do info "[${_jail}]:" - bastille_jail_path="${bastille_jailsdir}/${_jail}/root" - if ! cp "${OPTION}" "${CPSOURCE}" "${bastille_jail_path}${CPDEST}"; then - error_continue "CP failed: ${CPSOURCE} -> ${bastille_jail_path}${CPDEST}" + host_path="${CPSOURCE}" + jail_path="$(echo ${bastille_jailsdir}/${_jail}/root/${CPDEST} | sed 's#//#/#g')" + if ! cp "${OPTION}" "${host_path}" "${jail_path}"; then + error_continue "CP failed: ${host_path} -> ${jail_path}" fi done