1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-31 21:32:44 +00:00
serenity/Ports/oksh/patches/remove_issetugid.patch
Manuel Palenzuela 8b0f1f816b Ports: Added an oksh port
Currently has some problems such as not killing jobs when (ctrl + c)
and depends on an implementation of sigsuspend.
2021-04-06 08:10:18 +02:00

28 lines
723 B
Diff

diff --git a/misc.c b/misc.c
index b440088..1c32061 100644
--- a/misc.c
+++ b/misc.c
@@ -291,22 +291,7 @@ change_flag(enum sh_flag f,
Flag(f) = newval;
}
} else
- /* Turning off -p? */
- if (f == FPRIVILEGED && oldval && !newval && issetugid() &&
- !dropped_privileges) {
- gid_t gid = getgid();
-
- setresgid(gid, gid, gid);
- setgroups(1, &gid);
- setresuid(ksheuid, ksheuid, ksheuid);
-
-#ifdef HAVE_PLEDGE
- if (pledge("stdio rpath wpath cpath fattr flock getpw proc "
- "exec tty", NULL) == -1)
- bi_errorf("pledge fail");
-#endif
- dropped_privileges = 1;
- } else if (f == FPOSIX && newval) {
+ if (f == FPOSIX && newval) {
Flag(FBRACEEXPAND) = 0;
}
/* Changing interactive flag? */