Changeset 14145 in hybrid for branches/releng-11/nanobsd


Ignore:
Timestamp:
Apr 25, 2018, 10:34:21 PM (7 years ago)
Author:
rick
Message:

Fix creation of duplicated nameserver entries

regex will matches multiple addresses since closing bound was not enforced,
e.g NAMESERVER=172.31.254.1 would also be matched at 172.31.254.10

This bug never surfaced, since all DNS IP addresses used to be fairly
unique/random.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/releng-11/nanobsd/files/tools/nameserver-shuffle

    r13924 r14145  
    5555    ML=`awk '/^nameserver/ {l=length($4);if (l>ml){ml=l}}END{print ml}' $DYNLIST`
    5656    # awk magic allows adding or updating of status of nameserver
    57     awk '/^nameserver[[:blank:]]+'"$NAMESERVER"'[[:blank:]]*/ {printf "nameserver %-16s # %-'$ML's (%s)\n", $2, $4,"'"$STATUS"'"}' $DYNLIST >> $NEWRESOLV || exit 1
     57    awk '/^nameserver[[:blank:]]+'"$NAMESERVER"'[[:blank:]]+/ {printf "nameserver %-16s # %-'$ML's (%s)\n", $2, $4,"'"$STATUS"'"}' $DYNLIST >> $NEWRESOLV || exit 1
    5858  done
    5959  $verbose && echo "################################"
Note: See TracChangeset for help on using the changeset viewer.