diff --git a/adns-ocloexec.patch b/adns-ocloexec.patch new file mode 100644 index 0000000..5ad5334 --- /dev/null +++ b/adns-ocloexec.patch @@ -0,0 +1,31 @@ +--- src/setup.c.orig ++++ src/setup.c +@@ -464,7 +464,7 @@ static const char *instrum_getenv(adns_s + static void readconfig(adns_state ads, const char *filename, int warnmissing) { + getline_ctx gl_ctx; + +- gl_ctx.file= fopen(filename,"r"); ++ gl_ctx.file= fopen(filename,"re"); + if (!gl_ctx.file) { + if (errno == ENOENT) { + if (warnmissing) +@@ -572,7 +572,7 @@ static int init_finish(adns_state ads) { + } + + proto= getprotobyname("udp"); if (!proto) { r= ENOPROTOOPT; goto x_free; } +- ads->udpsocket= socket(AF_INET,SOCK_DGRAM,proto->p_proto); ++ ads->udpsocket= socket(AF_INET,SOCK_DGRAM|SOCK_CLOEXEC,proto->p_proto); + if (ads->udpsocket<0) { r= errno; goto x_free; } + + r= adns__setnonblock(ads,ads->udpsocket); +--- src/event.c.orig ++++ src/event.c +@@ -123,7 +123,7 @@ void adns__tcp_tryconnect(adns_state ads + adns__diag(ads,-1,0,"unable to find protocol no. for TCP !"); + return; + } +- fd= socket(AF_INET,SOCK_STREAM,proto->p_proto); ++ fd= socket(AF_INET,SOCK_STREAM|SOCK_CLOEXEC,proto->p_proto); + if (fd<0) { + adns__diag(ads,-1,0,"cannot create TCP socket: %s",strerror(errno)); + return; diff --git a/adns-visibility.patch b/adns-visibility.patch index a3c67c5..d62e72c 100644 --- a/adns-visibility.patch +++ b/adns-visibility.patch @@ -11,50 +11,19 @@ AC_PROG_CPP AC_PROG_RANLIB AC_PROG_INSTALL -@@ -252,7 +254,7 @@ SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)' - SHLIBFILE='$(SHLIBSONAME).$(MINOR)' +--- src/internal.h.orig ++++ src/internal.h +@@ -49,6 +49,7 @@ typedef unsigned char byte; + # include "hredirect.h" + #endif - SHLIBCC='$(CC) $(CFLAGS) -fpic' --MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -o' -+MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME),-version-script=$(srcdir)/../adns.sym -o' - MKSHLIB_2='' - MKSHLIB_3='-lc' ++#pragma GCC visibility push(hidden) + /* Configuration and constants */ ---- /dev/null -+++ adns.sym -@@ -0,0 +1,35 @@ -+{ -+ global: -+adns_afterselect; -+adns_beforepoll; -+adns_beforeselect; -+adns_cancel; -+adns_check; -+adns_checkconsistency; -+adns_errabbrev; -+adns_errtypeabbrev; -+adns_finish; -+adns_firsttimeout; -+adns_forallqueries_begin; -+adns_forallqueries_next; -+adns_getaddrinfo; -+adns_globalsystemfailure; -+adns_init; -+adns_init_logfn; -+adns_init_strcfg; -+adns_processany; -+adns_processexceptional; -+adns_processreadable; -+adns_processtimeouts; -+adns_processwriteable; -+adns_rr_info; -+adns_strerror; -+adns_submit; -+adns_submit_reverse; -+adns_submit_reverse_any; -+adns_synchronous; -+adns_wait; -+adns_wait_poll; -+ -+local: *; -+}; + #define MAXSERVERS 5 +@@ -803,4 +804,5 @@ static inline int errno_resources(int e) + (tv)|=GETIL_B(cb), \ + (tv) ) + ++#pragma GCC visibility pop + #endif diff --git a/adns.changes b/adns.changes index b5c333e..cc0fbba 100644 --- a/adns.changes +++ b/adns.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Nov 22 02:23:10 UTC 2011 - crrodriguez@opensuse.org + +- Use O_CLOEXEC in library code. +- Change the visibility patch to not use the error prone + version-script but rather GCC visibility + ------------------------------------------------------------------- Fri Sep 16 19:06:22 UTC 2011 - jengelh@medozas.de diff --git a/adns.spec b/adns.spec index 5f8e317..1f6d970 100644 --- a/adns.spec +++ b/adns.spec @@ -32,6 +32,7 @@ Patch0: %{name}-%{version}-destdir.patch Patch1: %{name}-%{version}-configure.patch Patch2: %{name}-%{version}-ipv6.patch Patch3: adns-visibility.patch +Patch4: adns-ocloexec.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -65,6 +66,7 @@ programs with libads support. %patch1 %patch2 %patch3 +%patch4 cp %{S:1} . %build @@ -79,7 +81,7 @@ rm %{buildroot}%{_libdir}/*.a %check # disable check for ipv6 patch -# make check +#make check %files %defattr(-,root,root)