Re: [BLFS Trac] #23276: ruby installs files owned by root in user dir
| Newsgroups | gmane.linux.lfs.beyond.book |
|---|---|
| Message-ID | <[email protected]> |
#23276: ruby installs files owned by root in user dir
--------------------+------------------------
Reporter: pierre | Owner: blfs-book
Type: defect | Status: new
Priority: normal | Milestone: 13.1
Component: BOOK | Version: git
Severity: normal | Resolution:
Keywords: |
--------------------+------------------------
Comment (by pierre):
I think we should recommend to use `sudo -E -H` instead of just `sudo -E`
in the note for sudo configuration. But we might be concerned about
creating files in /root directory...
The code creating this directory seems to be in
.bundle/gems/rdoc-7.0.3/lib/rdoc.rb:
{{{
[...]
##
# Searches and returns the directory for settings.
#
# 1. <tt>$HOME/.rdoc</tt> directory, if it exists.
# 2. The +rdoc+ directory under the path specified by the
# +XDG_DATA_HOME+ environment variable, if it is set.
# 3. <tt>$HOME/.local/share/rdoc</tt> directory.
#
# Other than the home directory, the containing directory will be
# created automatically.
def self.home
rdoc_dir = begin
File.expand_path('~/.rdoc')
rescue ArgumentError
end
if File.directory?(rdoc_dir)
rdoc_dir
else
require 'fileutils'
begin
# XDG
xdg_data_home = ENV["XDG_DATA_HOME"] ||
File.join(File.expand_path("~"), '.local', 'share')
unless File.exist?(xdg_data_home)
FileUtils.mkdir_p xdg_data_home
end
File.join xdg_data_home, "rdoc"
rescue Errno::EACCES
end
end
end
[...]
}}}
(I'm not a ruby expert but the code seems to create ~/.local/share if it
does not exist)
We may want to use:
{{{
XDG_DATA_HOME=/tmp make install
}}}
(with a command explanation of course)
--
Ticket URL: <https://wiki.linuxfromscratch.org/blfs/ticket/23276#comment:3>
BLFS Trac <https://wiki.linuxfromscratch.org/blfs/>
Beyond Linux From Scratch
--
http://lists.linuxfromscratch.org/sympa/info/blfs-book
Unsubscribe: See the above information page