diff options
author | Patrick J. Volkerding <volkerdi@slackware.com> | 2021-04-03 00:35:35 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackware.com> | 2021-11-12 01:09:34 -0600 |
commit | e035b1689c3496d29274951b2b92e39fee3a9bf4 (patch) | |
tree | 7b5690d35ef87ded8e2e716e79c06f70858b796a | |
parent | e3cb064e1b353070e0625519e85e3531625c73d4 (diff) | |
download | slacknetsetup-e035b1689c3496d29274951b2b92e39fee3a9bf4.tar.xz |
netconfig: remove (broken) checks on hostname/domainname validity
-rw-r--r-- | netconfig | 30 |
1 files changed, 4 insertions, 26 deletions
@@ -461,17 +461,8 @@ EOF fi HOSTNM="`cat $TMP/SeThost`" rm -f $TMP/SeThost $TMP/tempmsg - if [ "$HOSTNM" = "" ] || [[ ! "$HOSTNM" =~ ^[[:alnum:]-]+$ ]] || \ - [ "${HOSTNM:0:1}" == "-" ] || [ "${HOSTNM: -1:1}" == "-" ]; then - dialog --title "HOSTNAME" --ok-button "Back" --msgbox \ - "That doesn't appear to be a valid hostname.\n -Hostnames can only contain letters, numbers and hyphens, -and may not begin or end with a hyphen." 7 60 - if [ $? = 1 -o $? = 255 ]; then - exit - fi - else - break + if [ ! "$HOSTNM" = "" ]; then + break; fi done @@ -491,21 +482,8 @@ EOF fi DOMAIN="`cat $TMP/SeTdom`" rm -f $TMP/SeTdom $TMP/tempmsg - # These regexes doon't catch everything, just basic syntax mistakes. - DN="${DOMAIN%.*}" - TLD="${DOMAIN##*.}" - if [ -z "$DOMAIN" ] || [ -z "$TLD" ] || [ -z "$DN" ] || [[ ! "$DOMAIN" =~ ^[^.-][[:alnum:].-]+[^.-]$ ]] || \ - [[ ! "$DN" =~ ^[^.-][[:alnum:].-]+[^.-]$ ]] || [[ "$DN" =~ \.\. ]] || [[ "$DN" =~ -- ]] || \ - [[ ! "$TLD" =~ ^[^-][[:alnum:]-]+[^-]$ ]]; then - dialog --title "DOMAINNAME" --ok-button "Back" --msgbox \ - "That doesn't appear to be a valid domain name.\n -Domain names can only contain letters and numbers, hyphens -and dots, and may not begin or end with a hyphen or dot." 7 68 - if [ $? = 1 -o $? = 255 ]; then - exit - fi - else - break + if [ ! "$DOMAIN" = "" ]; then + break; fi done |