- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sudo config question
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
10-13-2003 02:01 AM
10-13-2003 02:01 AM
sudo config question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 02:04 AM
10-13-2003 02:04 AM
Re: sudo config question
However, you could write a wrapper script that gets run from sudo and checks the permissions itself
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 06:12 AM
10-13-2003 06:12 AM
Re: sudo config question
Does that answer your question?
--Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 06:44 AM
10-13-2003 06:44 AM
Re: sudo config question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 07:06 AM
10-13-2003 07:06 AM
Re: sudo config question
[ "$(ls -l /usr/local/bin/myscript|tr -s ' '|cut -d ' ' -f1)" != "-rwx------" ] && exit
[ "$(ls -l /usr/local/bin/myscript|tr -s ' '|cut -d ' ' -f3)" != "root" ] && exit
If you are actually worried about users changing the scripts in /usr/local/bin change the sticky bit on the directory so only the owner can change the files within. chmod +t /user/local/bin I believe is correct syntax.
--Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 07:36 AM
10-13-2003 07:36 AM
Re: sudo config question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 07:54 AM
10-13-2003 07:54 AM
Re: sudo config question
You don't have to modify their code. Just get "sudo" to run a script that checks the permissions and decide wether to allow the real program to run or not.
Checking permission by the output of "ls -l" is annoying so I am attaching a little c program for you that can output the permission of the file as a number or as the rwxrwxrwx format. It can tell you loads of other stuff too if you want. You can put this in your checking script.
compile the program with "cc -s -o mgstat mgstat.c" and run it as "mgstat -p octal filename" for the permision number or "mgstat -p string filename" for the string output. The program must have an argument or it segfaults which I can't fix right now as I don't have a compiler.