HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using getpwnam in a NIS+ environment
Operating System - HP-UX
1834804
Members
2914
Online
110070
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
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-09-2003 07:18 AM
05-09-2003 07:18 AM
Using getpwnam in a NIS+ environment
Hello
I have a program running in a NIS+ environment this program retrieves user information using the getpwnam function. This program fails if it is executed by root (getpwnam returns NULL) but succeeds if it is executed by another user. The user for which the information is retrieved is another than root. The user root is specified in the local /etc/passwd, the user for which the information is retrieved resides in the NIS+ tables. I'm not able to use a debugger to see what happens, but if I run the same program through tusc (also as root) it finds the information for the user. Looks like some bug in my program, but even after looking several hours I'm not able to find it. So I thought I might just ask whether somebody has seen such behaviour before.
All help will be greatly appreciated
Thanks
Johan
I have a program running in a NIS+ environment this program retrieves user information using the getpwnam function. This program fails if it is executed by root (getpwnam returns NULL) but succeeds if it is executed by another user. The user for which the information is retrieved is another than root. The user root is specified in the local /etc/passwd, the user for which the information is retrieved resides in the NIS+ tables. I'm not able to use a debugger to see what happens, but if I run the same program through tusc (also as root) it finds the information for the user. Looks like some bug in my program, but even after looking several hours I'm not able to find it. So I thought I might just ask whether somebody has seen such behaviour before.
All help will be greatly appreciated
Thanks
Johan
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 02:54 AM
05-12-2003 02:54 AM
Re: Using getpwnam in a NIS+ environment
Some more information, the problem only occurs if the program has the setuid bit set
If the owner of the program is 'johan' and the program is executed by root, getpwnam("johan") will fail (errno set to Permission denied).
For any user other than root there is no problem.
Any ideas ?
If the owner of the program is 'johan' and the program is executed by root, getpwnam("johan") will fail (errno set to Permission denied).
For any user other than root there is no problem.
Any ideas ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 06:41 AM
05-12-2003 06:41 AM
Re: Using getpwnam in a NIS+ environment
Try tossing an echo of your credentials before you are using getpwnam.
Are you running this suid/sgid?
Regards,
Shannon
Are you running this suid/sgid?
Regards,
Shannon
Microsoft. When do you want a virus today?
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