summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony Finch <dot@dotat.at>2016-08-31 12:10:12 +0100
committerSitaram Chamarty <sitaram@atc.tcs.com>2016-08-31 18:11:47 +0530
commit264c26b57daa1891f9cd9cebc71c727b47515234 (patch)
tree9028f574265bc06ebed9a994400a543f0573124c /src
parent490b54023ae16c46496977649c9de821898974e0 (diff)
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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/triggers/post-compile/ssh-authkeys-split4
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`