Anybody know what’s up with this? Also, is this totally unsafe? I
don’t know how safe a program rake is (e.g., can one set env vars to
get it to do arbitrary actions?). Not actually putting this into
deployment on anything but my own box, but would just be good for me
to know, and I’m mostly curious about my original question. Thanks in
advance for any answers.
$ ./update-redmine
/usr/lib/ruby/1.8/rake.rb:2364:in `chdir’
Anybody know what’s up with this? Also, is this totally unsafe? I
don’t know how safe a program rake is (e.g., can one set env vars to
get it to do arbitrary actions?). Not actually putting this into
deployment on anything but my own box, but would just be good for me
to know, and I’m mostly curious about my original question. Thanks in
advance for any answers.
To add to the confusion, the rake task runs fine from root’s crontab.
I found some information on taint and $SAFE, but it’s unclear to me
why things work via cron but not via a suid binary.
To add to the confusion, the rake task runs fine from root’s crontab.
I found some information on taint and $SAFE, but it’s unclear to me
why things work via cron but not via a suid binary.
You need to cd into the directory where the Rakefile is since most of
the “file” and other relative tasks like FileUtils will be generated
in pwd.
You can safely avoid that by doing "cd /path/to/app && rake "
To add to the confusion, the rake task runs fine from root’s crontab.
I found some information on taint and $SAFE, but it’s unclear to me
why things work via cron but not via a suid binary.
$SAFE is set to 1 if the code is run setuid.
The actual test is if the real UID is non-zero and the real UID is
different from the effective UID or the real GID is different from the
effective GID. Code from ruby-1.9.2preview1 (ruby.c):
On Friday, May 28, 2010 04:17:35 pm Yang Z. wrote:
To add to the confusion, the rake task runs fine from root’s crontab.
I found some information on taint and $SAFE, but it’s unclear to me
why things work via cron but not via a suid binary.
Well, if the purpose of these things being enabled on setuid is to make
it
harder for a user to exploit a poorly-written Ruby script to gain root
access,
it makes perfect sense. If the task is in root’s crontab, only root can
run
it, or do anything to screw with the environment it’s being run from. If
it’s
run setuid, any user on the system can run it whenever and however they
want.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.