- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Alternatives to "getlogin"?
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
Discussions
Discussions
Forums
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
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
тАО08-31-2006 03:42 AM
тАО08-31-2006 03:42 AM
We have an HP-UX 11.0 box running IBM's UniVerse database version 10.1. The database application runs some locally written C code to do some remote data access. This is, in Universe-speak, GCI (generalized call interface?) code.
The issue at hand is this:
Currently, the application is accessed via telnet. Part of the C code does a "getlogin" to grab the username which is then used throughout the remainder of the C stuff. That all works properly
The problem: part of the application is being relocated to a windows server. The remaing portion, including the 'gci' c code will remain on the server previously described and will be accessed via universe's uvrpc daemon. When this happens, the getlogin does not return a userid, only "". My surmise is that that uvrpcd is not placing info in utmp.
The question, given the circumstances, does anyone know of a method that the userid information can be obtained.
FWIW: An issue has been raised w/ Universe support as well
Thx....scott
Solved! Go to Solution.
- Tags:
- getlogin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 03:54 AM
тАО08-31-2006 03:54 AM
SolutionSee if 'getpwuid' otherwise known by 'getpwent' works.
http://docs.hp.com/en/B2355-60105/getpwent.3C.html
Regards!
...JRF...
- Tags:
- getpwent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 04:12 AM
тАО08-31-2006 04:12 AM
Re: Alternatives to "getlogin"?
"The recommended procedure to obtain the user name associated with the real user ID of the calling process is to call getlogin(), and if that fails, to call getpwuid(geteuid))."
Yoiur code should at least make that modification (and indeed it should have always been in place).
However, this may not yield the result intended (though is will almost certainly result in a non-NULL user name). The problem is depending upon the protocol and the daemon that the effective uid is probably that of the daemon on the UNIX box. It would be possible for the daemon to fork() and exec() a new process and then set the uid but that entirely depends upon the applications design and I know (or care) nearly nothing about Universe.
- Tags:
- getpwuid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 04:12 AM
тАО08-31-2006 04:12 AM
Re: Alternatives to "getlogin"?
Doesn't that rely on getlogin_r to correctly identify the login id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 04:26 AM
тАО08-31-2006 04:26 AM
Re: Alternatives to "getlogin"?
I didn't read that reply carefully enough before responding.
I'm going to get w/ the developer this afternoon and see if we can't get that to work.
Clay..you are correct re: the backup plan. the coder that wrote this is no longer w/ the company and we are finding a variety of issues like this. I have hopes that this will work properly as I can "see" the correct user attached to the process when doing a "ps".
Thanks to both. I'll update this when I have some results one way or the other....
scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-01-2006 07:08 AM
тАО09-01-2006 07:08 AM
Re: Alternatives to "getlogin"?
thanks to both of you, and have a good holiday.