diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-01 14:02:10 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-05-01 14:02:10 +0000 |
commit | 67daccc73afd610030cc6710c64683da548ece5c (patch) | |
tree | 94f268442bb2e8a5ba0e83387738f027bfe358cd /main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch | |
parent | 39497978865c49fd42b63379b93f2bca58518b9e (diff) | |
download | aports-67daccc73afd610030cc6710c64683da548ece5c.tar.bz2 aports-67daccc73afd610030cc6710c64683da548ece5c.tar.xz |
main/apk-tools: fix for protected_paths.d
Diffstat (limited to 'main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch')
-rw-r--r-- | main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch b/main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch new file mode 100644 index 000000000..8f11204be --- /dev/null +++ b/main/apk-tools/0001-db-strip-leading-and-trailing-slashes-from-protected.patch @@ -0,0 +1,30 @@ +From 38c1e65afbb334af0107c6bdd5362303473d866f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Tue, 1 May 2012 14:30:06 +0300 +Subject: [PATCH 1/2] db: strip leading and trailing slashes from protected + path spec + +--- + src/database.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/database.c b/src/database.c +index 26774be..bcc707f 100644 +--- a/src/database.c ++++ b/src/database.c +@@ -1181,6 +1181,12 @@ static int add_protected_path(void *ctx, apk_blob_t blob) + break; + } + ++ /* skip leading and trailing path separators */ ++ while (blob.len && blob.ptr[0] == '/') ++ blob.ptr++, blob.len--; ++ while (blob.len && blob.ptr[blob.len-1] == '/') ++ blob.len--; ++ + *apk_protected_path_array_add(&db->protected_paths) = (struct apk_protected_path) { + .relative_pattern = apk_blob_cstr(blob), + .protected = protected, +-- +1.7.10 + |