From 9641824e740781b963ef60c15aa75d23554f7aa9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 7 Apr 2014 19:43:38 +0200 Subject: fix some warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cerberus.c | 15 ++++++++------- src/login.c | 4 ++-- src/security.c | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/cerberus.c b/src/cerberus.c index 7bea9fc..49fbe66 100644 --- a/src/cerberus.c +++ b/src/cerberus.c @@ -181,16 +181,17 @@ void do_login(int argc, char** argv) /* Only root may bypass authentication */ - if (skip_auth && getuid()) + if (skip_auth) { - printf("%s: only root by use the -f option\n", *argv); - sleep(ERROR_SLEEP); - _exit(2); + if (getuid()) + { + printf("%s: only root by use the -f option\n", *argv); + sleep(ERROR_SLEEP); + _exit(2); + } } - - /* Print ant we want a passphrase, if -f has not been used */ - if (skip_auth == 0) + else { printf("Passphrase: "); fflush(stdout); diff --git a/src/login.c b/src/login.c index 32f118f..8bc5e05 100644 --- a/src/login.c +++ b/src/login.c @@ -99,7 +99,7 @@ void set_environ(struct passwd* entry, char preserve_env) char* term = NULL; if (_term) { - int n = 0, i; + size_t n = 0, i; while (*(_term + n++)) ; term = malloc(n * sizeof(char)); @@ -146,7 +146,7 @@ void exec_shell(struct passwd* entry) { int child_argc = 0; char** child_argv = malloc(5 * sizeof(char*)); - long n = 0; + size_t n = 0; char* sh = entry->pw_shell; char* login_sh; diff --git a/src/security.c b/src/security.c index 151a7a3..45feb66 100644 --- a/src/security.c +++ b/src/security.c @@ -33,7 +33,7 @@ #include "security.h" -static inline void fail(char* str) +static void fail(const char* str) { perror(str); sleep(ERROR_SLEEP); @@ -62,7 +62,7 @@ void secure_tty(gid_t group) /* Kill other processes on this TTY */ tcgetattr(STDIN_FILENO, &tty); saved_tty = tty; - tty.c_cflag &= ~HUPCL; + tty.c_cflag &= (tcflag_t)~HUPCL; tcsetattr(0, TCSANOW, &tty); close(STDIN_FILENO); close(STDOUT_FILENO); -- cgit v1.2.3-70-g09d2