Description
Two different versions of the sort tool apparently do not behave the same, and this is problematic on how dehydrated handle certificates with wildcard ("star") domain aliases. For instance when you have such following line in the domains.txt file:
domain.com *.domain.com > domain.com
the normalize_san_list() function (and the inlined code before it existed) thinks the certificate needs to be renewed b/c the SAN list appear to have changed:
Processing domain.com with alternative names: *.domain.com
+ Checking domain name(s) of existing cert... changed!
+ Domain name(s) are not matching!
+ Names in old certificate: *.domain.com
+ Configured names: domain.com
+ Forcing renew.
Problem
With coreutils sort:
$ (echo 'domain.com'; echo '*.domain.com'; echo 'domain.com') | sort -u
*.domain.com
domain.com
With uutils sort:
$ (echo 'domain.com'; echo '*.domain.com'; echo 'domain.com') | sort -u
domain.com <--- the additional wildcard domain is silently discarded
Solution
Add -i (and optionnally -s) option(s) to the existsing -u option.
With coreutils sort:
$ (echo 'domain.com'; echo '*.domain.com'; echo 'domain.com') | sort -uis
*.domain.com
domain.com
With uutils sort:
$ (echo 'domain.com'; echo '*.domain.com'; echo 'domain.com') | sort -uis
*.domain.com
domain.com
Description
Two different versions of the sort tool apparently do not behave the same, and this is problematic on how dehydrated handle certificates with wildcard ("star") domain aliases. For instance when you have such following line in the domains.txt file:
the normalize_san_list() function (and the inlined code before it existed) thinks the certificate needs to be renewed b/c the SAN list appear to have changed:
Problem
With coreutils sort:
With uutils sort:
Solution
Add
-i(and optionnally-s) option(s) to the existsing-uoption.With coreutils sort:
With uutils sort: