mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 05:10:16 -05:00
Use eaccess instead of access in unixapp.c for consistent effective privilege checking
This commit is contained in:
parent
77786b616e
commit
6965f5a9f5
1 changed files with 4 additions and 4 deletions
|
|
@ -66,7 +66,7 @@ static const char* const bcachefs_paths[] = {
|
||||||
static const char* find_bcachefs(void)
|
static const char* find_bcachefs(void)
|
||||||
{
|
{
|
||||||
for (int i = 0; bcachefs_paths[i]; ++i) {
|
for (int i = 0; bcachefs_paths[i]; ++i) {
|
||||||
if (access(bcachefs_paths[i], X_OK) == 0) {
|
if (eaccess(bcachefs_paths[i], X_OK) == 0) {
|
||||||
return bcachefs_paths[i];
|
return bcachefs_paths[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -98,7 +98,7 @@ static const char* const zfs_paths[] = {
|
||||||
static const char* find_zfs(void)
|
static const char* find_zfs(void)
|
||||||
{
|
{
|
||||||
for (int i = 0; zfs_paths[i]; ++i) {
|
for (int i = 0; zfs_paths[i]; ++i) {
|
||||||
if (access(zfs_paths[i], X_OK) == 0) {
|
if (eaccess(zfs_paths[i], X_OK) == 0) {
|
||||||
return zfs_paths[i];
|
return zfs_paths[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -127,7 +127,7 @@ static const char* const zpool_paths[] = {
|
||||||
static const char* find_zpool(void)
|
static const char* find_zpool(void)
|
||||||
{
|
{
|
||||||
for (int i = 0; zpool_paths[i]; ++i) {
|
for (int i = 0; zpool_paths[i]; ++i) {
|
||||||
if (access(zpool_paths[i], X_OK) == 0) {
|
if (eaccess(zpool_paths[i], X_OK) == 0) {
|
||||||
return zpool_paths[i];
|
return zpool_paths[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2004,7 +2004,7 @@ static int fssnapshot_zfs(const char* dir, uint32_t magic, struct fssnapshot_str
|
||||||
pathcat(fss->snapshot_dir, sizeof(fss->snapshot_dir), ".zfs/snapshot/");
|
pathcat(fss->snapshot_dir, sizeof(fss->snapshot_dir), ".zfs/snapshot/");
|
||||||
|
|
||||||
/* ensure ZFS snapshot directory is visible */
|
/* ensure ZFS snapshot directory is visible */
|
||||||
if (access(fss->snapshot_dir, R_OK | X_OK) != 0) {
|
if (eaccess(fss->snapshot_dir, R_OK | X_OK) != 0) {
|
||||||
log_error(errno, "ZFS snapshot directory not accessible: '%s'. %s.\n", fss->snapshot_dir, strerror(errno));
|
log_error(errno, "ZFS snapshot directory not accessible: '%s'. %s.\n", fss->snapshot_dir, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue