Blame SOURCES/autofs-5.0.7-add-pgrp-check-in-do_spawn.patch

ab3a3d
autofs-5.0.7 - add pgrp check in do_spawn()
ab3a3d
ab3a3d
From: Ian Kent <raven@themaw.net>
ab3a3d
ab3a3d
The process group should never be negative here but add a check anyway.
ab3a3d
---
ab3a3d
 daemon/spawn.c |    3 ++-
ab3a3d
 1 file changed, 2 insertions(+), 1 deletion(-)
ab3a3d
ab3a3d
diff --git a/daemon/spawn.c b/daemon/spawn.c
ab3a3d
index 9b8d5a2..abb353a 100644
ab3a3d
--- a/daemon/spawn.c
ab3a3d
+++ b/daemon/spawn.c
ab3a3d
@@ -201,7 +201,8 @@ static int do_spawn(unsigned logopt, unsigned int wait,
ab3a3d
 
ab3a3d
 			seteuid(0);
ab3a3d
 			setegid(0);
ab3a3d
-			setpgid(0, pgrp);
ab3a3d
+			if (pgrp >= 0)
ab3a3d
+				setpgid(0, pgrp);
ab3a3d
 		}
ab3a3d
 
ab3a3d
 		execv(prog, (char *const *) argv);