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/connection.c | |
parent | f30327449009a7f00b0f5c2bd09a7eff615df3dd (diff) | |
download | tor-54d7d31cba84232b50fef4287951b2c4bfa746c2.tar.gz tor-54d7d31cba84232b50fef4287951b2c4bfa746c2.zip |
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/connection.c')
-rw-r--r-- | src/or/connection.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index 3f4ca1db4b..a9e3a74ed6 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -867,7 +867,7 @@ check_location_for_unix_socket(or_options_t *options, const char *path) if (options->ControlSocketsGroupWritable) flags |= CPD_GROUP_OK; - if (check_private_dir(p, flags) < 0) { + if (check_private_dir(p, flags, options->User) < 0) { char *escpath, *escdir; escpath = esc_for_log(path); escdir = esc_for_log(p); |