X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Faclq.c;h=9e456e485babbe3e065336c1a75a404adbd7c453;hb=b09e79496d929d0e310ffeeb9e28c8949a56e10b;hp=6ea2e1dd7ba0e3d7e9c2b22d02716fbe4ed6608b;hpb=97a849f60570c2174bf0397311498f29d5b9155a;p=apply-default-acl.git 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; }