Package init

This commit is contained in:
overweight 2019-09-30 10:56:22 -04:00
commit f47362f5dc
6 changed files with 275 additions and 0 deletions

View File

@ -0,0 +1,32 @@
From b229ed40e2653bd3eabaa6931cd8582280a226d7 Mon Sep 17 00:00:00 2001
From: Ben Kibbey <bjk@luxsci.net>
Date: Sat, 27 Oct 2018 12:22:25 -0700
Subject: [PATCH 55/97] b64dec: Fix to use custom memory handlers.
* src/b64dec.c (_gpgrt_b64dec_finish): Use xfree().
Signed-off-by: Ben Kibbey <bjk@luxsci.net>
---
src/b64dec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/b64dec.c b/src/b64dec.c
index 1235406..868d985 100644
--- a/src/b64dec.c
+++ b/src/b64dec.c
@@ -270,10 +270,10 @@ _gpgrt_b64dec_finish (gpgrt_b64state_t state)
err = state->lasterr;
else
{
- free (state->title);
+ xfree (state->title);
err = state->invalid_encoding? GPG_ERR_BAD_DATA : 0;
}
- free (state);
+ xfree (state);
return err;
}
--
1.8.3.1

View File

@ -0,0 +1,40 @@
From fe2f8fca3114e3a5727fdbbc5e7ebc4e442d0401 Mon Sep 17 00:00:00 2001
From: Andre Heinecke <aheinecke@intevation.de>
Date: Wed, 4 Jul 2018 18:19:42 +0200
Subject: [PATCH 06/97] core: Initialize values in estream_format
* src/estream-printf.c (_gpgrt_estream_format): Make sure
valuetable.value is inialized even on stack.
--
This makes the behavior more consistent with the calloc'ed
codepath for more then 8 variables.
It also fixes a potential crash if there were unmatched
format args provided.
GnuPG-Bug-Id: T4054
---
src/estream-printf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/estream-printf.c b/src/estream-printf.c
index f1cbcde..eb6fa3a 100644
--- a/src/estream-printf.c
+++ b/src/estream-printf.c
@@ -1565,7 +1565,11 @@ _gpgrt_estream_format (estream_printf_out_t outfnc,
else
{
for (validx=0; validx < DIM(valuetable_buffer); validx++)
- valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+ {
+ valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+ memset (&valuetable[validx].value, 0,
+ sizeof valuetable[validx].value);
+ }
}
for (argidx=0; argidx < argspecs_len; argidx++)
{
--
1.8.3.1

View File

@ -0,0 +1,122 @@
diff -up libgpg-error-1.29/configure.ac.multilib libgpg-error-1.29/configure.ac
--- libgpg-error-1.29/configure.ac.multilib 2018-04-11 14:41:10.479019981 +0200
+++ libgpg-error-1.29/configure.ac 2018-04-11 14:43:31.288394113 +0200
@@ -215,13 +215,13 @@ GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
# Find a 64 bit integer type to be used instead of off_t. We prefer
-# the standard integer types over int64_t and finally try long long.
-if test "$ac_cv_sizeof_int" = "8"; then
+# int64_t and finally try long long.
+if test "$ac_cv_header_stdint_h" = yes; then
+ replacement_for_off_t="int64_t"
+elif test "$ac_cv_sizeof_int" = "8"; then
replacement_for_off_t="int"
elif test "$ac_cv_sizeof_long" = "8"; then
replacement_for_off_t="long"
-elif test "$ac_cv_header_stdint_h" = yes; then
- replacement_for_off_t="int64_t"
elif test "$ac_cv_sizeof_long_long" = "8"; then
replacement_for_off_t="long long"
else
diff -up libgpg-error-1.29/configure.multilib libgpg-error-1.29/configure
--- libgpg-error-1.29/configure.multilib 2018-04-11 09:34:30.000000000 +0200
+++ libgpg-error-1.29/configure 2018-04-11 14:41:10.481020028 +0200
@@ -11301,7 +11301,7 @@ shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 /usr/lib64"
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11775,7 +11775,7 @@ fi
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 /usr/lib64 $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -15879,12 +15879,12 @@ fi
# Find a 64 bit integer type to be used instead of off_t. We prefer
# the standard integer types over int64_t and finally try long long.
-if test "$ac_cv_sizeof_int" = "8"; then
+if test "$ac_cv_header_stdint_h" = yes; then
+ replacement_for_off_t="int64_t"
+elif test "$ac_cv_sizeof_int" = "8"; then
replacement_for_off_t="int"
elif test "$ac_cv_sizeof_long" = "8"; then
replacement_for_off_t="long"
-elif test "$ac_cv_header_stdint_h" = yes; then
- replacement_for_off_t="int64_t"
elif test "$ac_cv_sizeof_long_long" = "8"; then
replacement_for_off_t="long long"
else
diff -up libgpg-error-1.29/src/gen-posix-lock-obj.c.multilib libgpg-error-1.29/src/gen-posix-lock-obj.c
--- libgpg-error-1.29/src/gen-posix-lock-obj.c.multilib 2016-11-16 13:22:03.000000000 +0100
+++ libgpg-error-1.29/src/gen-posix-lock-obj.c 2018-04-11 14:41:10.481020028 +0200
@@ -72,6 +72,7 @@ main (void)
#ifdef USE_POSIX_THREADS
unsigned char *p;
int i;
+ int initidx = 0;
#endif
struct {
long vers;
@@ -111,11 +112,12 @@ main (void)
/* To force a probably suitable alignment of the structure we use a
union and include a long and a pointer to a long. */
- printf ("typedef struct\n"
+ printf ("#include <pthread.h>\n"
+ "typedef struct\n"
"{\n"
" long _vers;\n"
" union {\n"
- " volatile char _priv[%d];\n"
+ " volatile char _priv[sizeof(pthread_mutex_t)];\n"
"%s"
" long _x_align;\n"
" long *_xp_align;\n"
@@ -123,7 +125,6 @@ main (void)
"} gpgrt_lock_t;\n"
"\n"
"#define GPGRT_LOCK_INITIALIZER {%d,{{",
- SIZEOF_PTHREAD_MUTEX_T,
# if USE_16BYTE_ALIGNMENT
" int _x16_align __attribute__ ((aligned (16)));\n",
# elif USE_DOUBLE_FOR_ALIGNMENT
@@ -137,10 +138,16 @@ main (void)
p = (unsigned char *)&mtx;
for (i=0; i < sizeof mtx; i++)
{
+ if (p[i] != 0)
+ initidx = i;
+ }
+
+ for (i=0; i <= initidx; i++)
+ {
if (i && !(i % 8))
printf (" \\\n%*s", 36, "");
printf ("%u", p[i]);
- if (i < sizeof mtx - 1)
+ if (i < initidx)
putchar (',');
}
fputs ("}}}\n", stdout);
diff -up libgpg-error-1.29/src/gpg-error.h.in.multilib libgpg-error-1.29/src/gpg-error.h.in
--- libgpg-error-1.29/src/gpg-error.h.in.multilib 2018-04-11 14:41:10.481020028 +0200
+++ libgpg-error-1.29/src/gpg-error.h.in 2018-04-11 14:45:28.184203566 +0200
@@ -17,7 +17,7 @@
* License along with this program; if not, see <https://www.gnu.org/licenses/>.
* SPDX-License-Identifier: LGPL-2.1+
*
- * @configure_input@
+ * Do not edit. Generated from gpg-error.h.in.
*/
/* The GnuPG project consists of many components. Error codes are

BIN
libgpg-error-1.31.tar.bz2 Normal file

Binary file not shown.

Binary file not shown.

81
libgpg-error.spec Normal file
View File

@ -0,0 +1,81 @@
Name: libgpg-error
Version: 1.31
Release: 3
Summary: Library for common error values and messages in GnuPG components.
License: LGPLv2+
URL: https://www.gnupg.org/ftp/gcrypt/libgpg-error/
Source0: https://www.gnupg.org/ftp/gcrypt/libgpg-error/%{name}-%{version}.tar.bz2
# below patches are from fedora.
Patch1: libgpg-error-1.29-multilib.patch
# backport from fedora
Patch6000: core-Initialize-values-in-estream_format.patch
Patch6001: b64dec-Fix-to-use-custom-memory-handlers.patch
BuildRequires: gawk, gettext, autoconf, automake, gettext-devel, libtool, texinfo, gettext-autopoint
%description
The libgpg-error package contains a library that originally defines common error values for all GnuPG components.
Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SCdaemon.
Because Libgpg-error is a common dependency all GnuPG components, more features will be added to this library.
%package devel
Summary:Development files for libgpg-error
Requires:%{name}%{?_isa} = %{version}-%{release}
%description devel
Contains header files and development libraries for libgpg-error.
%prep
%autosetup -n %{name}-%{version} -p1
sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g;s|@GPG_ERROR_CONFIG_HOST@|none|g' src/gpg-error-config.in
sed -i -e 's|sys_lib_dlsearch_path_spec="/lib /usr/lib|sys_lib_dlsearch_path_spec="/lib /usr/lib %{_libdir}|g' configure
%build
%configure --disable-static --disable-rpath --disable-languages
%make_build
%install
%make_install
%find_lang %{name}
%check
make check
%ldconfig_post
%ldconfig_postun
%post devel
[ -f %{_infodir}/gpgrt.info.gz ] && /sbin/install-info %{_infodir}/gpgrt.info.gz %{_infodir}/dir
exit 0
%preun devel
if [ $1 = 0 -a -f %{_infodir}/gpgrt.info.gz ]; then
/sbin/install-info --delete %{_infodir}/gpgrt.info.gz %{_infodir}/dir
fi
exit 0
%files -f %{name}.lang
%{!?_licensedir:%global license %%doc}
%license COPYING COPYING.LIB
%doc AUTHORS README NEWS ChangeLog
%{_bindir}/gpg-error
%{_libdir}/libgpg-error.so.0*
%{_datadir}/libgpg-error
%files devel
%{_bindir}/*
%{_libdir}/libgpg-error.so
%{_includedir}/gpg*.h
%{_datadir}/aclocal/gpg*.m4
%{_infodir}/gpgrt.info*
%exclude %{_infodir}/dir
%exclude %{_libdir}/*.la
%{_mandir}/man1/gpg-error-config.*
%changelog
* Thu Sep 14 2019 chenzhenyu <chenzhenyu13@huawei.com> - 1.31-3
- Package init