]> skyeroc.xyz Git - dgamelaunch/commitdiff
Add configurable default filemode.
authorPasi Kallinen <paxed@alt.org>
Sun, 9 Oct 2011 19:09:43 +0000 (19:09 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 9 Oct 2011 19:09:43 +0000 (19:09 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@617 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

config.l
config.y
examples/dgamelaunch.conf

index 8e517da1232757e367771b05783beba48eaa2752..382064310008940ed76535a29f4c059eed56c5b6 100644 (file)
--- a/config.l
+++ b/config.l
@@ -95,6 +95,7 @@ postcommands  { return TYPE_POSTCMDQUEUE; }
 encoding       { return TYPE_ENCODING; }
 locale         { return TYPE_LOCALE; }
 utf8esc                { return TYPE_UTF8ESC; }
+filemode       { return TYPE_FILEMODE; }
 yes            { yylval.i = 1; return TYPE_BOOL; }
 no             { yylval.i = 0; return TYPE_BOOL; }
 dglstart       { yylval.i = DGLTIME_DGLSTART; return TYPE_CMDQUEUENAME; }
index 07ed0ec884bee35d981b6e0d42a4f7e0d78cd4bc..0216abe69ab92b9daaad6ab29d5d6667f2bba65f 100644 (file)
--- a/config.y
+++ b/config.y
@@ -59,7 +59,7 @@ static int sortmode_number(const char *sortmode_name) {
 %token TYPE_CMDQUEUE TYPE_DEFINE_MENU TYPE_BANNER_FILE TYPE_CURSOR
 %token TYPE_POSTCMDQUEUE
 %token TYPE_MAX_IDLE_TIME TYPE_MENU_MAX_IDLE_TIME TYPE_EXTRA_INFO_FILE
-%token TYPE_ENCODING TYPE_LOCALE TYPE_UTF8ESC
+%token TYPE_ENCODING TYPE_LOCALE TYPE_UTF8ESC TYPE_FILEMODE
 %token <s> TYPE_VALUE
 %token <i> TYPE_NUMBER TYPE_CMDQUEUENAME
 %type  <kt> KeyType
@@ -206,6 +206,10 @@ KeyPair: TYPE_CMDQUEUE '[' TYPE_CMDQUEUENAME ']'
       globalconfig.locale = strdup($3);
       break;
 
+    case TYPE_FILEMODE:
+      default_fmode = strtoul($3, NULL, 8);
+      break;
+
     default:
       fprintf(stderr, "%s:%d: token %s does not take a string, bailing out\n",
         config, line, lookup_token($1));
@@ -640,6 +644,7 @@ KeyType : TYPE_SUSER        { $$ = TYPE_SUSER; }
        | TYPE_UTF8ESC          { $$ = TYPE_UTF8ESC; }
        | TYPE_RC_FMT           { $$ = TYPE_RC_FMT; }
        | TYPE_WATCH_SORTMODE   { $$ = TYPE_WATCH_SORTMODE; }
+       | TYPE_FILEMODE         { $$ = TYPE_FILEMODE; }
        ;
 
 %%
@@ -674,6 +679,7 @@ const char* lookup_token (int t)
     case TYPE_BANNERVARS: return "bannervars";
     case TYPE_LOCALE: return "locale";
     case TYPE_UTF8ESC: return "utf8esc";
+    case TYPE_FILEMODE: return "filemode";
     default: abort();
   }
 }
index a5f92c063f7ae08028a239c666a7851b72c55167..41f860d45eb67ed3b22a6dc695ad544e60adcd24 100644 (file)
@@ -155,6 +155,9 @@ commands[login] = mkdir "%ruserdata/%n",
                      mkdir "%ruserdata/%n/dumplog",
                      mkdir "%ruserdata/%n/ttyrec"
 
+# file mode for when commands copy files.
+# readable and writable by all. you could use eg. "0644" to be more secure.
+filemode = "0666"