Add ssh_file_readaccess_ok to check read access on a file.

This commit is contained in:
Andreas Schneider
2009-07-27 14:20:32 +02:00
parent 9b97da65e6
commit cdde79418a

View File

@@ -77,6 +77,15 @@ char *ssh_get_user_home_dir(void) {
return NULL;
}
/* we have read access on file */
int ssh_file_readaccess_ok(const char *file) {
if (_access(file, 4) < 0) {
return 0;
}
return 1;
}
#else /* _WIN32 */
char *ssh_get_user_home_dir(void) {