summaryrefslogtreecommitdiff
path: root/src/app_audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app_audit.c')
-rw-r--r--src/app_audit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app_audit.c b/src/app_audit.c
index 9b410c5..ecf3e22 100644
--- a/src/app_audit.c
+++ b/src/app_audit.c
@@ -39,6 +39,7 @@ struct audit_ctx {
OPT(OPT_AUDIT_backup, "backup") \
OPT(OPT_AUDIT_check_permissions, "check-permissions") \
OPT(OPT_AUDIT_packages, "packages") \
+ OPT(OPT_AUDIT_protected_paths, APK_OPT_ARG "protected-paths") \
OPT(OPT_AUDIT_recursive, APK_OPT_SH("r") "recursive") \
OPT(OPT_AUDIT_system, "system")
@@ -47,6 +48,7 @@ APK_OPT_APPLET(option_desc, AUDIT_OPTIONS);
static int option_parse_applet(void *ctx, struct apk_db_options *dbopts, int opt, const char *optarg)
{
struct audit_ctx *actx = (struct audit_ctx *) ctx;
+ int r;
switch (opt) {
case OPT_AUDIT_backup:
@@ -61,6 +63,13 @@ static int option_parse_applet(void *ctx, struct apk_db_options *dbopts, int opt
case OPT_AUDIT_packages:
actx->packages_only = 1;
break;
+ case OPT_AUDIT_protected_paths:
+ r = apk_blob_from_file(AT_FDCWD, optarg, &dbopts->protected_paths);
+ if (r) {
+ apk_error("unable to read protected path file: %s: %s", optarg, apk_error_str(r));
+ return r;
+ }
+ break;
case OPT_AUDIT_recursive:
actx->recursive = 1;
break;