diff options
author | Steven Hazel <sah@freehaven.net> | 2003-10-22 11:21:29 +0000 |
---|---|---|
committer | Steven Hazel <sah@freehaven.net> | 2003-10-22 11:21:29 +0000 |
commit | 4139c1c86a92a90bde1c006a592bc7e894755140 (patch) | |
tree | e9c13ebc4eb28d01adcbcb99d1050a8c4a32a4f6 /src/common/util.h | |
parent | c78d5d7d30e94b190deef5fd721f966abceb1e18 (diff) | |
download | tor-4139c1c86a92a90bde1c006a592bc7e894755140.tar tor-4139c1c86a92a90bde1c006a592bc7e894755140.tar.gz |
- fixed a bug in the id switching code -- setgid has to happen before
setuid, because after we setuid we don't have the priviledges we
need to setgid anymore, duh. merged switch_user() and
switch_group() into switch_id(), since that code has to be wound
together.
- return -1 from switch_id() if it's not defined to do anything else.
- moved daemoinize(), write_pidfile(), and switch_id() from main.c to
util.c
svn:r656
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index 3df098c68..15893f160 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -64,6 +64,10 @@ int tor_socketpair(int family, int type, int protocol, int fd[2]); const char *get_uname(void); +void daemonize(void); +void write_pidfile(char *filename); +int switch_id(char *user, char *group); + /* For stupid historical reasons, windows sockets have an independent set of * errnos which they use as the fancy strikes them. */ |