From e319d2acae70e5e31c8a434a42b0d626a52c7b2d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 20 Nov 2013 19:08:37 +0100 Subject: only root may use -f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/cerberus.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/cerberus.c') diff --git a/src/cerberus.c b/src/cerberus.c index f8c0826..90bab2f 100644 --- a/src/cerberus.c +++ b/src/cerberus.c @@ -148,6 +148,15 @@ void do_login(int argc, char** argv) } + /* Only root may bypass authentication */ + if (skip_auth && 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) { -- cgit v1.2.3-70-g09d2