Re: help with sudo

"Matthew Bowie" <[email protected]>
Newsgroups gmane.org.user-groups.nmlug
Message-ID <[email protected]>
If Matt's idea doesn't work, you could always use multiple processes.  A
master running as root (via sudo), that calls several child processes.  Each
child could set thier uid, do whatever, then exit.  I think you'll have to
go a multi-process fork type route instead of a multi-threaded route,
because the threading method would set the uid for the whole process, not
just that thread.

Just my two bytes,
Matt

On 9/25/07, Matt Rechkemmer <nmlug-list-9d2Zkzbd0mmzjR9+/[email protected]> wrote:
>
> On Tue, Sep 25, 2007 at 06:15:28PM -0600, Chris McMahon wrote:
> > 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
> > ####################
>
> Hi,
>
> If you add "Process.euid = 0" after "puts Process.euid," it should work.
>
> [Ruby is not my specialty, so the code above may not be the best
> practice.]
>
> Hope this helps,
>
> --
> Matt Rechkemmer
> nmlug-list-9d2Zkzbd0mmzjR9+/[email protected]
>
> _______________________________________________
> NMLUG mailing list
> [email protected]
> http://lists.b9.com/cgi-bin/mailman/listinfo/nmlug
>
>
>


-- 
Matthew Bowie
Programmer/IT Consultant
[email protected]

_______________________________________________
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.