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

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