From: Rick Ashton Date: 2010-04-07T05:50:23+09:00 Subject: Re: $SAFE=0 for setuid? Thanks for all the helpful responses guys :) Brian Candler wrote: > Note that I have intentionally hard-coded the name of the script to run, > and the path to the ruby interpreter, into the wrapper. I can't hard-code the path this way. By design, a Mac app bundle should be able to live anywhere, not just under a particular path, so I can't do this. Will just have to live with the security implication then. Of course, in the case of the example you provide, there's nothing stopping someone / something from modifying / replacing /home/candlerb/myscript.rb anyways, right? > So maybe what you > should do is go with the flow, and carefully validate and untaint all > data which comes from external sources. You are totally right! :) Because the SecurityError had come from inside of open_live in the pcap library, and gave no reference to anything of mine, I had assumed something in that library was getting some tainted input. I had forgotten the fact that I had modified my program to get the network interface based on the currently active interface (which changes dynamically in OS X). This was then part of what got passed to open_live and I overlooked that. Dope! Untainting the network interface string fixed that. Solved! Thanks for the help :) -- Posted via http://www.ruby-forum.com/.