Samuel Fine
6/27/2006 6:13:00 PM
Senthilnayagam wrote:
> Hi Samuel,
>
> you can call your shell scripts and commands to do it
>
>
> maybe "sudo" is all what you need,
>
>
>
> output = %x{shell command}
>
> you can replace "shell command" with your shell command or script, and
> output of the command will be returned to "output", which you can
> interpret with string functions
It seems that sudo wouldn't work, as I'm running Ruby code, not a
specific command from the command line. The code I have right now just
uses File.open to access shadow, and it works when run as root, but not
otherwise.
As far as we (my co-developer and I) can tell, the problem lies in the
fact that www-data is the actual user attempting to access the shadow
file. Would suexec, perhaps, take care of this? If not, do you have any
other ideas?
Thank you for your help so far. While %x didn't solve the specific
problem at hand, it answered another question that I had been looking
to solve!
Thanks again,
Samuel