From 349c61c9612a328f3a80f301d37aa8c14adcb43a Mon Sep 17 00:00:00 2001 From: Henrik Riomar Date: Fri, 3 Feb 2017 00:37:23 +0100 Subject: add support for pre and post commit hooks This allows for instance integration of etckeeper [TT: Reorganized code a bit, and modified to use single directory commit_hooks.d with argument for script of stage.] --- src/audit.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/audit.c') diff --git a/src/audit.c b/src/audit.c index 4312fd7..0c1fbfc 100644 --- a/src/audit.c +++ b/src/audit.c @@ -179,11 +179,8 @@ static int audit_directory_tree_item(void *ctx, int dirfd, const char *name) struct apk_file_info fi; int reason = 0; - if (bdir.len + bent.len + 1 >= sizeof(atctx->path)) - return -ENOMEM; - - if (apk_fileinfo_get(dirfd, name, APK_FI_NOFOLLOW, &fi) < 0) - return -EPERM; + if (bdir.len + bent.len + 1 >= sizeof(atctx->path)) return 0; + if (apk_fileinfo_get(dirfd, name, APK_FI_NOFOLLOW, &fi) < 0) return 0; memcpy(&atctx->path[atctx->pathlen], bent.ptr, bent.len); atctx->pathlen += bent.len; @@ -273,7 +270,7 @@ done: apk_db_dir_unref(db, child, FALSE); atctx->pathlen -= bent.len; - return reason < 0 ? reason : 0; + return 0; } static int audit_directory_tree(struct audit_tree_ctx *atctx, int dirfd) -- cgit v1.2.3-70-g09d2