- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problem using calls - getprpwnam, getspnam, getspw...
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
06-02-2008 09:39 AM
06-02-2008 09:39 AM
I have been trying to use the calls
getprpwnam, getspnam, getspwnam to retrieve the login record, but all 3 calls are returning NULL. I have tried using HP-UX 11i
and HP-UX 11.23 with the same result.
The only call that seems to work is getpwnam.
Does anyone have an idea why?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 10:29 AM
06-02-2008 10:29 AM
Re: Problem using calls - getprpwnam, getspnam, getspwnam
These calls are for use with trusted password databases *only*.
http://www.docs.hp.com/en/B3921-60631/getspwent.3X.html
http://www.docs.hp.com/en/B3921-60631/getprpwent.3.html
Unless your server is a trusted one, you should use 'getpwent' calls:
http://www.docs.hp.com/en/B3921-60631/getpwent.3C.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 11:07 AM
06-02-2008 11:07 AM
SolutionI assume that by 11i, you mean 11i v1 which is better known as 11.11.
The getpwnam() function gets the information from /etc/passwd, which should always exist, so it always works.
The getprpwnam() and the getspwnam() functions get information from the /tcb directory structure, so they work only if Trusted System Mode is enabled.
The getspnam() function is for getting info from the Shadow Password file (/etc/shadow), so it will work only if the shadow password mode has been enabled.
The Trusted System Mode and shadow passwords cannot be activated simultaneously, as they are two different methods for the same purpose. The TSM is the old "HP Way" of secure password storage, while the shadow password method is fairly new in HP-UX world but it's more compatible in a multi-platform Unix environment.
The shadow password mode is an optional extra in 11.11 (available for free from http://software.hp.com). In 11.23 and above it's a standard option.
So my guess is, your machine is not configured for either TSM nor shadow passwords - so only the getpwnam() can get meaningful results.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 11:53 AM
06-02-2008 11:53 AM
Re: Problem using calls - getprpwnam, getspnam, getspwnam
My problem is I was hoping to use those functions to check the password expiry and/or account is locked for a particular user.
Is there any calls I can use to do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2008 01:58 PM
06-02-2008 01:58 PM
Re: Problem using calls - getprpwnam, getspnam, getspwnam
Thanks for all your help guys.