summaryrefslogtreecommitdiff
path: root/src/audit.c
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2017-02-03 00:37:23 +0100
committerTimo Teräs <timo.teras@iki.fi>2017-02-15 13:44:04 +0200
commit349c61c9612a328f3a80f301d37aa8c14adcb43a (patch)
treefb779b62735e2cb47ed9f1d763bc1451ed19bcd9 /src/audit.c
parent28a9dcda568c575c569ffa4b68775034b655230a (diff)
downloadapk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.tar.gz
apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.tar.bz2
apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.tar.xz
apk-tools-349c61c9612a328f3a80f301d37aa8c14adcb43a.zip
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.]
Diffstat (limited to 'src/audit.c')
-rw-r--r--src/audit.c9
1 files changed, 3 insertions, 6 deletions
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)