Bugzilla – Attachment 1771 Details for
Bug 1694
If authorized_keys exists but can not be opened, this should be logged on server
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
More log/debug about why authorized_keys could not be used
moredebug1.diff (text/plain), 1.36 KB, created by
Rafał Maj
on 2010-01-10 16:06:33 AEDT
(
hide
)
Description:
More log/debug about why authorized_keys could not be used
Filename:
MIME Type:
Creator:
Rafał Maj
Created:
2010-01-10 16:06:33 AEDT
Size:
1.36 KB
patch
obsolete
>diff -Nua opensshd/openssh-5.1p1/auth2-pubkey.c opensshd.mine/openssh-5.1p1/auth2-pubkey.c >--- opensshd/openssh-5.1p1/auth2-pubkey.c 2010-01-10 04:48:07.000000000 +0100 >+++ opensshd.mine/openssh-5.1p1/auth2-pubkey.c 2010-01-10 02:19:00.000000000 +0100 >@@ -195,6 +195,7 @@ > f = auth_openkeyfile(file, pw, options.strict_modes); > > if (!f) { >+ debug("unable to open public key file %s", file); > restore_uid(); > return 0; > } >diff -Nua opensshd/openssh-5.1p1/auth.c opensshd.mine/openssh-5.1p1/auth.c >--- opensshd/openssh-5.1p1/auth.c 2010-01-10 04:48:07.000000000 +0100 >+++ opensshd.mine/openssh-5.1p1/auth.c 2010-01-10 05:06:38.000000000 +0100 >@@ -516,8 +516,16 @@ > * Open the file containing the authorized keys > * Fail quietly if file does not exist > */ >- if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) >+ if ((fd = open(file, O_RDONLY|O_NONBLOCK)) == -1) { >+ int err = errno; >+ switch(err) { >+ case ENOENT: debug("authorized_keys: user %s authorized keys %s file does not exist.", pw->pw_name, file); break; >+ case EACCES: logit("authorized_keys ERROR: permission denied for opening user %s authorized keys %s!", pw->pw_name, file); break; >+ default: logit("authorized_keys ERROR: Can not access user %s authorized keys %s - %s (errno=%d)!", pw->pw_name, file, >+ strerror(err), err); break; >+ } > return NULL; >+ } > > if (fstat(fd, &st) < 0) { > close(fd);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1694
: 1771 |
1772