X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fapply-default-acl.c;h=4a6ef765e10379d213661dacf39d8a08636cb20c;hb=6d396c52c731f260cc261e26c75034bd5007f0b0;hp=54cf66a6ca523ce0f5d78252d9a0643dcf850ec0;hpb=5fa3ee714935779d82594a88a252b154e7ee7a40;p=apply-default-acl.git diff --git a/src/apply-default-acl.c b/src/apply-default-acl.c index 54cf66a..4a6ef76 100644 --- a/src/apply-default-acl.c +++ b/src/apply-default-acl.c @@ -158,7 +158,7 @@ bool path_accessible(const char* path) { * * @return true if @c path is a directory, false otherwise. */ -bool is_directory(const char* path) { +bool is_path_directory(const char* path) { if (path == NULL) { return false; } @@ -456,7 +456,7 @@ int acl_execute_masked(acl_t acl) { */ int any_can_execute_or_dir(const char* path) { - if (is_directory(path)) { + if (is_path_directory(path)) { /* That was easy... */ return ACL_SUCCESS; } @@ -569,7 +569,7 @@ int assign_default_acl(const char* path, acl_t acl) { return ACL_ERROR; } - if (!is_directory(path)) { + if (!is_path_directory(path)) { return ACL_FAILURE; } @@ -708,7 +708,7 @@ int apply_default_acl(const char* path, bool no_exec_mask) { return ACL_FAILURE; } - if (!is_regular_file(path) && !is_directory(path)) { + if (!is_regular_file(path) && !is_path_directory(path)) { return ACL_FAILURE; } @@ -718,7 +718,7 @@ int apply_default_acl(const char* path, bool no_exec_mask) { path_copy[PATH_MAX-1] = 0; char* parent = dirname(path_copy); - if (!is_directory(parent)) { + if (!is_path_directory(parent)) { /* Make sure dirname() did what we think it did. */ return ACL_FAILURE; } @@ -761,7 +761,8 @@ int apply_default_acl(const char* path, bool no_exec_mask) { acl_t acl = acl_get_file(path, ACL_TYPE_ACCESS); if (acl == (acl_t)NULL) { perror("apply_default_acl (acl_get_file)"); - return ACL_ERROR; + result = ACL_ERROR; + goto cleanup; } /* If it's a directory, inherit the parent's default. */ @@ -966,7 +967,7 @@ int apply_default_acl_nftw_x(const char *target, */ bool apply_default_acl_recursive(const char *target, bool no_exec_mask) { - if (!is_directory(target)) { + if (!is_path_directory(target)) { return apply_default_acl(target, no_exec_mask); }