diff options
author | Jérémy Bobbio <lunar@debian.org> | 2011-06-14 12:18:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-06-14 12:18:32 -0400 |
commit | 54d7d31cba84232b50fef4287951b2c4bfa746c2 (patch) | |
tree | 3edfea998d447846a8e5cf14b850d38eb0da7450 /src/or/router.c | |
parent | f30327449009a7f00b0f5c2bd09a7eff615df3dd (diff) | |
download | tor-54d7d31cba84232b50fef4287951b2c4bfa746c2.tar tor-54d7d31cba84232b50fef4287951b2c4bfa746c2.tar.gz |
Make ControlSocketsGroupWritable work with User.
Original message from bug3393:
check_private_dir() to ensure that ControlSocketsGroupWritable is
safe to use. Unfortunately, check_private_dir() only checks against
the currently running user… which can be root until privileges are
dropped to the user and group configured by the User config option.
The attached patch fixes the issue by adding a new effective_user
argument to check_private_dir() and updating the callers. It might
not be the best way to fix the issue, but it did in my tests.
(Code by lunar; changelog by nickm)
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c index 68e29bb4c..2165e6ea9 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -533,12 +533,12 @@ init_keys(void) return 0; } /* Make sure DataDirectory exists, and is private. */ - if (check_private_dir(options->DataDirectory, CPD_CREATE)) { + if (check_private_dir(options->DataDirectory, CPD_CREATE, options->User)) { return -1; } /* Check the key directory. */ keydir = get_datadir_fname("keys"); - if (check_private_dir(keydir, CPD_CREATE)) { + if (check_private_dir(keydir, CPD_CREATE, options->User)) { tor_free(keydir); return -1; } |