summaryrefslogtreecommitdiff
path: root/lib/libskey
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-23 03:52:13 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-23 03:52:13 +0000
commitacde161551bddc79946c5f69023491755435d74e (patch)
treef263e99cbe7a189b36ddfd17f6fb94dedf9eb9bc /lib/libskey
parent0011836ca9d212c6e099771ce1ef1b83a7b087c7 (diff)
Mode 0600 /etc/skeykeys
Diffstat (limited to 'lib/libskey')
-rw-r--r--lib/libskey/shlib_version2
-rw-r--r--lib/libskey/skeylogin.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libskey/shlib_version b/lib/libskey/shlib_version
index a4a51c946c4..0e9ba6803ff 100644
--- a/lib/libskey/shlib_version
+++ b/lib/libskey/shlib_version
@@ -1,2 +1,2 @@
major=0
-minor=4
+minor=5
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c
index 146ad082db4..ce2aca19eff 100644
--- a/lib/libskey/skeylogin.c
+++ b/lib/libskey/skeylogin.c
@@ -8,7 +8,7 @@
*
* S/KEY verification check, lookups, and authentication.
*
- * $Id: skeylogin.c,v 1.12 1997/07/10 21:11:11 millert Exp $
+ * $Id: skeylogin.c,v 1.13 1997/07/23 03:52:12 millert Exp $
*/
#include <sys/param.h>
@@ -123,10 +123,12 @@ skeylookup(mp, name)
if (stat(_PATH_KEYFILE, &statbuf) == -1 && errno == ENOENT) {
mp->keyfile = fopen(_PATH_KEYFILE, "w+");
if (mp->keyfile)
- chmod(_PATH_KEYFILE, 0644);
+ fchmod(fileno(mp->keyfile), 0600);
} else {
/* Otherwise open normally for update */
mp->keyfile = fopen(_PATH_KEYFILE, "r+");
+ if (mp->keyfile && (statbuf.st_mode & 0007777) != 0600)
+ fchmod(fileno(mp->keyfile), 0600);
}
if (mp->keyfile == NULL)
return -1;