Skip to content

Commit

Permalink
Merge pull request #389 from imobach/fix-982522
Browse files Browse the repository at this point in the history
SshConfig will only consider regular files
  • Loading branch information
imobachgs committed Jun 1, 2016
2 parents 75415e6 + 12d3566 commit eab8049
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 1 11:41:27 UTC 2016 - igonzalezsosa@suse.com

- When importing SSH keys/configuration, only regular files
will be considered (bsc#982522).

-------------------------------------------------------------------
Mon May 30 14:35:05 UTC 2016 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion src/lib/installation/ssh_config.rb
Expand Up @@ -110,7 +110,7 @@ def initialize(system_name)
#
# @param dir [String] path of the SSH configuration directory
def read_files(dir)
filenames = Dir.glob("#{dir}/*")
filenames = Dir.glob("#{dir}/*").select { |f| File.file?(f) }

# Let's process keys first, pairs of files like "xyz" & "xyz.pub"
pub_key_filenames = filenames.select { |f| f.end_with?(SshKey::PUBLIC_FILE_SUFFIX) }
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/root1/etc/ssh/backup/README
@@ -0,0 +1 @@
Unexpected directory to check bsc#982522.
2 changes: 2 additions & 0 deletions test/ssh_config_test.rb
Expand Up @@ -108,6 +108,8 @@ def permissions(file)
Dir.glob("#{dir}/root1/etc/ssh/*").each do |file|
if file.end_with?("_key") || file.end_with?("sshd_config") || file.end_with?("moduli")
File.chmod(0600, file)
elsif File.directory?(file)
File.chmod(0755)
else
File.chmod(0644, file)
end
Expand Down

0 comments on commit eab8049

Please sign in to comment.