Use setuid() and setgid(), not setreuid() and setregid().
This commit is contained in:
parent
d339fcc90b
commit
4ded5e85bb
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "$Id: main.c,v 1.11 1994/07/04 19:30:22 deraadt Exp $";
|
static char rcsid[] = "$Id: main.c,v 1.12 1994/09/19 02:56:37 mycroft Exp $";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SETSID
|
#define SETSID
|
||||||
@ -1144,8 +1144,8 @@ device_script(program, in, out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
setreuid(getuid(), getuid());
|
setuid(getuid());
|
||||||
setregid(getgid(), getgid());
|
setgid(getgid());
|
||||||
sigprocmask(SIG_SETMASK, &mask, NULL);
|
sigprocmask(SIG_SETMASK, &mask, NULL);
|
||||||
dup2(in, 0);
|
dup2(in, 0);
|
||||||
dup2(out, 1);
|
dup2(out, 1);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "$Id: main.c,v 1.11 1994/07/04 19:30:22 deraadt Exp $";
|
static char rcsid[] = "$Id: main.c,v 1.12 1994/09/19 02:56:37 mycroft Exp $";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SETSID
|
#define SETSID
|
||||||
@ -1144,8 +1144,8 @@ device_script(program, in, out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
setreuid(getuid(), getuid());
|
setuid(getuid());
|
||||||
setregid(getgid(), getgid());
|
setgid(getgid());
|
||||||
sigprocmask(SIG_SETMASK, &mask, NULL);
|
sigprocmask(SIG_SETMASK, &mask, NULL);
|
||||||
dup2(in, 0);
|
dup2(in, 0);
|
||||||
dup2(out, 1);
|
dup2(out, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user