Thread: username to uid mapping

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    351

    username to uid mapping

    ok - i may have asked this question before - but i can't find it by searching!!

    is there a quick and easy way to get a username to uid mapping?
    i'm writing a daemon that forces its owning uid to a specified uid despite another user starting it. like apache forcing to run as nobody.

    however, on different boxes a user will have different uid's. Therefore the common variable across different boxes is the username and not the uid.
    so, do i have to parse the /etc/passwd file? is there an easier way?

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    thanks - thats what i needed!

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. OpenGL texture mapping with texCoordArray
    By nempo in forum Game Programming
    Replies: 1
    Last Post: 08-24-2008, 04:00 AM
  3. username to uid
    By chrismiceli in forum Linux Programming
    Replies: 1
    Last Post: 07-30-2007, 01:23 PM
  4. Getting the user's local username
    By Datamike in forum C Programming
    Replies: 8
    Last Post: 11-26-2005, 06:00 PM
  5. username collection
    By algi in forum C++ Programming
    Replies: 3
    Last Post: 01-22-2005, 02:20 PM