summarylogtreecommitdiffstats
path: root/10-chrony
diff options
context:
space:
mode:
authorTroy Engel2014-08-11 21:30:00 +0000
committerFrederik “Freso” S. Olesen2015-07-12 15:26:45 +0200
commitbf41f33060b33200aa74ea2247f1c2423a6c9ed9 (patch)
treece4cadd987bd59b0e22e853a371c54f34bfb77a0 /10-chrony
parentd00e93d9fbae40b7e25fea9f2e1b550517d3bf12 (diff)
downloadaur-bf41f33060b33200aa74ea2247f1c2423a6c9ed9.tar.gz
networkmanager-dispatcher-chrony: Fix $PASSWORD.
> This script doesn't work with the default configuration of chrony.conf > and chrony.keys; they set the keyword 'generatecommandkey' which > writes the key in MD5 format (other Googling shows SHA is also > possible): > > 1 MD5 HEX:AABBCCDDEEFF > > This is documented here: > > http://chrony.tuxfamily.org/manual.html#commandkey-directive > > The issue is the sed line for PASSWORD doesn't strip out the method, > so tries to pass "MD5 HEX:..." over to chronyc. Here's a sed that > works for both what's in the wiki ('1 xyzzy') and the autogenerated > keys ('1 MD5 HEX:...'): > > -PASSWORD=`grep ^$COMMANDKEY $KEYFILE | sed 's/[^ ]* //' -` > +PASSWORD=`grep ^$COMMANDKEY $KEYFILE | sed 's/.*[^ ] //' -` > > That will extract the other direction - find the last space and grab > what follows it, rather than finding the first space etc. It also > looks like we could just avoid this altogether and use "chronyc -a" to > automatically do the needful.
Diffstat (limited to '10-chrony')
-rw-r--r--10-chrony2
1 files changed, 1 insertions, 1 deletions
diff --git a/10-chrony b/10-chrony
index 581a575c611f..626ef9a48c30 100644
--- a/10-chrony
+++ b/10-chrony
@@ -8,7 +8,7 @@ CHRONY=/usr/bin/chronyc
CONFIG=/etc/chrony.conf
KEYFILE=`grep ^keyfile $CONFIG | sed 's/[^ ]* //' -`
COMMANDKEY=`grep ^commandkey $CONFIG | sed 's/[^ ]* //' -`
-PASSWORD=`grep ^$COMMANDKEY $KEYFILE | sed 's/[^ ]* //' -`
+PASSWORD=`grep ^$COMMANDKEY $KEYFILE | sed 's/.*[^ ] //' -`
chrony_cmd() {
echo Chrony going $1.