File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1905,7 +1905,7 @@ _included_ssh_config_files()
1905
1905
_comp_expand_glob files ' $i'
1906
1906
if (( ${# files[@]} )) ; then
1907
1907
for f in " ${files[@]} " ; do
1908
- if [[ -r $f ]]; then
1908
+ if [[ -r $f && ! -d $f ]]; then
1909
1909
config+=(" $f " )
1910
1910
# The Included file is processed to look for Included files in itself
1911
1911
_included_ssh_config_files $f
@@ -1973,10 +1973,10 @@ _known_hosts_real()
1973
1973
1974
1974
# ssh config files
1975
1975
if [[ -v configfile ]]; then
1976
- [[ -r $configfile ]] && config+=(" $configfile " )
1976
+ [[ -r $configfile && ! -d $configfile ]] && config+=(" $configfile " )
1977
1977
else
1978
1978
for i in /etc/ssh/ssh_config ~ /.ssh/config ~ /.ssh2/config; do
1979
- [[ -r $i ]] && config+=(" $i " )
1979
+ [[ -r $i && ! -d $i ]] && config+=(" $i " )
1980
1980
done
1981
1981
fi
1982
1982
@@ -2023,7 +2023,7 @@ _known_hosts_real()
2023
2023
for i in /etc/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts2 \
2024
2024
/etc/known_hosts /etc/known_hosts2 ~ /.ssh/known_hosts \
2025
2025
~ /.ssh/known_hosts2; do
2026
- [[ -r $i ]] && kh+=(" $i " )
2026
+ [[ -r $i && ! -r $i ]] && kh+=(" $i " )
2027
2027
done
2028
2028
for i in /etc/ssh2/knownhosts ~ /.ssh2/hostkeys; do
2029
2029
[[ -d $i ]] && khd+=(" $i " /* pub)
You can’t perform that action at this time.
0 commit comments