Re: help with sudo
Matt Rechkemmer <nmlug-list-9d2Zkzbd0mmzjR9+/[email protected]>
| Newsgroups | gmane.org.user-groups.nmlug |
|---|---|
| Message-ID | <[email protected]> |
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
signature.asc
(application/pgp-signature, 249 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: PK available at: http://mattrechkemmer.com/pgp.php iD8DBQFG+afFYOS2GNIeJsYRAgAaAJ9vfy8Ru0HfRjERVAILL5f6pXf2bwCdEhg1 F9Ph9AlWzPwFM5gkhRGWq4w= =62IO -----END PGP SIGNATURE-----