]> skyeroc.xyz Git - dgamelaunch/commitdiff
Add a -c option (login shell command) with an error message. (from Edoardo Spadolini)
authorPasi Kallinen <paxed@alt.org>
Mon, 4 Mar 2013 15:26:06 +0000 (17:26 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 4 Mar 2013 15:26:06 +0000 (17:26 +0200)
README
dgamelaunch.c

diff --git a/README b/README
index 2c1a60ded84a7fddf2e03eed5ad7853944b46786..2ecc7ef030b4fc9a1a8d01b8ac7ac13cb5508110 100644 (file)
--- a/README
+++ b/README
@@ -152,6 +152,7 @@ COMMANDLINE PARAMETERS
 ======================
 
  -a            Ignored.
+ -c            Shows error message and exits. (login shell command)
  -e            Ignored.
  -h            Ignored.
  -i user       Autologin and run the register -command hook for "user"
@@ -191,6 +192,7 @@ ERROR CODES
   11   Cannot run as root: Config file has shed_uid = 0
   12   Config file has an unrecognized token
   13   Config file: Negative value not accepted
+  15   dgamelaunch called with -c (login shell command); exited
   20   No menu defined, or no banner found for menu
   60   Cannot create a new terminal, or no termcap files.
   61   Cannot openpty()
index cdacfb51490f3042512284f1b4ad27b2c0f54673..fbf6ef551e83940d31bce941e09530c9ad8ccf1f 100644 (file)
@@ -2719,10 +2719,15 @@ main (int argc, char** argv)
 
   __progname = basename(strdup(argv[0]));
 
-  while ((c = getopt(argc, argv, "sqh:pi:aeW:SD")) != -1)
+  while ((c = getopt(argc, argv, "c:sqh:pi:aeW:SD")) != -1)
   {
     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;