LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 08-11-2009, 05:42 AM   #1
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 165
Thanked: 21
perl script set uid


[Log in to get rid of this advertisement]
I have a script that start the http deamon. This script has got owner and group as root and I have put a setuid on it.

That scripts executes from normal user fine. Now suddenly this script has stopped functioning.

I want to know:

1. The effective uid get propogated to other script called by this script.

2. Is there any way to stop this propogation, If yes how this can be done.

My distro is RHEL.
PMP is offline  
Tag This Post ,
Reply With Quote
Old 08-11-2009, 09:51 AM   #2
bhaslinux
Member
 
Registered: Oct 2003
Location: UnitedKingdom
Distribution: Debian Lenny
Posts: 317
Thanked: 20
AFAIK
Setuid is for binary programs. The #! in the scripts just tell the shell what program to use to run this script.
Now since you might have given something like #!/usr/bin/perl, what effectively gets translated is that shell
executes this as

/usr/bin/perl <program name>
so eventhough the program script is setuid, it will not get executed as per the setuid principle.
If this were a compiled self-executable, then the setuid will work.

so the answers are
1. the effect uid is the uid of the user who is running the script
2. ???
bhaslinux is offline     Reply With Quote
Old 08-11-2009, 10:23 AM   #3
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 165
Thanked: 21

Original Poster
Well setuid in perl is possible.
PMP is offline     Reply With Quote

Reply

Bookmarks


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set a Perl script as an unix service (start with system) onlymed Linux - Newbie 2 04-01-2009 03:59 PM
How to execute a Perl script in ~/.procmailrc with SELinux set to Enforcing? thomasz Linux - Security 1 03-14-2008 06:25 AM
Using Set UID to run script as root robo555 Linux - Software 3 11-23-2007 01:05 AM
Set UID hinetvenkat Linux - Security 4 06-08-2005 04:50 AM
set content-type to 'text/html' in sendmail, using perl script brokenfeet Programming 3 08-05-2003 03:12 PM


All times are GMT -5. The time now is 01:47 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration