From cbfb8e703ed9c7e31848ebf959ac7a4cf27b4a64 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 28 Mar 2014 03:51:50 -0400 Subject: Add 'rename' to the sandboxed syscalls (If we don't restrict rename, there's not much point in restricting open, since an attacker could always use rename to make us open whatever they want.) --- src/or/statefile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/or/statefile.c') diff --git a/src/or/statefile.c b/src/or/statefile.c index 2251f25e94..da31341712 100644 --- a/src/or/statefile.c +++ b/src/or/statefile.c @@ -13,6 +13,7 @@ #include "hibernate.h" #include "rephist.h" #include "router.h" +#include "sandbox.h" #include "statefile.h" /** A list of state-file "abbreviations," for compatibility. */ @@ -285,7 +286,7 @@ or_state_save_broken(char *fname) log_warn(LD_BUG, "Unable to parse state in \"%s\". Moving it aside " "to \"%s\". This could be a bug in Tor; please tell " "the developers.", fname, fname2); - if (rename(fname, fname2) < 0) { + if (tor_rename(fname, fname2) < 0) {//XXXX sandbox prohibits log_warn(LD_BUG, "Weirdly, I couldn't even move the state aside. The " "OS gave an error of %s", strerror(errno)); } -- cgit v1.2.3-54-g00ecf