mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
Add ssh_file_readaccess_ok to check read access on a file.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user