util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] setsid: fix off-by-one error in execvp call
@ 2012-06-06 14:36 Bernhard Voelker
  2012-06-15  9:43 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Bernhard Voelker @ 2012-06-06 14:36 UTC (permalink / raw)
  To: util-linux@vger.kernel.org

E.g. run "ps -j" to see that the SID changed:
  setsid ps -j
The -j option is swallowed due to the +1.

Have a nice day,
Berny

>From 6a3baff2aa7ea3bf387d7805660f668737fe6854 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Wed, 6 Jun 2012 16:34:55 +0200
Subject: [PATCH] setsid: fix off-by-one error in execvp call

Bug introduced during --ctty implementation by v2.21-112-g8a2f04d.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
---
 sys-utils/setsid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sys-utils/setsid.c b/sys-utils/setsid.c
index 52ad38f..071ccc4 100644
--- a/sys-utils/setsid.c
+++ b/sys-utils/setsid.c
@@ -93,6 +93,6 @@ int main(int argc, char **argv)
 		if (ioctl(STDIN_FILENO, TIOCSCTTY, 1))
 			warn(_("failed to set the controlling terminal"));
 	}
-	execvp(argv[optind], argv + optind + 1);
+	execvp(argv[optind], argv + optind);
 	err(EXIT_FAILURE, _("execvp failed"));
 }
-- 
1.7.7



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] setsid: fix off-by-one error in execvp call
  2012-06-06 14:36 [PATCH] setsid: fix off-by-one error in execvp call Bernhard Voelker
@ 2012-06-15  9:43 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2012-06-15  9:43 UTC (permalink / raw)
  To: Bernhard Voelker; +Cc: util-linux@vger.kernel.org

On Wed, Jun 06, 2012 at 04:36:30PM +0200, Bernhard Voelker wrote:
>  sys-utils/setsid.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-15  9:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06 14:36 [PATCH] setsid: fix off-by-one error in execvp call Bernhard Voelker
2012-06-15  9:43 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).