LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-08-2006, 05:41 PM   #1
banan
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Rep: Reputation: 0
Question C fstat, st_uid and alphanumeric userID


Hello everyone.
I have a problem. I need to compare the uid of a file with uid provided to me by a user. Problem is that when I use fstat and st_uid I get an integer (well, uid_t format) uid associated with alphanumeric userid and user is providing me with his alphanumeric userid.
Question: is there any way in C to get corresponding integer uid knowing alphanumeric one ore vice versa so I can compare them?
Thanks in advance.
 
Old 10-08-2006, 05:47 PM   #2
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
Look at these funcitons.
getpwuid()
getpwnam()
getgrgid()
getgrnam()
 
Old 10-08-2006, 06:17 PM   #3
banan
LQ Newbie
 
Registered: Mar 2005
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by randyding
Look at these funcitons.
getpwuid()
getpwnam()
getgrgid()
getgrnam()
THANK YOU SO MUCH!
I have been looking for this functions for hours!!
getpwuid() works great. exactly what I needed!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to get hold of fstat for debian jimieee Linux - Software 2 05-05-2005 06:43 AM
i would like to change my forum userid. How? skoona LQ Suggestions & Feedback 5 06-11-2004 10:06 PM
Troubles using fstat() on assembler... Arelys Monge Programming 1 05-06-2004 09:29 AM
Using fstat() tim_l Linux - Software 0 10-10-2003 10:20 AM
userid expiry ust Linux - Software 1 09-25-2003 05:14 AM


All times are GMT -5. The time now is 01:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration