- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- The dark side of NIS+ (or setuid)
Operating System - HP-UX
1753851
Members
7644
Online
108807
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
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
05-17-2003 04:02 AM
05-17-2003 04:02 AM
The dark side of NIS+ (or setuid)
A call getpwnam("johan") fails if the calling program is owned by johan, has the setuid bit set and is executed by root. The user root is defined in the /etc/passwd file, the user johan resides in the NIS+ tables. The NIS+ databases are stored on the server on which the program is executed. Executing by any other user (non root), anywhere is the network works OK, executing the program as root on other systems that use the same NIS+ server also presents no problem. Removing the setuid bit also solves the problem, but since my whole security is built around this feature, that is no option for me at this moment.
The errorcode I get from getpwnam is 'Permission denied', but I must admit that I didn't set errno to 0 before calling getpwnam, so it might be a left over from the program initialization (getpwnam is the first executable statement in the program). I tried switching real and effective uids in the program, but to no avail, also calling endpwent() before calling getpwnam does not help.
My primary question is why is the program behaving differently if the setuid bit is set, and I use setresuid to set the real user id to 'root', which works under other circumstances.
It looks like some different mechanism is used to retrieve user information if the program has the setuid bit and is executed by root, but how ?.
Is there any documentation available somewhere that explains these dark details.
Hope somebody can shed some light on this
Thanks in advance
Johan
The errorcode I get from getpwnam is 'Permission denied', but I must admit that I didn't set errno to 0 before calling getpwnam, so it might be a left over from the program initialization (getpwnam is the first executable statement in the program). I tried switching real and effective uids in the program, but to no avail, also calling endpwent() before calling getpwnam does not help.
My primary question is why is the program behaving differently if the setuid bit is set, and I use setresuid to set the real user id to 'root', which works under other circumstances.
It looks like some different mechanism is used to retrieve user information if the program has the setuid bit and is executed by root, but how ?.
Is there any documentation available somewhere that explains these dark details.
Hope somebody can shed some light on this
Thanks in advance
Johan
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2003 04:23 AM
05-17-2003 04:23 AM
Re: The dark side of NIS+ (or setuid)
Is there a conflict with 'nosuid' in /etc/fstab? If so remove the nosuid option from the /etc/fstab file, then unmount and remount the directory and try again.
Support Fatherhood - Stop Family Law
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP