Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[patch] ssh -i: don't complete group/world readable files
- X-seq: zsh-workers 36869
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [patch] ssh -i: don't complete group/world readable files
- Date: Thu, 15 Oct 2015 18:40:19 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=uhtEXFmovRk8o0I/kdtXYemmdOzskU/ylJ8emYPCotg=; b=cNJ2xzcaKzHxu5FFJN4h3zHdCg2NNavjXcsGee1MylcwfPqeIGSS30yP1XrL50mByv pinjDZsm0qmQcnpGhkQEhTfG432l2yMREV2s5ccBrWg/cTuLetUQQ+gncGjrwqgBok5U n9n9PCp/jEjCJu1D9RbcG+iXVZCr37PpHlu5lpxSUb10Q22wnEXuQisYpbZo6sL2NC06 9hSd9mq1wmoI0HTwj6uuogrG+/7mTWqv/p9dyWWTWYmtVb1Hn7IRP+0FnFVh5hRWke+I wjYQKR3WWQic1GmpToHyKxsdNUDu4svkbo1UmKTBAnHo4ZFWyurMkZSuZnxwZIuyAPea Vz6A==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
SSH requires identity files to be readable only by the owner. We can use
this to not complete files that can't be keys. This will normally ignore
*.pub files as by default they're 0644.
- Matthew MArtin
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index a66702a..24706f9 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -18,7 +18,7 @@ _ssh () {
# for protocol version 2, this can be a comma-separated list
'-c+[select encryption cipher]:encryption cipher:(idea des 3des blowfish arcfour tss none)'
'-F+[specify alternate config file]:config file:_files'
- '*-i+[select identity file]:SSH identity file:_files'
+ '*-i+[select identity file]:SSH identity file:_files -g "*(^AR)"'
'*-o+[specify extra options]:option string:->option'
)
common_transfer=(
Messages sorted by:
Reverse Date,
Date,
Thread,
Author