]> skyeroc.xyz Git - dgamelaunch/commitdiff
For now, make game config files (and other files) created by dgl a+rw
authorPasi Kallinen <paxed@alt.org>
Sun, 23 Mar 2008 18:01:56 +0000 (18:01 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 23 Mar 2008 18:01:56 +0000 (18:01 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@430 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

TODO
dgamelaunch.c
dgamelaunch.h
dgl-common.c

diff --git a/TODO b/TODO
index 3f6e2976ae0b9f3567a853172d0ee80c27d6b1f8..59eae47d21b47908a62c35931f7c921c2c966492 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,3 +1,5 @@
+-make default_fmode configurable, and add config
+ file command "chmod file mode"
 -allow setting the new rcfile access rights.
 -allow configuring the ttyrec dir location & file format.
 
index 1beaf015980ed22b6acabc57b721f3a200e979ea..d8d7b26d42e3fe814d3082960331bf6158a76abc 100644 (file)
@@ -1417,6 +1417,7 @@ write_canned_rcfile (int game, char *target)
 
   fclose (canned);
   fclose (newfile);
+  chmod (target, default_fmode);
 }
 
 
index baa53291a1b6951438a5d9dc300eb922a5ea9718..611fc8073f98b168f8595de4f3f80254f0441976 100644 (file)
@@ -6,6 +6,7 @@
 #include "config.h"
 #include <sys/param.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <time.h>
 
 #ifndef ARRAY_SIZE
@@ -140,6 +141,8 @@ extern struct dg_globalconfig globalconfig;
 
 extern int num_games;
 
+extern mode_t default_fmode;
+
 /* dgamelaunch.c */
 extern void create_config(void);
 extern void ttyrec_getmaster(void);
index b68ff2471c4009c59e2bbfbc110e4c59d1f237f1..522e5aab24770a35e819a3b223d5c67080c976dc 100644 (file)
@@ -52,6 +52,8 @@ int loggedin = 0;
 char *chosen_name;
 int num_games = 0;
 
+mode_t default_fmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
+
 struct dg_globalconfig globalconfig;
 
 
@@ -180,6 +182,7 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
                }
                fclose (cannedf);
                fclose (newfile);
+               chmod (p2, default_fmode);
            }
            break;
        case DGLCMD_EXEC: