From b09e79496d929d0e310ffeeb9e28c8949a56e10b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 12 Aug 2012 19:44:37 -0400 Subject: [PATCH] Add -Wall and fix warnings. --- makefile | 2 +- src/aclq.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index d6be6c5..ffe3a9e 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -O2 -march=native -pipe +CFLAGS = -O2 -march=native -pipe -Wall LIBS = -lacl SOURCES := $(shell find ./src -type f -name '*.c') diff --git a/src/aclq.c b/src/aclq.c index 6ea2e1d..9e456e4 100644 --- a/src/aclq.c +++ b/src/aclq.c @@ -9,6 +9,7 @@ #include /* ACLs */ +#include /* acl_get_perm, not portable */ #include #include @@ -297,7 +298,7 @@ bool reapply_default_acl(const char* path) { /* 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)) { @@ -348,7 +349,7 @@ bool reapply_default_acl(const char* path) { /* 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; } -- 2.44.2