From d89f22c28473cd2e201500af0f970478105c632a Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 25 Dec 2012 15:55:11 -0500 Subject: [PATCH] Rename the project to apply-default-acl. --- configure.ac | 4 +- doc/README | 8 +-- run-tests.sh | 2 +- src/Makefile.am | 4 +- ...pply_default_acl.c => apply-default-acl.c} | 54 +++++++++---------- 5 files changed, 36 insertions(+), 36 deletions(-) rename src/{reapply_default_acl.c => apply-default-acl.c} (90%) diff --git a/configure.ac b/configure.ac index 7fe6637..2df766b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,9 +2,9 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) -AC_INIT([reapply_default_acl], [0.0.2], [michael@orlitzky.com]) +AC_INIT([apply-default-acl], [0.0.3], [michael@orlitzky.com]) AM_INIT_AUTOMAKE -AC_CONFIG_SRCDIR([src/reapply_default_acl.c]) +AC_CONFIG_SRCDIR([src/apply-default-acl.c]) AC_CONFIG_FILES([Makefile src/Makefile]) # Checks for programs. diff --git a/doc/README b/doc/README index f4f704c..7bdb51f 100644 --- a/doc/README +++ b/doc/README @@ -1,6 +1,6 @@ 1. What is it? -A utility to reapply default POSIX ACLs to files and directories. +A utility to apply default POSIX ACLs to files and directories. The way some common utilities handle POSIX ACLs is busted. For more info, see [1]. @@ -26,12 +26,12 @@ directory and put it somewhere in your $PATH. Basic usage: - $ reapply_default_acl /path/to/whatever + $ apply-default-acl /path/to/whatever Work recursively (from the top down): - $ reapply_default_acl --recursive /path/to/whatever - $ reapply_default_acl -r /path/to/whatever + $ apply-default-acl --recursive /path/to/whatever + $ apply-default-acl -r /path/to/whatever 5. How to report bugs diff --git a/run-tests.sh b/run-tests.sh index 97cd281..0ce549c 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,7 +1,7 @@ #!/bin/bash # The program name. -BIN=./src/reapply_default_acl +BIN=./src/apply-default-acl # The directory where we'll do all the ACL manipulation. TESTDIR=test diff --git a/src/Makefile.am b/src/Makefile.am index 1e494f4..f2d86ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,2 +1,2 @@ -bin_PROGRAMS = reapply_default_acl -reapply_default_acl_LDFLAGS = -lacl +bin_PROGRAMS = apply-default-acl +apply_default_acl_LDFLAGS = -lacl diff --git a/src/reapply_default_acl.c b/src/apply-default-acl.c similarity index 90% rename from src/reapply_default_acl.c rename to src/apply-default-acl.c index c48f828..10bdb32 100644 --- a/src/reapply_default_acl.c +++ b/src/apply-default-acl.c @@ -394,8 +394,8 @@ int wipe_acls(const char* path) { } -int reapply_default_acl(const char* path) { - /* Really reapply the default ACL by looping through it. Returns one +int apply_default_acl(const char* path) { + /* Really apply the default ACL by looping through it. Returns one * for success, zero for failure (i.e. no ACL), and -1 on unexpected * errors. */ @@ -420,7 +420,7 @@ int reapply_default_acl(const char* path) { int ace_result = any_can_execute(path); if (ace_result == -1) { - perror("reapply_default_acl (any_can_execute)"); + perror("apply_default_acl (any_can_execute)"); return -1; } @@ -429,7 +429,7 @@ int reapply_default_acl(const char* path) { acl_t defacl = acl_get_file(parent, ACL_TYPE_DEFAULT); if (defacl == (acl_t)NULL) { - perror("reapply_default_acl (acl_get_file)"); + perror("apply_default_acl (acl_get_file)"); return -1; } @@ -438,7 +438,7 @@ int reapply_default_acl(const char* path) { int wipe_result = wipe_acls(path); if (wipe_result == -1) { - perror("reapply_default_acl (wipe_acls)"); + perror("apply_default_acl (wipe_acls)"); result = -1; goto cleanup; } @@ -447,14 +447,14 @@ int reapply_default_acl(const char* path) { ACL with this one. */ acl_t acl = acl_get_file(path, ACL_TYPE_ACCESS); if (acl == (acl_t)NULL) { - perror("reapply_default_acl (acl_get_file)"); + perror("apply_default_acl (acl_get_file)"); return -1; } /* If it's a directory, inherit the parent's default. */ int inherit_result = inherit_default_acl(path, parent); if (inherit_result == -1) { - perror("reapply_default_acl (inherit_acls)"); + perror("apply_default_acl (inherit_acls)"); result = -1; goto cleanup; } @@ -477,7 +477,7 @@ int reapply_default_acl(const char* path) { acl_permset_t permset; int ps_result = acl_get_permset(entry, &permset); if (ps_result == -1) { - perror("reapply_default_acl (acl_get_permset)"); + perror("apply_default_acl (acl_get_permset)"); result = -1; goto cleanup; } @@ -493,14 +493,14 @@ int reapply_default_acl(const char* path) { masked, we have to do it manually. */ int d_result = acl_delete_perm(permset, ACL_EXECUTE); if (d_result == -1) { - perror("reapply_default_acl (acl_delete_perm)"); + perror("apply_default_acl (acl_delete_perm)"); result = -1; goto cleanup; } int sp_result = acl_set_permset(entry, permset); if (sp_result == -1) { - perror("reapply_default_acl (acl_set_permset)"); + perror("apply_default_acl (acl_set_permset)"); result = -1; goto cleanup; } @@ -510,7 +510,7 @@ int reapply_default_acl(const char* path) { /* Finally, add the permset to the access ACL. */ int set_result = acl_set_entry(&acl, entry); if (set_result == -1) { - perror("reapply_default_acl (acl_set_entry)"); + perror("apply_default_acl (acl_set_entry)"); result = -1; goto cleanup; } @@ -521,14 +521,14 @@ int reapply_default_acl(const char* path) { /* Catches the first acl_get_entry as well as the ones at the end of the loop. */ if (ge_result == -1) { - perror("reapply_default_acl (acl_get_entry)"); + perror("apply_default_acl (acl_get_entry)"); result = -1; goto cleanup; } int sf_result = acl_set_file(path, ACL_TYPE_ACCESS, acl); if (sf_result == -1) { - perror("reapply_default_acl (acl_set_file)"); + perror("apply_default_acl (acl_set_file)"); result = -1; goto cleanup; } @@ -543,7 +543,7 @@ void usage(char* program_name) { /* * Print usage information. */ - printf("Reapply any applicable default ACLs to the given files or " + printf("Apply any applicable default ACLs to the given files or " "directories.\n\n"); printf("Usage: %s [flags] [ [ ...]]\n\n", program_name); @@ -553,15 +553,15 @@ void usage(char* program_name) { } -int reapply_default_acl_nftw(const char *target, +int apply_default_acl_nftw(const char *target, const struct stat *s, int info, struct FTW *ftw) { - /* A wrapper around the reapply_default_acl() function for use with + /* A wrapper around the apply_default_acl() function for use with * nftw(). We need to adjust the return value so that nftw() doesn't * think we've failed. */ - bool reapp_result = reapply_default_acl(target); + bool reapp_result = apply_default_acl(target); if (reapp_result) { return 0; } @@ -571,23 +571,23 @@ int reapply_default_acl_nftw(const char *target, } -bool reapply_default_acl_recursive(const char *target) { - /* Attempt to reapply default ACLs recursively. If target is a +bool apply_default_acl_recursive(const char *target) { + /* Attempt to apply default ACLs recursively. If target is a * directory, we recurse through its entries. If not, we just - * reapply the default ACL to target. + * apply the default ACL to target. * * We ignore symlinks for consistency with chmod -r. * */ if (!is_directory(target)) { - return reapply_default_acl(target); + return apply_default_acl(target); } int max_levels = 256; int flags = FTW_PHYS; /* Don't follow links. */ int nftw_result = nftw(target, - reapply_default_acl_nftw, + apply_default_acl_nftw, max_levels, flags); @@ -597,11 +597,11 @@ bool reapply_default_acl_recursive(const char *target) { } /* nftw will return -1 on error, or if the supplied function - * (reapply_default_acl_nftw) returns a non-zero result, nftw will + * (apply_default_acl_nftw) returns a non-zero result, nftw will * return that. */ if (nftw_result == -1) { - perror("reapply_default_acl_recursive (nftw)"); + perror("apply_default_acl_recursive (nftw)"); } return false; @@ -610,7 +610,7 @@ bool reapply_default_acl_recursive(const char *target) { int main(int argc, char* argv[]) { /* - * Call reapply_default_acl on each command-line argument. + * Call apply_default_acl on each command-line argument. */ if (argc < 2) { usage(argv[0]); @@ -651,11 +651,11 @@ int main(int argc, char* argv[]) { bool reapp_result = false; if (recursive) { - reapp_result = reapply_default_acl_recursive(target); + reapp_result = apply_default_acl_recursive(target); } else { /* It's either normal file, or we're not operating recursively. */ - reapp_result = reapply_default_acl(target); + reapp_result = apply_default_acl(target); } if (!reapp_result) { -- 2.44.2