=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/auth2-pubkeyfile.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/ssh/auth2-pubkeyfile.c 2022/06/03 04:47:21 1.2 +++ src/usr.bin/ssh/auth2-pubkeyfile.c 2022/07/01 03:52:57 1.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: auth2-pubkeyfile.c,v 1.2 2022/06/03 04:47:21 djm Exp $ */ +/* $OpenBSD: auth2-pubkeyfile.c,v 1.3 2022/07/01 03:52:57 djm Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2010 Damien Miller. All rights reserved. @@ -448,9 +448,13 @@ FILE *f; if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) { - if (log_missing || errno != ENOENT) - debug("Could not open %s '%s': %s", file_type, file, - strerror(errno)); + if (errno != ENOENT) { + logit("Could not open user '%s' %s '%s': %s", + pw->pw_name, file_type, file, strerror(errno)); + } else if (log_missing) { + debug("Could not open user '%s' %s '%s': %s", + pw->pw_name, file_type, file, strerror(errno)); + } return NULL; } @@ -459,7 +463,7 @@ return NULL; } if (!S_ISREG(st.st_mode)) { - logit("User %s %s %s is not a regular file", + logit("User '%s' %s '%s' is not a regular file", pw->pw_name, file_type, file); close(fd); return NULL;