- djm@cvs.openbsd.org 2013/07/20 01:44:37

[ssh-keygen.c ssh.c]
     More useful error message on missing current user in /etc/passwd
This commit is contained in:
Damien Miller 2013-07-20 13:22:31 +10:00
parent 32ecfa0f79
commit 3009d3cbb8
3 changed files with 7 additions and 4 deletions

View File

@ -9,6 +9,9 @@
- djm@cvs.openbsd.org 2013/07/20 01:43:46
[umac.c]
use a union to ensure correct alignment; ok deraadt
- djm@cvs.openbsd.org 2013/07/20 01:44:37
[ssh-keygen.c ssh.c]
More useful error message on missing current user in /etc/passwd
20130718
- (djm) OpenBSD CVS Sync

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keygen.c,v 1.229 2013/07/12 05:42:03 djm Exp $ */
/* $OpenBSD: ssh-keygen.c,v 1.230 2013/07/20 01:44:37 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -2214,7 +2214,7 @@ main(int argc, char **argv)
/* we need this for the home * directory. */
pw = getpwuid(getuid());
if (!pw) {
printf("You don't exist, go away!\n");
printf("No user exists for uid %lu\n", (u_long)getuid());
exit(1);
}
if (gethostname(hostname, sizeof(hostname)) < 0) {

4
ssh.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh.c,v 1.379 2013/07/12 05:48:55 djm Exp $ */
/* $OpenBSD: ssh.c,v 1.380 2013/07/20 01:44:37 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -299,7 +299,7 @@ main(int ac, char **av)
/* Get user data. */
pw = getpwuid(original_real_uid);
if (!pw) {
logit("You don't exist, go away!");
logit("No user exists for uid %lu", (u_long)original_real_uid);
exit(255);
}
/* Take a copy of the returned structure. */