setsid: fix off-by-one error in execvp call
PATCH 1/1 setsid: fix off-by-one error in execvp call
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
Quoted 1 line
From
6a3baff2aa7ea3bf387d7805660f668737fe6854Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <[email protected]>
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 <[email protected]>
--- sys-utils/setsid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sys-utils/setsid.c +1 -1
@@ -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" )); }
Signature · 1 line
1.7.7
Quoted 2 lines · Bernhard Voelker
sys-utils/setsid.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com