diff options
Diffstat (limited to 'src/cerberus.c')
-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; } |