C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-30-2007, 12:48 PM   #1
Obsessed with C
 
chrismiceli's Avatar
 
Join Date: Jan 2003
Posts: 501
username to uid

Given a username, is there an easy way to convert this to a uid in c/c++. I would hope not to have to look at /etc/passwd?
Thanks
__________________
Help populate a c/c++ help irc channel
server: irc://irc.efnet.net
channel: #c
chrismiceli is offline   Reply With Quote
Old 07-30-2007, 01:23 PM   #2
and the hat of Jobseeking
 
Salem's Avatar
 
Join Date: Aug 2001
Location: The edge of the known universe
Posts: 21,693
http://www.linuxmanpages.com/man3/getpwnam.3.php
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Salem is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
getpwnam_r returns wrong uid. stevfletchcom C Programming 5 10-22-2008 04:59 PM
Getting the user's local username Datamike C Programming 8 11-26-2005 06:00 PM
username collection algi C++ Programming 3 01-22-2005 02:20 PM
username to uid mapping rotis23 C Programming 1 10-30-2002 04:17 AM
getting username from Windows NT Flucas Windows Programming 1 10-29-2001 07:39 PM


All times are GMT -6. The time now is 06:49 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22