aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cerberus.c15
-rw-r--r--src/login.c4
-rw-r--r--src/security.c4
3 files changed, 12 insertions, 11 deletions
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);