Bug #3411

install.rb should not put "." first in the tmp_dirs

Added by Martin Englund almost 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:03/23/2010
Priority:Normal Due date:
Assignee:Martin Englund % Done:

0%

Category:binary
Target version:1.5.8
Keywords: Affected Facter version:
Branch:http://github.com/pmenglund/facter/tree/tickets/1.5.x/3411
Votes: 1

Description

Since Ruby incorrectly assumes that being root is enough to be able to write a directory, install.rb will fail when installing as root from a NFS mounted directory, as it will pick the current directory (“.”) as tmp_dir.


Related issues

related to Puppet - Bug #3412: install.rb should not put "." first in the tmp_dirs Closed 03/23/2010

History

Updated by Jos Backus almost 2 years ago

How about the following patch? If the user set TMP or TEMP, why not assume they meant for us to use them? That way the issue mentioned can be solved simply by setting one of these environment variables appropriately.

         opts.parse!
     end

-    tmpdirs = [".", ENV['TMP'], ENV['TEMP'], "/tmp", "/var/tmp"]
+    tmpdirs = [ENV['TMP'], ENVcommit:'TEMP'], ".", "/tmp", "/var/tmp"

     version = [Config::CONFIG["MAJOR"], Config::CONFIG["MINOR"]].join(".")
     libdir = File.join(Config::CONFIG["libdir"], "ruby", version)

Updated by Martin Englund almost 2 years ago

  • Status changed from Investigating to In Topic Branch Pending Review
  • Branch set to http://github.com/pmenglund/facter/tree/tickets/1.5.x/3411

That is similar to the fix I suggested for puppet in issue #3412 – I think it is better to resort to the current directory last.

Updated by Jos Backus almost 2 years ago

That would work, too.

Updated by James Turnbull almost 2 years ago

  • Category set to binary
  • Target version set to 1.5.8

Updated by James Turnbull almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Pushed in commit:b5a8de0e8f4583c27d776cabe7686f41edb552fb in branch master.

Also available in: Atom PDF