From: Pasi Kallinen Date: Sun, 23 Mar 2008 18:01:56 +0000 (+0000) Subject: For now, make game config files (and other files) created by dgl a+rw X-Git-Tag: v1.6.1-roc-dev~278 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=4eb5ec3c6886d7d997797d175e4df2f47063c7b7;p=dgamelaunch For now, make game config files (and other files) created by dgl a+rw git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@430 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/TODO b/TODO index 3f6e297..59eae47 100644 --- 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. diff --git a/dgamelaunch.c b/dgamelaunch.c index 1beaf01..d8d7b26 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -1417,6 +1417,7 @@ write_canned_rcfile (int game, char *target) fclose (canned); fclose (newfile); + chmod (target, default_fmode); } diff --git a/dgamelaunch.h b/dgamelaunch.h index baa5329..611fc80 100644 --- a/dgamelaunch.h +++ b/dgamelaunch.h @@ -6,6 +6,7 @@ #include "config.h" #include #include +#include #include #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); diff --git a/dgl-common.c b/dgl-common.c index b68ff24..522e5aa 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -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: