diff --git a/srcpkgs/xbps/patches/0001-xbps-rindex-sign-free-pubkey-data-obj-after-external.patch b/srcpkgs/xbps/patches/0001-xbps-rindex-sign-free-pubkey-data-obj-after-external.patch new file mode 100644 index 0000000000..201fb31361 --- /dev/null +++ b/srcpkgs/xbps/patches/0001-xbps-rindex-sign-free-pubkey-data-obj-after-external.patch @@ -0,0 +1,47 @@ +From 11e04685ef61116e3e1fe0552d8abfdc4ec5b5b4 Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Thu, 6 Feb 2014 11:52:36 +0100 +Subject: [PATCH] xbps-rindex: [sign] free pubkey data obj after externalizing + index-meta. + +Otherwise the externalization process might give unexpected results. +--- + bin/xbps-rindex/sign.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/bin/xbps-rindex/sign.c b/bin/xbps-rindex/sign.c +index e6178b8..1939259 100644 +--- a/bin/xbps-rindex/sign.c ++++ b/bin/xbps-rindex/sign.c +@@ -283,14 +283,14 @@ sign_repo(struct xbps_handle *xhp, const char *repodir, + xbps_dictionary_set_uint16(meta, "public-key-size", pubkeysize); + xbps_dictionary_set_cstring_nocopy(meta, "signature-by", signedby); + xbps_dictionary_set_cstring_nocopy(meta, "signature-type", "rsa"); +- xbps_object_release(data); +- data = NULL; +- + if (!repodata_flush(xhp, repodir, repo->idx, repo->idxfiles, meta)) { + fprintf(stderr, "failed to write repodata: %s\n", strerror(errno)); +- RSA_free(rsa); +- return -1; ++ rv = -1; ++ goto out; + } ++ xbps_object_release(data); ++ data = NULL; ++ + printf("Signed repository (%u package%s)\n", + xbps_dictionary_count(repo->idx), + xbps_dictionary_count(repo->idx) == 1 ? "" : "s"); +@@ -298,6 +298,8 @@ sign_repo(struct xbps_handle *xhp, const char *repodir, + out: + index_unlock(il); + ++ if (data) ++ xbps_object_release(data); + if (rsa) { + RSA_free(rsa); + rsa = NULL; +-- +1.8.5.3 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index ecafbaf8b8..9b74c42f00 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.31 -revision=2 +revision=3 patch_args="-Np1" bootstrap=yes conf_files="/etc/xbps/xbps.conf"