Bug 1548669

Summary: tcp_wrappers: Partial build flags injection
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: tcp_wrappersAssignee: Jakub Jelen <jjelen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fweimer, jjelen, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tcp_wrappers-7.6-89.fc29 tcp_wrappers-7.6-91.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-07 22:13:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1539083    

Description Florian Weimer 2018-02-24 10:31:01 UTC
/usr/lib64/libwrap.so.0.7.6 in tcp_wrappers-libs-7.6-89.fc28.x86_64 has not been linked with the standard Fedora linker flags (LDFLAGS) from redhat-rpm-config.

Looking at the makefile, there does not seem to be a good way to inject the flags:

$(SHLIB): $(LIB_OBJ)
	gcc -shared -fPIC -Wl,-z,relro -Wl,-soname -Wl,$(SHLIB).$(MAJOR) \
		-o $(SHLIB).$(MAJOR).$(MINOR).$(REL) $^ $(LIBS)
	ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB).$(MAJOR)
	ln -s $(SHLIB).$(MAJOR).$(MINOR).$(REL) $(SHLIB)

So a patch is probably needed.

See https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/master/f/buildflags.md for information on RPM macros and environment variables provided by the build environment.

Comment 1 Jakub Jelen 2018-02-26 08:19:08 UTC
Are you saying that just the LDFLAGS are missing in the above snippet? Or they 
are missing also in other places? Or something else is missing from other places?

Is there some way how I can check the changes I will do resolved the reported issue?

Comment 2 Jakub Jelen 2018-03-08 09:36:37 UTC
There is already ldflags patch, that adds LDFLAGS to all the other occurrences. If I add LDFLAGS to that line and adjust it in the spec file, I am able to build shared library in this form:

gcc -shared -fPIC -Wl,-soname -Wl,libwrap.so.0 \
	-o libwrap.so.0.7.6 hosts_access.o options.o shell_cmd.o rfc931.o eval.o hosts_ctl.o refuse.o percent_x.o clean_exit.o weak_symbols.o fromhost.o fix_options.o socket.o tli.o workarounds.o update.o misc.o diag.o percent_m.o myvsyslog.o -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lnsl

Is it sufficient or is there anything more to do? I will build the package after review. Thanks.

Comment 3 Florian Weimer 2018-03-08 09:48:10 UTC
(In reply to Jakub Jelen from comment #2)
> There is already ldflags patch, that adds LDFLAGS to all the other
> occurrences. If I add LDFLAGS to that line and adjust it in the spec file, I
> am able to build shared library in this form:
> 
> gcc -shared -fPIC -Wl,-soname -Wl,libwrap.so.0 \
> 	-o libwrap.so.0.7.6 hosts_access.o options.o shell_cmd.o rfc931.o eval.o
> hosts_ctl.o refuse.o percent_x.o clean_exit.o weak_symbols.o fromhost.o
> fix_options.o socket.o tli.o workarounds.o update.o misc.o diag.o
> percent_m.o myvsyslog.o -Wl,-z,relro  -Wl,-z,now
> -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -lnsl
> 
> Is it sufficient or is there anything more to do? I will build the package
> after review. Thanks.

Yes, commit 75a86a6d6d5daed5f653a61364c13ddbf00cb918 looks reasonable.  I will have a look at the build, too, once it finishes.

Comment 4 Jakub Jelen 2018-03-08 10:30:06 UTC
The rawhide build:

https://koji.fedoraproject.org/koji/taskinfo?taskID=25556560

Comment 5 Fedora Update System 2018-03-08 14:47:04 UTC
tcp_wrappers-7.6-90.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-109321c535

Comment 6 Fedora Update System 2018-03-09 23:25:52 UTC
tcp_wrappers-7.6-90.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-109321c535

Comment 7 Fedora Update System 2018-03-27 17:51:56 UTC
tcp_wrappers-7.6-91.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-109321c535

Comment 8 Fedora Update System 2018-04-07 22:13:23 UTC
tcp_wrappers-7.6-91.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.