From 7f654a6a6fb5e956b996eece36ff95e590a6ad63 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 12 May 2011 19:17:48 -0400 Subject: Add a ControlPortFileGroupWritable option --- src/or/control.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/or/control.c') diff --git a/src/or/control.c b/src/or/control.c index 634674233c..384e579f93 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -542,6 +542,14 @@ control_ports_write_to_file(void) log_warn(LD_CONTROL, "Writing %s failed: %s", options->ControlPortWriteToFile, strerror(errno)); } +#ifndef MS_WINDOWS + if (options->ControlPortFileGroupReadable) { + if (chmod(options->ControlPortWriteToFile, 0640)) { + log_warn(LD_FS,"Unable to make %s group-readable.", + options->ControlPortWriteToFile); + } + } +#endif tor_free(joined); SMARTLIST_FOREACH(lines, char *, cp, tor_free(cp)); smartlist_free(lines); -- cgit v1.2.3-54-g00ecf