473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

setuid root

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

Aug 24 '06 #1
3 3754
"Tiago Simões Batista" <ba****@zmail.ptwrites:
>
Any sugestions?
http://www.faqs.org/faqs/unix-faq/fa...section-7.html
Aug 24 '06 #2
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.
Aug 24 '06 #3
On Thu, 24 Aug 2006 17:48:26 +0200
Patrick Useldinger <pu*********@gmail.comwrote:
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-----

Aug 24 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ben Eisenberg | last post by:
I'm trying to run a php script setuid. I've tried POSIX_setuid but you have to be root to run this. The files are located on a public access unix system and have me as the owner and nobody as the...
0
by: Dave Harrison | last post by:
hi again, Im clearly a moron, and have solved the problem myself, due to a wish to avoid dire embarrasment I shall not reveal the stupid mistake I made ;-) Apologies for the inconvenience...
1
by: Domenico Andreoli | last post by:
Hi, I did a little research about execution of Python setuid scripts. I found only a couple of C wrappers I don't like. So I wrote my own, it is available at . Feel free to send comments. 2c...
3
by: Michele Simionato | last post by:
I have a script that sometimes is run by myself (user id 501) and sometimes by the mailer program as nobody/nogroup (userid 65534). I would like to change the effective uid to 501 in any case, to...
3
by: pasear | last post by:
I find I can't run setuid perl script when I do this on a Unix-like platform: 1.Create a file "setuid.pl": #!/usr/bin/perl -T 2.chmod a+x setuid.pl 3.chmod u+s setuid.pl then i try
1
by: vertigo | last post by:
Hello i need to read $PATH variable for all users. I wanted to use something like setuid() and getenv() in C. Are there similar functions here ? (if not how can i do it ?) Thanx Michal
1
by: vimala | last post by:
Hi, I have to write a setuid program which is going to check for accesslogs based on the real user who had invoked the executable. I need to get the real and effective user-ids of the system...
2
by: Stu | last post by:
Is there anyway to tell if a setuid() call has been made to some other user? If so, can somebody provide me with some sample code Thanks in advance to all that answer
6
by: thirusvga | last post by:
please help me... Hi i want to run a php program using linux command.... php program is stored in /var/www/html/t.php that program is <?php $command='ooffice -invisible...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.