HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl setuid scripts?
Operating System - HP-UX
1833756
Members
2547
Online
110063
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 09:06 AM
03-11-2004 09:06 AM
Hi,
How can I make my Perl script run as root when run as a regular user? Nothing I try seems to work even when the script has the setuid bit set and is owned by root.
I am running Perl 5.6.1 on HP-UX 11.0.
Thanks,
Bob
How can I make my Perl script run as root when run as a regular user? Nothing I try seems to work even when the script has the setuid bit set and is owned by root.
I am running Perl 5.6.1 on HP-UX 11.0.
Thanks,
Bob
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 09:24 AM
03-11-2004 09:24 AM
Solution
perl recognizes when it is running as a setuid and takes defensive measures to stop you doing insecure things in it.
Generally this means it dosn't work. The easiest way around it is with a 'C' wrapper.
Have a look at this link for an example. If you've never done any 'C' before compile with something like theo following. Save your code as perlwrapper.c
cc -s -o perlwrapper perlwrapper.c
http://lists.q-linux.com/pipermail/ph-perl/2001-March/000059.html
Generally this means it dosn't work. The easiest way around it is with a 'C' wrapper.
Have a look at this link for an example. If you've never done any 'C' before compile with something like theo following. Save your code as perlwrapper.c
cc -s -o perlwrapper perlwrapper.c
http://lists.q-linux.com/pipermail/ph-perl/2001-March/000059.html
Never preceed any demonstration with anything more predictive than "watch this"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2004 09:53 AM
03-11-2004 09:53 AM
Re: Perl setuid scripts?
As noted, this is intentional in the design of Perl. Personally, ANY scripts that run as setuid root scare me to death. If you do make a C wrapper, make absolutely certain that the permissions on both the wrapper and the script itself are as tight as you can make them. If not, all an intruder has to do is replace your script with his and he in home free.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP