aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-11-20 19:08:37 +0100
committerMattias Andrée <maandree@operamail.com>2013-11-20 19:08:37 +0100
commite319d2acae70e5e31c8a434a42b0d626a52c7b2d (patch)
tree80320d1e36947dd6edec3bf2118c7263fefc1ba1
parentlink libpam (diff)
downloadlibpassphrase-e319d2acae70e5e31c8a434a42b0d626a52c7b2d.tar.gz
libpassphrase-e319d2acae70e5e31c8a434a42b0d626a52c7b2d.tar.bz2
libpassphrase-e319d2acae70e5e31c8a434a42b0d626a52c7b2d.tar.xz
only root may use -f
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/cerberus.c9
1 files changed, 9 insertions, 0 deletions
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)
{