then
if echo ${opt_source} | grep -q -e "^/" -e "^\(.*/\)\?\.\.\?\(/.*\)\?$" && [ "${source}" != "." ]
then
- log_warning_msg "Skipping unsafe custom mount with option source=${opt_source}: must be either \".\" (the media root) a relative path w.r.t. the media root that doesn't contain comas or the special dirs \".\" and \"..\""
+ log_warning_msg "Skipping unsafe custom mount with option source=${opt_source}: must be either \".\" (the media root) or a relative path w.r.t. the media root that contains neither comas, nor the special \".\" and \"..\" path components"
continue
else
source="${opt_source}"
then
# unions and don't need to be bootstrapped
# linkfiles dirs can't be bootstrapped in a sensible way
- mkdir "${source}"
+ mkdir -p "${source}"
chown --reference "${dest}" "${source}"
chmod --reference "${dest}" "${source}"
else
else
cow_dir="/live/cow/${dest}"
fi
+ if [ -e "${cow_dir}" ]
+ then
+ # If an earlier custom mount has files here
+ # it will "block" the current mount's files
+ # which is undesirable
+ rm -rf "${cow_dir}"
+ fi
mkdir -p ${cow_dir}
chown --reference "${source}" "${cow_dir}"
chmod --reference "${source}" "${cow_dir}"