help with sudo

"Chris McMahon" <[email protected]>
Newsgroups gmane.org.user-groups.nmlug
Message-ID <[email protected]>
Hi NMLUG...

For a complicated reason, I need to run a script that sets euid to
several different values.  I have sudo ALL privileges, but I won't get
root on the machine in question.

Under sudo, I can set euid once, but I haven't figured out a way to
set euid more than once.  Here's a toy Ruby script that shows the
problem:

#################
euids = [2205, 2206, 2207]

euids.each do |id|

    Process.euid = id
    puts "euid is: "
    puts Process.euid

end
####################

Here's the output of this script running as me, and under sudo:

cmcmahon@machine:~$ ruby sudodemo.rb
sudodemo.rb:7:in `euid=': Operation not permitted (Errno::EPERM)
        from sudodemo.rb:7
        from sudodemo.rb:5:in `each'
        from sudodemo.rb:5
cmcmahon@machine:~$ sudo ruby sudodemo.rb
euid is:
2205
sudodemo.rb:7:in `euid=': Operation not permitted (Errno::EPERM)
        from sudodemo.rb:7
        from sudodemo.rb:5:in `each'
        from sudodemo.rb:5
cmcmahon@machine:~$


I also have access to the user whose euid is 2205, and that user also
has sudo ALL privileges.  I've tried doing "sudo -v" as the 2205 user
and then running the script as me, but I get the same result.

It may not be possible to do what I want to do, but any suggestions
would be appreciated.
Thanks,
-Chris
_______________________________________________
NMLUG mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/nmlug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.