Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > setuid root

Reply
Thread Tools

setuid root

 
 
Tiago =?iso-8859-1?Q?Sim=F5es?= Batista
Guest
Posts: n/a
 
      08-24-2006
Hello all

I have a situation that requires that a python script, that is
run from a webpage (via php exec()) must be run with root privileges.

The sysadmin already set the setuid bit on the script, but it
still fails when it tries to write to any file that only root has
write access to.

I read somewhere that any scripts that start with "#!" will no
honour the setuid bit...

I also tried os.setuid(0), with the setuid bit on, but this call
failed.

I am now out of ideas

Any sugestions?

Tiago



 
Reply With Quote
 
 
 
 
Ove Svensson
Guest
Posts: n/a
 
      08-24-2006
"Tiago Simões Batista" <(E-Mail Removed)> writes:

>
> Any sugestions?
>


http://www.faqs.org/faqs/unix-faq/fa...section-7.html
 
Reply With Quote
 
 
 
 
Patrick Useldinger
Guest
Posts: n/a
 
      08-24-2006
Tiago Simões Batista wrote:
> The sysadmin already set the setuid bit on the script, but it
> still fails when it tries to write to any file that only root has
> write access to.


use sudo.
 
Reply With Quote
 
Tiago Batista
Guest
Posts: n/a
 
      08-24-2006
On Thu, 24 Aug 2006 17:48:26 +0200
Patrick Useldinger <(E-Mail Removed)> wrote:

> Tiago Simões Batista wrote:
> > The sysadmin already set the setuid bit on the script, but it
> > still fails when it tries to write to any file that only root has
> > write access to.

>
> use sudo.
> --
> http://mail.python.org/mailman/listinfo/python-list
>


Thank you, both fot you and for Ove Svensson.

I was looking for a simpler way, that required as little intervention as possible from the main sysadmin. Given the situation I am facing, I will probably use sudo, it keeps things cleaner...

Again, thank you

Tiago

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)

iD8DBQFE7fRlcERmrF/iXCsRAoSGAKCXM2X6TaEXSE/IA4nS5SAUztc/ZgCghOKp
K02Z57Xa+l9RDU1hhnPjy8w=
=4BUk
-----END PGP SIGNATURE-----

 
Reply With Quote
 
matthewtsmall matthewtsmall is offline
Junior Member
Join Date: Jan 2011
Posts: 1
 
      01-30-2011
Not exactly a python solution, but you could certainly call a c program with the SUID bit set from the python script to circumvent this. Just be careful that you limit the functionality of the c program to a specific task as it will have to be executable from the web account.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
non root users accessing application installed with root instance hector C Programming 5 12-05-2006 01:01 PM
suidperl script setuid to root .It not work.....? Archie邱 Perl Misc 1 03-09-2006 12:24 PM
suidperl script setuid to root .It not work.....? Archie邱 Perl Misc 0 03-09-2006 12:20 PM
SRT DIvision, Square root and reciprocal square root alghazo@siu.edu VHDL 0 05-27-2004 06:23 AM
Tertiary Conditional: what does this evaluate to ("docRoot == null ? this.root : doc root")? Rick Osborn Java 10 02-08-2004 02:25 AM



Advertisments