lib/rubygems/security/trust_dir.rb in rubygems-update-3.4.20 vs lib/rubygems/security/trust_dir.rb in rubygems-update-3.4.21
- old
+ new
@@ -7,12 +7,12 @@
class Gem::Security::TrustDir
##
# Default permissions for the trust directory and its contents
DEFAULT_PERMISSIONS = {
- :trust_dir => 0700,
- :trusted_cert => 0600,
+ :trust_dir => 0o700,
+ :trusted_cert => 0o600,
}.freeze
##
# The directory where trusted certificates will be stored.
@@ -89,11 +89,11 @@
def trust_cert(certificate)
verify
destination = cert_path certificate
- File.open destination, "wb", 0600 do |io|
+ File.open destination, "wb", 0o600 do |io|
io.write certificate.to_pem
io.chmod(@permissions[:trusted_cert])
end
end
@@ -107,10 +107,10 @@
if File.exist? @dir
raise Gem::Security::Exception,
"trust directory #{@dir} is not a directory" unless
File.directory? @dir
- FileUtils.chmod 0700, @dir
+ FileUtils.chmod 0o700, @dir
else
FileUtils.mkdir_p @dir, :mode => @permissions[:trust_dir]
end
end
end