Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/symmetric_encryption/keystore/file.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'etc'

module SymmetricEncryption
module Keystore
class File
Expand Down Expand Up @@ -85,7 +87,11 @@ def correct_permissions?
end

def owned?
stat.owned?
stat.owned? || custom_owned?
end

def custom_owned?
ENV['SYMMETRIC_ENCRYPTION_ALLOWED_FILE_OWNER_USERNAME'] == Etc.getlogin
end

def stat
Expand Down