The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
test for function name? duderonomy UNIX for Advanced & Expert Users 5 05-14-2008 03:52 AM
Check existence of a login xavier054 UNIX for Advanced & Expert Users 10 03-06-2008 08:19 AM
function to test if file is open johnsonbryce Shell Programming and Scripting 3 03-10-2006 02:15 PM
how to test for file existence using file size? forevercalz Shell Programming and Scripting 3 10-26-2005 07:02 PM
C function to test string or integer qqq High Level Programming 3 03-09-2005 10:55 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-01-2008
Registered User
 

Join Date: Mar 2008
Posts: 11
Unhappy C function to test existence of a login

Hi everybody,

I need to check in C program whether a given login is known on the system. Is there any system function that could do this ?

So far, all I could find is getpwnam(), which answers my problem by parsing the local password database. But won't work if a user is authenticated by other means (PAM, Kerberos, ...).

I am surprised not to have found anything on that topic, because any shell is able to resolve a user's HOME while doing the tilde expansion, but how is it done? I had a look at the shell C sources, but I am a bit lost. Also, I don't have a system with network authentication handy, so I can't ktrace /bin/sh while doing a tilde expansion to see what function is called...

Thanks in advance, any help much appreciated.

Xavier
Reply With Quote
Forum Sponsor
  #2  
Old 03-04-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
Did you check man wtmp or man wtmpx?
Reply With Quote
  #3  
Old 03-04-2008
Registered User
 

Join Date: Mar 2008
Posts: 11
Hi, the discussion has moved here, indeed:

Check existence of a login

X.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0