From: Michael Orlitzky Date: Thu, 1 Mar 2018 13:24:38 +0000 (-0500) Subject: Replace all tabs with spaces. We're not animals. X-Git-Tag: v0.1.5~1 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=1a978ea6cd152aea303e5af9939151e6370bf156;p=apply-default-acl.git Replace all tabs with spaces. We're not animals. --- diff --git a/src/apply-default-acl.c b/src/apply-default-acl.c index bebb27c..3350a19 100644 --- a/src/apply-default-acl.c +++ b/src/apply-default-acl.c @@ -74,9 +74,9 @@ void usage(const char* program_name) { } printf("Apply any applicable default ACLs to the given files or " - "directories.\n\n"); + "directories.\n\n"); printf("Usage: %s [flags] [ [ ...]]\n\n", - program_name); + program_name); printf("Flags:\n"); printf(" -h, --help Print this help message\n"); printf(" -r, --recursive Act on any given directories recursively\n"); @@ -98,9 +98,9 @@ void usage(const char* program_name) { * */ int apply_default_acl_nftw(const char *target, - const struct stat *sp, - int info, - struct FTW *ftw) { + const struct stat *sp, + int info, + struct FTW *ftw) { if (target == NULL) { errno = EINVAL; @@ -128,9 +128,9 @@ int apply_default_acl_nftw(const char *target, * */ int apply_default_acl_nftw_x(const char *target, - const struct stat *sp, - int info, - struct FTW *ftw) { + const struct stat *sp, + int info, + struct FTW *ftw) { if (target == NULL) { errno = EINVAL; diff --git a/src/libadacl.c b/src/libadacl.c index 35f8de7..f00a804 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -256,8 +256,8 @@ int acl_set_entry(acl_t* aclp, acl_entry_t entry) { if (existing_tag == entry_tag) { /* If we update something, we're done and return ACL_SUCCESS */ if (acl_set_permset(existing_entry, entry_permset) == ACL_ERROR) { - perror("acl_set_entry (acl_set_permset)"); - return ACL_ERROR; + perror("acl_set_entry (acl_set_permset)"); + return ACL_ERROR; } return ACL_SUCCESS; @@ -416,23 +416,23 @@ int acl_execute_masked(acl_t acl) { if (tag == ACL_MASK) { /* This is the mask entry, get its permissions, and see if - execute is specified. */ + execute is specified. */ acl_permset_t permset; if (acl_get_permset(entry, &permset) == ACL_ERROR) { - perror("acl_execute_masked (acl_get_permset)"); - return ACL_ERROR; + perror("acl_execute_masked (acl_get_permset)"); + return ACL_ERROR; } int gp_result = acl_get_perm(permset, ACL_EXECUTE); if (gp_result == ACL_ERROR) { - perror("acl_execute_masked (acl_get_perm)"); - return ACL_ERROR; + perror("acl_execute_masked (acl_get_perm)"); + return ACL_ERROR; } if (gp_result == ACL_FAILURE) { - /* No execute bit set in the mask; execute not allowed. */ - return ACL_SUCCESS; + /* No execute bit set in the mask; execute not allowed. */ + return ACL_SUCCESS; } } @@ -530,8 +530,8 @@ int any_can_execute(int fd, const struct stat* sp) { if (gp_result == ACL_SUCCESS) { /* Only return ACL_SUCCESS if this execute bit is not masked. */ if (acl_execute_masked(acl) != ACL_SUCCESS) { - result = ACL_SUCCESS; - goto cleanup; + result = ACL_SUCCESS; + goto cleanup; } } @@ -653,8 +653,8 @@ int acl_copy_xattr(int src_fd, if (src_size_guess == XATTR_ERROR) { if (errno == ENODATA) { /* A missing ACL isn't really an error. ENOATTR and ENODATA are - synonyms, but using ENODATA here lets us avoid another - "include" directive. */ + synonyms, but using ENODATA here lets us avoid another + "include" directive. */ return ACL_FAILURE; } perror("acl_copy_xattr (fgetxattr size guess)"); @@ -702,8 +702,8 @@ int acl_copy_xattr(int src_fd, * - @c ACL_ERROR - Unexpected library error. */ int apply_default_acl_ex(const char* path, - const struct stat* sp, - bool no_exec_mask) { + const struct stat* sp, + bool no_exec_mask) { if (path == NULL) { errno = EINVAL; @@ -743,7 +743,7 @@ int apply_default_acl_ex(const char* path, if (parent_fd == OPEN_ERROR) { if (errno == ELOOP || errno == ENOTDIR) { /* We hit a symlink, either in the last path component (ELOOP) - or higher up (ENOTDIR). */ + or higher up (ENOTDIR). */ result = ACL_FAILURE; goto cleanup; } @@ -758,7 +758,7 @@ int apply_default_acl_ex(const char* path, if (fd == OPEN_ERROR) { if (errno == ELOOP || errno == ENOTDIR) { /* We hit a symlink, either in the last path component (ELOOP) - or higher up (ENOTDIR). */ + or higher up (ENOTDIR). */ result = ACL_FAILURE; goto cleanup; } @@ -898,25 +898,25 @@ int apply_default_acl_ex(const char* path, } if (tag == ACL_MASK || - tag == ACL_USER_OBJ || - tag == ACL_GROUP_OBJ || - tag == ACL_OTHER) { + tag == ACL_USER_OBJ || + tag == ACL_GROUP_OBJ || + tag == ACL_OTHER) { if (!allow_exec) { - /* The mask doesn't affect acl_user_obj, acl_group_obj (in - minimal ACLs) or acl_other entries, so if execute should be - masked, we have to do it manually. */ - if (acl_delete_perm(permset, ACL_EXECUTE) == ACL_ERROR) { - perror("apply_default_acl_ex (acl_delete_perm)"); - result = ACL_ERROR; - goto cleanup; - } - - if (acl_set_permset(entry, permset) == ACL_ERROR) { - perror("apply_default_acl_ex (acl_set_permset)"); - result = ACL_ERROR; - goto cleanup; - } + /* The mask doesn't affect acl_user_obj, acl_group_obj (in + minimal ACLs) or acl_other entries, so if execute should be + masked, we have to do it manually. */ + if (acl_delete_perm(permset, ACL_EXECUTE) == ACL_ERROR) { + perror("apply_default_acl_ex (acl_delete_perm)"); + result = ACL_ERROR; + goto cleanup; + } + + if (acl_set_permset(entry, permset) == ACL_ERROR) { + perror("apply_default_acl_ex (acl_set_permset)"); + result = ACL_ERROR; + goto cleanup; + } } } diff --git a/src/libadacl.h b/src/libadacl.h index be72ac3..be9d50e 100644 --- a/src/libadacl.h +++ b/src/libadacl.h @@ -16,7 +16,7 @@ #define ACL_SUCCESS 1 int apply_default_acl_ex(const char* path, - const struct stat* sp, - bool no_exec_mask); + const struct stat* sp, + bool no_exec_mask); int apply_default_acl(const char* path, bool no_exec_mask);