aboutsummaryrefslogtreecommitdiffstats
path: root/main/apk-tools/0002-db-catch-asprintf-failure.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-03-13 14:49:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-03-13 14:50:31 +0000
commitfa528e7b9f5c4a21f63435b1fb01bdb3e4263205 (patch)
treef10f6599921c82f2b338755e7d1e9bd33490f6d1 /main/apk-tools/0002-db-catch-asprintf-failure.patch
parent44b4108717d8a9b85dbae549a6054fc4d6a18104 (diff)
downloadaports-fa528e7b9f5c4a21f63435b1fb01bdb3e4263205.tar.bz2
aports-fa528e7b9f5c4a21f63435b1fb01bdb3e4263205.tar.xz
main/apk-tools: backport fix for umount of /proc
Diffstat (limited to 'main/apk-tools/0002-db-catch-asprintf-failure.patch')
-rw-r--r--main/apk-tools/0002-db-catch-asprintf-failure.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/main/apk-tools/0002-db-catch-asprintf-failure.patch b/main/apk-tools/0002-db-catch-asprintf-failure.patch
new file mode 100644
index 0000000000..ede2765a20
--- /dev/null
+++ b/main/apk-tools/0002-db-catch-asprintf-failure.patch
@@ -0,0 +1,26 @@
+From 5f6e963680b8f4ef9a036ea44483b8dcca3c6ce2 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 13 Mar 2017 12:57:43 +0000
+Subject: [PATCH 2/2] db: catch asprintf failure
+
+---
+ src/database.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/database.c b/src/database.c
+index 356907e..80b80e9 100644
+--- a/src/database.c
++++ b/src/database.c
+@@ -1576,7 +1576,8 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
+ apk_blob_to_file(db->root_fd, apk_arch_file, *db->arch, APK_BTF_ADD_EOL);
+
+ /* mount /proc */
+- asprintf(&db->root_proc_dir, "%s/proc", dbopts->root);
++ if (asprintf(&db->root_proc_dir, "%s/proc", dbopts->root) == -1)
++ goto ret_errno;
+ if (statfs(db->root_proc_dir, &stfs) != 0) {
+ if (errno == ENOENT) mkdir(db->root_proc_dir, 0555);
+ stfs.f_type = 0;
+--
+2.11.1
+