Commit 7741f22c authored by Steve Kemp's avatar Steve Kemp
Browse files

Change the UID/GID of a logfile via filehandle.

This is better than using a path.
parent fca3639e
......@@ -55,13 +55,11 @@ import (
//
var handles = make(map[string]*os.File)
//
// The number of files we'll keep open at any one time.
//
var files_count = 100
//
// Setup a handler for SIGHUP which will close all of our
// open files.
......@@ -125,7 +123,6 @@ func close_logfiles() {
//
func safeOpen(path string) *os.File {
//
// If we have too many open files then close them all.
//
......@@ -415,7 +412,9 @@ func main() {
// Ensure the UID/GID of the logfile match that on the
// virtual-hosts' directory
os.Chown(logfile, int(uid), int(gid))
if h != nil {
h.Chown(int(uid), int(gid))
}
}
//
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment