username to uid

This is a discussion on username to uid within the Linux Programming forums, part of the Platform Specific Boards category; Given a username, is there an easy way to convert this to a uid in c/c++. I would hope not ...

  1. #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

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. getpwnam_r returns wrong uid.
    By stevfletchcom in forum C Programming
    Replies: 5
    Last Post: 10-22-2008, 04:59 PM
  2. Getting the user's local username
    By Datamike in forum C Programming
    Replies: 8
    Last Post: 11-26-2005, 05:00 PM
  3. username collection
    By algi in forum C++ Programming
    Replies: 3
    Last Post: 01-22-2005, 01:20 PM
  4. username to uid mapping
    By rotis23 in forum C Programming
    Replies: 1
    Last Post: 10-30-2002, 03:17 AM
  5. getting username from Windows NT
    By Flucas in forum Windows Programming
    Replies: 1
    Last Post: 10-29-2001, 06:39 PM

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