Several questions about uid
From: music4 (music4_at_163.net)
Date: 02/25/04
- Next message: pat saunders: "Re: sigcont"
- Previous message: Villy Kruse: "Re: sigcont"
- Next in thread: Maurizio Loreti: "Re: Several questions about uid"
- Reply: Maurizio Loreti: "Re: Several questions about uid"
- Reply: Fletcher Glenn: "Re: Several questions about uid"
- Reply: Martin Blume: "Re: Several questions about uid"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 25 Feb 2004 17:57:54 +0800
Greetings,
In my program, I want to do this:
char *username; // suppose this var. has value.
if ((pid = fork() == 0)
{
get uid from username // Question 1: how to do?
setuid(uid);
get the uid's home directory // Question 2: how to do?
execute the uid's .profile //Question 3: how to do?
setenv("MY_VAR", "aa"); // Question 4: how to handle memory?
exec("my_program");
}
else if (pid > 0)
{
waitpid(pid);
}
else
{
perror("fork error");
}
So there are totally four questions. Please help. Thanks in advance!
Evan
- Next message: pat saunders: "Re: sigcont"
- Previous message: Villy Kruse: "Re: sigcont"
- Next in thread: Maurizio Loreti: "Re: Several questions about uid"
- Reply: Maurizio Loreti: "Re: Several questions about uid"
- Reply: Fletcher Glenn: "Re: Several questions about uid"
- Reply: Martin Blume: "Re: Several questions about uid"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]