diff options
author | Christian Pointner <equinox@helsinki.at> | 2013-09-16 14:28:46 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2013-09-16 14:28:46 (GMT) |
commit | 6aef19e1b31044795ecd2d356315ad5506a292a2 (patch) | |
tree | 98a227eb505e7fea7d53e654d91ade9e279bdba2 /daemon.h | |
parent | 9decd47e14165e159e70829a5dd71cd076cde700 (diff) |
cleanups
Diffstat (limited to 'daemon.h')
-rw-r--r-- | daemon.h | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -13,9 +13,9 @@ * message authentication based on the methodes used by SRTP. It is * intended to deliver a generic, scaleable and secure solution for * tunneling and relaying of packets of any protocol. + * * - * - * Copyright (C) 2007-2008 Christian Pointner <equinox@anytun.org> + * Copyright (C) 2007-2010 Christian Pointner <equinox@anytun.org> * * This file is part of uAnytun. * @@ -60,7 +60,7 @@ int priv_init(priv_info_t* priv, const char* username, const char* groupname) priv->pw_ = getpwnam(username); if(!priv->pw_) { - log_printf(ERROR, "unkown user %s", username); + log_printf(ERROR, "unknown user %s", username); return -1; } @@ -70,7 +70,7 @@ int priv_init(priv_info_t* priv, const char* username, const char* groupname) priv->gr_ = getgrgid(priv->pw_->pw_gid); if(!priv->gr_) { - log_printf(ERROR, "unkown group %s", groupname); + log_printf(ERROR, "unknown group %s", groupname); return -1; } @@ -105,10 +105,11 @@ int priv_drop(priv_info_t* priv) return 0; } + int do_chroot(const char* chrootdir) { if(getuid() != 0) { - log_printf(ERROR, "this programm has to be run as root in order to run in a chroot"); + log_printf(ERROR, "this program has to be run as root in order to run in a chroot"); return -1; } @@ -121,6 +122,7 @@ int do_chroot(const char* chrootdir) log_printf(ERROR, "can't change to /: %s", strerror(errno)); return -1; } + return 0; } @@ -170,3 +172,4 @@ void daemonize() } #endif + |