summaryrefslogtreecommitdiff
path: root/auth2-pubkeyfile.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2022-07-01 03:52:57 +0000
committerDamien Miller <djm@mindrot.org>2022-07-01 13:54:53 +1000
commit4be7184ebe2a2ccef175983517a35ee06766e1b4 (patch)
tree7b2bf5828fee94143efd524d2b6d9ffa85503046 /auth2-pubkeyfile.c
parent6c31ba10e97b6953c4f325f526f3e846dfea647a (diff)
downloadopenssh-git-4be7184ebe2a2ccef175983517a35ee06766e1b4.tar.gz
upstream: bump up loglevel from debug to info when unable to open
authorized keys/principals file for errno != ENOENT; bz2042 ok dtucker OpenBSD-Commit-ID: e79aa550d91ade6a80f081bda689da24c086d66b
Diffstat (limited to 'auth2-pubkeyfile.c')
-rw-r--r--auth2-pubkeyfile.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/auth2-pubkeyfile.c b/auth2-pubkeyfile.c
index 911f01ba..0cfacac3 100644
--- a/auth2-pubkeyfile.c
+++ b/auth2-pubkeyfile.c
@@ -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.
@@ -449,9 +449,13 @@ auth_openfile(const char *file, struct passwd *pw, int strict_modes,
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;
}
@@ -460,7 +464,7 @@ auth_openfile(const char *file, struct passwd *pw, int strict_modes,
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;