From 7bc6df0246408fa246334594dfc719ef64475df4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" <Todd.Miller@courtesan.com> Date: Fri, 6 Feb 2004 19:52:17 +0000 Subject: [PATCH] Use setresuid() and setreuid() for PERM_RUNAS when appropriate instead of seteuid() which may not exist. --- set_perms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/set_perms.c b/set_perms.c index 590e01822..8d9e47b00 100644 --- a/set_perms.c +++ b/set_perms.c @@ -197,7 +197,7 @@ set_perms_suid(perm) break; case PERM_RUNAS: - if (seteuid(runas_pw->pw_uid)) + if (setresuid(-1, runas_pw->pw_uid, -1)) fatal("unable to change to runas uid", 1); break; @@ -274,7 +274,7 @@ set_perms_suid(perm) break; case PERM_RUNAS: - if (seteuid(runas_pw->pw_uid)) + if (setreuid(-1, runas_pw->pw_uid)) fatal("unable to change to runas uid", 1); break; -- 2.40.0