]> andersk Git - openssh.git/blobdiff - authfile.c
- djm@cvs.openbsd.org 2010/01/26 02:15:20
[openssh.git] / authfile.c
index 3fbe11b0e0fd61847fc1f0ebfec4a609f8194d8b..2c615709da7a4dd2eec1896fbfcb00dc8ca91e62 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.77 2009/10/22 22:26:13 djm Exp $ */
+/* $OpenBSD: authfile.c,v 1.79 2010/01/12 00:16:47 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -559,8 +559,13 @@ key_load_private_type(int type, const char *filename, const char *passphrase,
        int fd;
 
        fd = open(filename, O_RDONLY);
-       if (fd < 0)
+       if (fd < 0) {
+               debug("could not open key file '%s': %s", filename,
+                   strerror(errno));
+               if (perm_ok != NULL)
+                       *perm_ok = 0;
                return NULL;
+       }
        if (!key_perm_ok(fd, filename)) {
                if (perm_ok != NULL)
                        *perm_ok = 0;
@@ -595,8 +600,11 @@ key_load_private(const char *filename, const char *passphrase,
        int fd;
 
        fd = open(filename, O_RDONLY);
-       if (fd < 0)
+       if (fd < 0) {
+               debug("could not open key file '%s': %s", filename,
+                   strerror(errno));
                return NULL;
+       }
        if (!key_perm_ok(fd, filename)) {
                error("bad permissions: ignore key: %s", filename);
                close(fd);
This page took 0.075308 seconds and 4 git commands to generate.