]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
setsid: fix off-by-one error in execvp call
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 6 Jun 2012 14:34:55 +0000 (16:34 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 15 Jun 2012 09:42:43 +0000 (11:42 +0200)
Bug introduced during --ctty implementation by v2.21-112-g8a2f04d.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
sys-utils/setsid.c

index 52ad38f3ecb72613e0328d5bd5a3bde56f21e331..071ccc42fbd8df8c54ba3bf0c6fedb3f7b139803 100644 (file)
@@ -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"));
 }