diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-17 07:16:38 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-07-17 07:17:52 +0000 |
commit | 3882d7fb0dc347b5f9880b48fcd1b47175cc4260 (patch) | |
tree | c9d1a7912760ad05240045daf172f039f8d24d3e /main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch | |
parent | 39c6b57e4674fd37f819d93bf8e4184f055ed598 (diff) | |
download | aports-3882d7fb0dc347b5f9880b48fcd1b47175cc4260.tar.bz2 aports-3882d7fb0dc347b5f9880b48fcd1b47175cc4260.tar.xz |
main/apk-tools: upgrade to 2.3.2
ref #1241
Diffstat (limited to 'main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch')
-rw-r--r-- | main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch b/main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch deleted file mode 100644 index 1e855baff1..0000000000 --- a/main/apk-tools/0002-audit-apply-protected_paths.d-masks-to-individual-fi.patch +++ /dev/null @@ -1,56 +0,0 @@ -From c9a43a14697fa955f31e495a8b03a523975ad285 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> -Date: Tue, 1 May 2012 15:40:31 +0300 -Subject: [PATCH 2/5] audit: apply protected_paths.d masks to individual files - ---- - src/audit.c | 21 ++++++++++++++++++--- - 1 file changed, 18 insertions(+), 3 deletions(-) - -diff --git a/src/audit.c b/src/audit.c -index 071ff4d..03f977b 100644 ---- a/src/audit.c -+++ b/src/audit.c -@@ -14,6 +14,7 @@ - #include <fcntl.h> - #include <unistd.h> - #include <dirent.h> -+#include <fnmatch.h> - #include <sys/stat.h> - #include "apk_applet.h" - #include "apk_database.h" -@@ -199,14 +200,28 @@ recurse_check: - atctx->pathlen--; - } else { - struct apk_db_file *dbf; -+ struct apk_protected_path_array *ppaths = dbd->protected_paths; -+ int i, protected = dbd->protected, symlinks_only = dbd->symlinks_only; -+ -+ /* inherit file's protection mask */ -+ for (i = 0; i < ppaths->num; i++) { -+ struct apk_protected_path *ppath = &ppaths->item[i]; -+ char *slash = strchr(ppath->relative_pattern, '/'); -+ if (slash == NULL) { -+ if (fnmatch(ppath->relative_pattern, name, FNM_PATHNAME) != 0) -+ continue; -+ protected = ppath->protected; -+ symlinks_only = ppath->symlinks_only; -+ } -+ } - - if (actx->mode == MODE_BACKUP) { -- if (!dbd->protected) -+ if (!protected) - goto done; -- if (dbd->symlinks_only && !S_ISLNK(fi.mode)) -+ if (symlinks_only && !S_ISLNK(fi.mode)) - goto done; - } else { -- if (dbd->protected) -+ if (protected) - goto done; - } - --- -1.7.10 - |