diff --git a/authfile.c b/authfile.c index 946f50c..ddc47df 100644 --- a/authfile.c +++ b/authfile.c @@ -89,28 +89,6 @@ sshkey_save_private(struct sshkey *key, const char *filename, int sshkey_perm_ok(int fd, const char *filename) { - struct stat st; - - if (fstat(fd, &st) == -1) - return SSH_ERR_SYSTEM_ERROR; - /* - * if a key owned by the user is accessed, then we check the - * permissions of the file. if the key owned by a different user, - * then we don't care. - */ -#ifdef HAVE_CYGWIN - if (check_ntsec(filename)) -#endif - if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) { - error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); - error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @"); - error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); - error("Permissions 0%3.3o for '%s' are too open.", - (u_int)st.st_mode & 0777, filename); - error("It is required that your private key files are NOT accessible by others."); - error("This private key will be ignored."); - return SSH_ERR_KEY_BAD_PERMISSIONS; - } return 0; }