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

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