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. |
Look at these funcitons.
getpwuid() getpwnam() getgrgid() getgrnam() |
Quote:
I have been looking for this functions for hours!! getpwuid() works great. exactly what I needed! |
All times are GMT -5. The time now is 09:14 PM. |