]> gitweb.michael.orlitzky.com - apply-default-acl.git/blobdiff - src/apply-default-acl.c
configure.ac: bump to version 0.1.2.
[apply-default-acl.git] / src / apply-default-acl.c
index c075059b3f693e44f213dc79d688fb7a74ab172e..7a6705233c4ca4f2f29c5f5cd361e3f07efbdb57 100644 (file)
@@ -9,18 +9,19 @@
 #define _XOPEN_SOURCE 500
 #define _GNU_SOURCE
 
-#include <errno.h>
-#include <fcntl.h>  /* AT_FOO constants */
-#include <ftw.h>    /* nftw() et al. */
-#include <getopt.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
+#include <fcntl.h>   /* AT_FOO constants */
+#include <ftw.h>     /* nftw() et al. */
+#include <getopt.h>  /* getopt_long() */
+#include <stdbool.h> /* the "bool" type */
+#include <stdio.h>   /* perror() */
+#include <stdlib.h>  /* EXIT_FAILURE, EXIT_SUCCESS */
+#include <unistd.h>  /* faccessat() */
 
 #include "libadacl.h"
 
 
+#define NFTW_ERROR -1
+
 
 /**
  * @brief Determine whether or not the given path is accessible.
@@ -92,7 +93,7 @@ int apply_default_acl_nftw(const char *target,
                           int info,
                           struct FTW *ftw) {
 
-  if (apply_default_acl(target, sp, false)) {
+  if (apply_default_acl_ex(target, sp, false)) {
     return FTW_CONTINUE;
   }
   else {
@@ -114,7 +115,7 @@ int apply_default_acl_nftw_x(const char *target,
                             int info,
                             struct FTW *ftw) {
 
-  if (apply_default_acl(target, sp, true)) {
+  if (apply_default_acl_ex(target, sp, true)) {
     return FTW_CONTINUE;
   }
   else {
@@ -248,7 +249,7 @@ int main(int argc, char* argv[]) {
     }
     else {
       /* It's either a normal file, or we're not operating recursively. */
-      reapp_result = apply_default_acl(target, NULL, no_exec_mask);
+      reapp_result = apply_default_acl(target, no_exec_mask);
     }
 
     if (!reapp_result) {