Revert CIFS path validation to IP-only per maintainer request

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-22 16:58:07 +00:00
parent 367410d2b7
commit 89b4cdebef

View File

@@ -237,7 +237,7 @@ if bashio::config.has_value 'networkdisks'; then
fi
if [[ "$FSTYPE" == "cifs" ]]; then
server="$(echo "$disk" | sed -E 's|^//([^/]+)/.*|\1|')"
server="$(echo "$disk" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" | head -n 1)"
else
server="${disk%%:*}"
fi
@@ -264,8 +264,8 @@ if bashio::config.has_value 'networkdisks'; then
echo "... mounting ($FSTYPE) $disk"
if [[ "$FSTYPE" == "cifs" ]]; then
if [[ ! "$disk" =~ ^//[^/]+/.+ ]]; then
bashio::log.fatal "...... invalid CIFS path \"$disk\". Use //server/sharedfolder or //123.12.12.12/sharedfolder"
if [[ ! "$disk" =~ ^//[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/.+ ]]; then
bashio::log.fatal "...... invalid CIFS path \"$disk\". Use //123.12.12.12/sharedfolder,//123.12.12.12/sharedfolder2"
echo "Invalid CIFS path structure: $disk" >"$ERRORCODE_FILE" || true
continue
fi