diff options
author | dteske <dteske@FreeBSD.org> | 2013-06-18 02:37:15 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-06-18 02:37:15 +0000 |
commit | 59d4cd396536c7c66a68c62cdeab33c771138b11 (patch) | |
tree | 5f652602262926c379422904ced432b42cc6b5b8 /etc | |
parent | 001cab5cd9d3dde419f4ffca5ce3daf424d60143 (diff) | |
download | FreeBSD-src-59d4cd396536c7c66a68c62cdeab33c771138b11.zip FreeBSD-src-59d4cd396536c7c66a68c62cdeab33c771138b11.tar.gz |
Allow $ntpdate_config to be NULL. Due to a lack of surrounding quotes, when
ntpdate_config was set to NULL the conditional would (counter to prevailing
logic) succeed -- leading to awk attempting to redirect from a NULL pathname
standard-in. While we're here, make the script consistant with itself by
removing the {curlies} around ntpdate_config (they are unnecessary).
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.d/ntpdate | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/rc.d/ntpdate b/etc/rc.d/ntpdate index 4a8b845..235e6c0 100755 --- a/etc/rc.d/ntpdate +++ b/etc/rc.d/ntpdate @@ -16,13 +16,13 @@ start_cmd="ntpdate_start" ntpdate_start() { - if [ -z "$ntpdate_hosts" -a -f ${ntpdate_config} ]; then + if [ -z "$ntpdate_hosts" -a -f "$ntpdate_config" ]; then ntpdate_hosts=`awk ' /^server[ \t]*127.127/ {next} /^(server|peer)/ { if ($2 ~/^-/) {print $3} else {print $2}} - ' < ${ntpdate_config}` + ' < "$ntpdate_config"` fi if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then echo "Setting date via ntp." |