Commit 6dfd9016 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Allow the -t -T -s -S flags (without <file> arg!) in -rtsopts=some mode

Without any <file> arg, these flags just dump info to stderr so
are at most a mild information disclosure danger. We disallow
a <file> arg in the default -rtsopts=some mode since that will
overwrite the given file.
parent 8c7ad0bd
......@@ -893,28 +893,31 @@ error = rtsTrue;
break;
case 'T':
OPTION_UNSAFE;
OPTION_SAFE;
RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS;
break; /* Don't initialize statistics file. */
case 'S':
OPTION_UNSAFE;
OPTION_SAFE; /* but see below */
RtsFlags.GcFlags.giveStats = VERBOSE_GC_STATS;
goto stats;
case 's':
OPTION_UNSAFE;
OPTION_SAFE; /* but see below */
RtsFlags.GcFlags.giveStats = SUMMARY_GC_STATS;
goto stats;
case 't':
OPTION_UNSAFE;
OPTION_SAFE; /* but see below */
RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS;
goto stats;
stats:
{
int r;
if (rts_argv[arg][2] != '\0') {
OPTION_UNSAFE;
}
r = openStatsFile(rts_argv[arg]+2, NULL,
&RtsFlags.GcFlags.statsFile);
if (r == -1) { error = rtsTrue; }
......@@ -1241,6 +1244,9 @@ error = rtsTrue;
{
int r;
if (rts_argv[arg][2] != '\0') {
OPTION_UNSAFE;
}
r = openStatsFile(rts_argv[arg]+2,
TICKY_FILENAME_FMT,
&RtsFlags.TickyFlags.tickyFile);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment