-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
- * apply the default ACL to target.
- *
- * We ignore symlinks for consistency with chmod -r.
- *
- */
- if (!is_directory(target)) {
- return apply_default_acl(target);
+
+/**
+ * @brief Recursive version of @c apply_default_acl().
+ *
+ * If @c target is a directory, we use @c nftw() to call @c
+ * apply_default_acl() recursively on all of its children. Otherwise,
+ * we just delegate to @c apply_default_acl().
+ *
+ * We ignore symlinks for consistency with chmod -r.
+ *
+ * @param target
+ * The root (path) of the recursive application.
+ *
+ * @param no_exec_mask
+ * The value (either true or false) of the --no-exec-mask flag.
+ *
+ * @return
+ * If @c target is not a directory, we return the result of
+ * calling @c apply_default_acl() on @c target. Otherwise, we convert
+ * the return value of @c nftw(). If @c nftw() succeeds (returns 0),
+ * then we return @c true. Otherwise, we return @c false.
+ * \n\n
+ * If there is an error, it will be reported via @c perror, but
+ * we still return @c false.
+ */
+bool apply_default_acl_recursive(const char *target, bool no_exec_mask) {
+
+ if (!is_path_directory(target)) {
+ return apply_default_acl(target, no_exec_mask);