CC = gcc
-CFLAGS = -O2 -march=native -pipe
+CFLAGS = -O2 -march=native -pipe -Wall
LIBS = -lacl
SOURCES := $(shell find ./src -type f -name '*.c')
#include <unistd.h>
/* ACLs */
+#include <acl/libacl.h> /* acl_get_perm, not portable */
#include <sys/types.h>
#include <sys/acl.h>
/* dirname mangles its argument */
char path_copy[PATH_MAX];
strncpy(path_copy, path, PATH_MAX-1);
- path_copy[PATH_MAX] = 0;
+ path_copy[PATH_MAX-1] = 0;
char* parent = dirname(path_copy);
if (!is_directory(parent)) {
/* For the group bits, we'll use the ACL's mask instead of the group
object bits. If the default ACL had a group entry, it should
- already have propagated (but might be masked. */
+ already have propagated (but might be masked). */
if (has_default_mask_read(parent)) {
path_mode |= S_IRGRP;
}