[personal profile] archerships


While executing a Ruby script, I'm getting this message:

/usr/local/releasecontrol/lib/releasecontrol.rb:287: warning: Insecure world writable dir /private/tmp, mode 041777


Line 287 is this:

system("#{cmd_template.gsub('__ACTION__','build').gsub('__TARGET__','@mbuild/unit_tests')}")

From what I understand, the warning message results when system is passed an executable whose path contains a world writable directory. /tmp is world-writable (any user can write to it). However, the /tmp directory usually also has the "sticky" bit set: permission 01777. That's not normally considered to be an insecure permission setting--when the sticky bit is set on a directory, files inside the directory may be renamed or removed only by the owner of the file, the owner of the directory, or the superuser.

I've confirmed that the sticky bit is set on the /tmp directory:

ls -ld /tmp/
drwxrwxrwt 13 root wheel 442 Mar 21 21:09 /tmp/

(that's what the "t" at the end means).

I've also learned that you can disable the warning message if you start your ruby script with this line:

#! /usr/bin/ruby -W0

The -W level flag sets the warning level: 0=silence, 1=medium, 2=verbose (default).

Thus, "-W0" turns off warnings altogether.

However, I don't want to disable warnings altogether, and I don't want to muck about with the /tmp permissions. Anyone know of a better way to get rid of the error message?
From: (Anonymous)
The file "file.c" in the Ruby source contains the method that issues this warning.
With little caution, you could easily delete the warning message in "file.c" source code.

Regards,
Rohit