summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-23 16:13:10 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-23 16:13:10 -0700
commitbc2f71ffc680f8910367df8260b7d2fbeb6d175e (patch)
tree3c1804601e1b0fa58ed82de8dcdcbb81bdc93fca /txr.c
parentbd941bfb7f479d4a35f6be040702b714982a553a (diff)
downloadtxr-bc2f71ffc680f8910367df8260b7d2fbeb6d175e.tar.gz
txr-bc2f71ffc680f8910367df8260b7d2fbeb6d175e.tar.bz2
txr-bc2f71ffc680f8910367df8260b7d2fbeb6d175e.zip
Few more drop_privilege calls in txr_main.
* txr.c (txr_main): Drop setuid privilege as soon as we know we are just going to exit, before producing any diagnostic output, like in existing cases.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/txr.c b/txr.c
index 8abe8949..dc439209 100644
--- a/txr.c
+++ b/txr.c
@@ -655,6 +655,7 @@ int txr_main(int argc, char **argv)
prog_string, opt, org, nao);
continue;
} else {
+ drop_privilege();
format(std_error,
lit("~a: option ~a requires YYDEBUG support compiled in\n"),
prog_string, arg, nao);
@@ -673,6 +674,7 @@ int txr_main(int argc, char **argv)
val opt = chr_str(arg, one);
if (!arg_list) {
+ drop_privilege();
requires_arg(opt);
return EXIT_FAILURE;
}