Add configurable default filemode.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@617 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2011-10-09 19:09:43 +00:00
parent acfbf2781d
commit b42d170041
3 changed files with 11 additions and 1 deletions

View File

@ -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; }

View File

@ -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();
}
}

View 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"