From: Pasi Kallinen Date: Mon, 7 Dec 2015 16:40:04 +0000 (+0200) Subject: Stop processing arguments at -c X-Git-Tag: v1.6.1-roc-dev~57^2 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=6435ddc779c149ae1e7ab9c30f831ed5cd6f44b5;p=dgamelaunch Stop processing arguments at -c Original patch by Neil Moore --- diff --git a/dgamelaunch.c b/dgamelaunch.c index fbf6ef5..fada360 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -2719,15 +2719,15 @@ main (int argc, char** argv) __progname = basename(strdup(argv[0])); - while ((c = getopt(argc, argv, "c:sqh:pi:aeW:SD")) != -1) + while ((c = getopt(argc, argv, "csqh:pi:aeW:SD")) != -1) { + /* Stop processing arguments at -c, so that user-provided + * commands (via ssh for example) to the dgamelaunch login + * shell are ignored. + */ + if (c == 'c') break; switch (c) { - case 'c': - fprintf(stderr, "This is not a shell account, you can't execute " - "arbitrary commands.\n"); - graceful_exit(15); - break; case 's': showplayers = 1; break;