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 | |
parent | 9decd47e14165e159e70829a5dd71cd076cde700 (diff) |
cleanups
-rw-r--r-- | daemon.h | 13 | ||||
-rw-r--r-- | log.c | 6 | ||||
-rw-r--r-- | log.h | 2 | ||||
-rw-r--r-- | log_targets.h | 2 | ||||
-rw-r--r-- | sig_handler.c | 14 | ||||
-rw-r--r-- | sig_handler.h | 2 | ||||
-rw-r--r-- | string_list.c | 2 | ||||
-rw-r--r-- | string_list.h | 2 |
8 files changed, 21 insertions, 22 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 + @@ -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. * @@ -35,11 +35,11 @@ #include "datatypes.h" +#include <ctype.h> #include <string.h> #include <stdarg.h> #include <stdlib.h> #include <stdio.h> -#include <ctype.h> #define SYSLOG_NAMES #include <syslog.h> @@ -15,7 +15,7 @@ * 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. * diff --git a/log_targets.h b/log_targets.h index 8db3812..4a19d8e 100644 --- a/log_targets.h +++ b/log_targets.h @@ -15,7 +15,7 @@ * 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. * diff --git a/sig_handler.c b/sig_handler.c index 0645f3c..02dbcb0 100644 --- a/sig_handler.c +++ b/sig_handler.c @@ -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. * @@ -36,18 +36,14 @@ #include "datatypes.h" #include "log.h" +#include "sig_handler.h" + #include <signal.h> #include <unistd.h> #include <fcntl.h> -#include <sys/select.h> #include <errno.h> #include <string.h> -#include "sig_handler.h" - -#include <stdio.h> - - static int sig_pipe_fds[2]; int reset_flag; @@ -159,8 +155,8 @@ void signal_stop() sigaction(SIGHUP, &act, NULL); sigaction(SIGUSR1, &act, NULL); sigaction(SIGUSR2, &act, NULL); - sigaction(SIGCHLD, &act, NULL); sigaction(SIGPIPE, &act, NULL); + sigaction(SIGCHLD, &act, NULL); close(sig_pipe_fds[0]); close(sig_pipe_fds[1]); diff --git a/sig_handler.h b/sig_handler.h index ddaf131..3acd53a 100644 --- a/sig_handler.h +++ b/sig_handler.h @@ -15,7 +15,7 @@ * 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. * diff --git a/string_list.c b/string_list.c index a4f4ab8..5e0ddf8 100644 --- a/string_list.c +++ b/string_list.c @@ -15,7 +15,7 @@ * 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. * diff --git a/string_list.h b/string_list.h index cd054cb..9e210ae 100644 --- a/string_list.h +++ b/string_list.h @@ -15,7 +15,7 @@ * 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. * |