diff options
author | Mukund Sivaraman <muks@banu.com> | 2008-08-24 11:47:50 +0530 |
---|---|---|
committer | Mukund Sivaraman <muks@banu.com> | 2008-08-24 11:47:50 +0530 |
commit | fadb98ee552dae6bd5ac8dc7e9e9b78f3f656af6 (patch) | |
tree | 140da5955fdfc018050badb7b0681bd0374cc203 /src/child.c | |
parent | 82cd6c765b2558f866d046cfe769d3e9ff5681eb (diff) | |
download | tinyproxy-fadb98ee552dae6bd5ac8dc7e9e9b78f3f656af6.tar.gz tinyproxy-fadb98ee552dae6bd5ac8dc7e9e9b78f3f656af6.zip |
Add more calls to umask() before mkstemp()
Diffstat (limited to '')
-rw-r--r-- | src/child.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/child.c b/src/child.c index f8f56cb..1bb1802 100644 --- a/src/child.c +++ b/src/child.c @@ -78,6 +78,11 @@ _child_lock_init(void) { char lock_file[] = "/tmp/tinyproxy.servers.lock.XXXXXX"; + /* Only allow u+rw bits. This may be required for some versions + * of glibc so that mkstemp() doesn't make us vulnerable. + */ + umask(0177); + lock_fd = mkstemp(lock_file); unlink(lock_file); |