mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-27 01:36:03 +02:00
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:
@@ -237,7 +237,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$FSTYPE" == "cifs" ]]; then
|
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
|
else
|
||||||
server="${disk%%:*}"
|
server="${disk%%:*}"
|
||||||
fi
|
fi
|
||||||
@@ -264,8 +264,8 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
echo "... mounting ($FSTYPE) $disk"
|
echo "... mounting ($FSTYPE) $disk"
|
||||||
|
|
||||||
if [[ "$FSTYPE" == "cifs" ]]; then
|
if [[ "$FSTYPE" == "cifs" ]]; then
|
||||||
if [[ ! "$disk" =~ ^//[^/]+/.+ ]]; then
|
if [[ ! "$disk" =~ ^//[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/.+ ]]; then
|
||||||
bashio::log.fatal "...... invalid CIFS path \"$disk\". Use //server/sharedfolder or //123.12.12.12/sharedfolder"
|
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
|
echo "Invalid CIFS path structure: $disk" >"$ERRORCODE_FILE" || true
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user