instance method
Gem::ConfigFile#check_credentials_permissions
check_credentials_permissions
lib/rubygems/config_file.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/config_file.rb, line 261
def check_credentials_permissions
return if Gem.win_platform? # windows doesn't write 0600 as 0600
return unless File.exist? credentials_path
existing_permissions = File.stat(credentials_path).mode & 0o777
return if existing_permissions == 0o600
alert_error <<-ERROR
Your gem push credentials file located at:
\t#{credentials_path}
has file permissions of 0#{existing_permissions.to_s 8} but 0600 is required.
To fix this error run:
\tchmod 0600 #{credentials_path}
You should reset your credentials at:
\thttps://rubygems.org/profile/edit
if you believe they were disclosed to a third party.
ERROR
terminate_interaction 1
end
Checks the permissions of the credentials file. If they are not 0600 an error message is displayed and RubyGems aborts.
See also
#backtrace
#config_file_name
#api_keys
#credentials_path
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0