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: