]> skyeroc.xyz Git - dgamelaunch/commitdiff
Stop processing arguments at -c
authorPasi Kallinen <paxed@alt.org>
Mon, 7 Dec 2015 16:40:04 +0000 (18:40 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 7 Dec 2015 16:40:14 +0000 (18:40 +0200)
Original patch by Neil Moore <neil@s-z.org>

dgamelaunch.c

index fbf6ef551e83940d31bce941e09530c9ad8ccf1f..fada3604fbd13de3709ead748e226be120536ca8 100644 (file)
@@ -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;