[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH] setsid: don't parse options which are meant for PROG
From:       Patrick Oppenlander <pattyo.lists () gmail ! com>
Date:       2016-05-09 2:55:06
Message-ID: 572FFC0A.7090004 () gmail ! com
[Download RAW message or body]

Hi,

it looks like setsid wasn't parsing options correctly as it was trying 
to understand arguments meant for the new program.

		Patrick
---8<---
'setsid ls -l' should pass the -l argument to ls rather than saying
'unrecognized option l'.
---
  miscutils/setsid.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/miscutils/setsid.c b/miscutils/setsid.c
index 1b27377..a732952 100644
--- a/miscutils/setsid.c
+++ b/miscutils/setsid.c
@@ -29,7 +29,7 @@ int setsid_main(int argc UNUSED_PARAM, char **argv)
  	unsigned opt;

  	opt_complementary = "-1"; /* at least one arg */
-	opt = getopt32(argv, "c");
+	opt = getopt32(argv, "+c");
  	argv += optind;

  	/* setsid() is allowed only when we are not a process group leader.
-- 
2.7.4

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic