diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-11-18 17:46:37 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-11-18 17:46:37 +0100 |
commit | ebf990469b79e97bf7046e9a96f20dcf7bec5d78 (patch) | |
tree | 1ec52a54cf10f852b3167cd77d5982f215b048f9 /src/cerberus.c | |
parent | m (diff) | |
download | libpassphrase-ebf990469b79e97bf7046e9a96f20dcf7bec5d78.tar.gz libpassphrase-ebf990469b79e97bf7046e9a96f20dcf7bec5d78.tar.bz2 libpassphrase-ebf990469b79e97bf7046e9a96f20dcf7bec5d78.tar.xz |
m + take ownership of and chmod /dev/vcs and /dev/vcsa
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/cerberus.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/cerberus.c b/src/cerberus.c index d84ea50..ca4cf48 100644 --- a/src/cerberus.c +++ b/src/cerberus.c @@ -33,6 +33,8 @@ int main(int argc, char** argv) char* passphrase = NULL; char preserve_env = 0; char skip_auth = 0; + struct passwd* entry; + /* Disable echoing */ disable_echo(); @@ -100,7 +102,6 @@ int main(int argc, char** argv) if (username == 0) { printf("%s: no username specified\n", *argv); - reenable_echo(); sleep(ERROR_SLEEP); return 2; } @@ -130,6 +131,15 @@ int main(int argc, char** argv) /* Get user information */ + if ((entry = getpwnam(username)) == NULL) + { + if (errno) + perror("getpwnam"); + else + printf("User does not exist\n"); + sleep(ERROR_SLEEP); + return 1; + } /* Get the passphrase, if -f has not been used */ @@ -155,6 +165,13 @@ int main(int argc, char** argv) /* Reset terminal settings */ reenable_echo(); + + /* TODO login */ + + + /* Reset terminal ownership */ + chown_tty(0, 0, 0); + return 0; } |