diff options
author | 2016-08-31 12:10:12 +0100 | |
---|---|---|
committer | 2016-08-31 18:11:47 +0530 | |
commit | 264c26b57daa1891f9cd9cebc71c727b47515234 (patch) | |
tree | 9028f574265bc06ebed9a994400a543f0573124c | |
parent | suppress warnings when trying to clean repo hook (diff) | |
download | gitolite-gentoo-264c26b57daa1891f9cd9cebc71c727b47515234.tar.gz gitolite-gentoo-264c26b57daa1891f9cd9cebc71c727b47515234.tar.bz2 gitolite-gentoo-264c26b57daa1891f9cd9cebc71c727b47515234.zip |
ssh-authkeys-split: do not zap keys without trailing newlines
The normal ssh-authkeys script handles key files without trailing newlines
OK. However ssh-authkeys-split does not, because it tries to treat a
zero-newline file as a multi-line file, and the shell `read` builtin will
not read a line that ends with eof rather than a newline. So it ends up
discarding zero-newline keys.
-rwxr-xr-x | src/triggers/post-compile/ssh-authkeys-split | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/triggers/post-compile/ssh-authkeys-split b/src/triggers/post-compile/ssh-authkeys-split index 5513e44..09ca075 100755 --- a/src/triggers/post-compile/ssh-authkeys-split +++ b/src/triggers/post-compile/ssh-authkeys-split @@ -46,7 +46,9 @@ find . -type f -name "*.pub" | while read k do # do we need to split? lines=`wc -l < $k` - [ "$lines" = "1" ] && continue + case $lines in + (0|1) continue + esac # is it sane to split? base=`basename $k .pub` |