I was running my program under "root" user and
I wanted to access postgresql in the program
which required "postgres" user. (start program
under "root" then change to "postgres" user momentary)
How can I set user to "postgres" in the c program?
I found seteuid(id) and setreuid(id, id) functions.
But I have to know postgres's id before hand in order
to use these functions.
Is there any function in c program can be used
to set effective user's name instead of user's id?
Thank you,
Dennis
>Is there any function in c program can be used
>to set effective user's name instead of user's id?
>
>Thank you,
>Dennis
man getpwnam and getgrnam