473,663 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3767
"Tiago Simões Batista" <ba****@zmail.p twrites:
>
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*********@gm ail.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)

iD8DBQFE7fRlcER mrF/iXCsRAoSGAKCXM2 X6TaEXSE/IA4nS5SAUztc/ZgCghOKp
K02Z57Xa+l9RDU1 hhnPjy8w=
=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
4920
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 group. Rather than make them group writable where in anybody could make a script and write to my files i would like to make them setuid. I tried making a c prog with the setuid function. I used chmod and made it setuid. I called it with the system...
0
1501
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 Dave > hi all, >
1
2589
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 http://savannah.nongnu.org/cgi-bin/viewcvs/prua/prua/python-setuid.c
3
8384
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 get the right permissions, but os.setuid and os.seteuid give me a OSError No. 1. Is there a way to get what I want? My requirement is that the script should work indipendently from the mailer program, i.e I would like to avoid configuring the...
3
9286
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
15977
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
2770
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 and based on the real user-id i need to filter logs only for that user and give it for further activity. My idea was to get the real userid, groupid and search for a pattern x:userid:groupid in the /etc/password file. But again that involves fork,...
2
2529
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
3624
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 "macro:///Standard.Module4.Main()"'; print system($command); echo"successfully converted"; ?> the above program is run in terminal....
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7371
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.