Bug 129946 - [PATCH] nscd selinux addition breaks compile
[PATCH] nscd selinux addition breaks compile
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-15 08:34 EDT by Steve Grubb
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-01 20:22:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch that solves bug #1 listed in this report (2.88 KB, patch)
2004-08-15 08:40 EDT, Steve Grubb
no flags Details | Diff
revised patch for the -60 release (2.18 KB, patch)
2004-10-01 17:32 EDT, Steve Grubb
no flags Details | Diff
patch for the specfile (1.71 KB, patch)
2004-10-01 17:48 EDT, Steve Grubb
no flags Details | Diff
Revised patch for spec file (1.24 KB, text/plain)
2004-10-01 18:37 EDT, Steve Grubb
no flags Details

  None (edit)
Description Steve Grubb 2004-08-15 08:34:42 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.4.2)
Gecko/20040308

Description of problem:
glibc-2.3.3-43 no longer compiles for my system. The problem was that
selinux extentions were added without handling the possibility that
selinux may not be installed. I will attach a patch that fixes this.

Secondly, a BuildRequires: libselinux-devel is needed. This will help
my buildsystem ensure that it doesn't try to build glibc before
selinux is ready.

And lastly, I want to mention that the continuing addition of library
dependencies to glibc causes more circular dependencies. e.g.
libselinux needs glibc's headers, glibc needs libselinux. I have this
same issue with the imaging libraries that glibc uses. I believe the
correct approach is to split out the utilities from glibc. glibc
should only be the c library.

Version-Release number of selected component (if applicable):
glibc-2.3.3-43

How reproducible:
Always

Steps to Reproduce:
1. rpmbuild -bb glibc.spec

Actual Results:  Build fails saying selinux/selinux.h cannot be found.

Expected Results:  A message saying where the rpms were written.

Additional info:
Comment 1 Steve Grubb 2004-08-15 08:40:58 EDT
Created attachment 102741 [details]
patch that solves bug #1 listed in this report

This patch adds #ifdefs to branch around selinux code. Also, there was a
function declared as returning a 'void *' that should have simply been void.
Please apply and add these to the spec file:

%define WITH_SELINUX 1	  <-- this goes at the top

%if %{WITH_SELINUX}
BuildPrereq: libselinux-devel
%endif

This last one goes down with the rest of the BuildRequires.
Comment 2 Ulrich Drepper 2004-09-30 05:45:35 EDT
We don't provide generally usable RPMs for people who think they have
to bootstrap their system.  Maintain your own code.  The RPMs as they
exist work for our buid system.  The BuildRequires entry is present.
Comment 3 Steve Grubb 2004-10-01 17:30:55 EDT
I am re-opening this bug report. The issue is still there and valid. I
will update the patch as applied to the -60 release.
Comment 4 Steve Grubb 2004-10-01 17:32:11 EDT
Created attachment 104651 [details]
revised patch for the -60 release
Comment 5 Jakub Jelinek 2004-10-01 17:37:10 EDT
Can you explain why do you need that?
selinux.h has:
#ifdef HAVE_SELINUX
...
#else
# define selinux_enabled 0
# define nscd_avc_init() (void) 0
# define nscd_avc_destroy() (void) 0
# define nscd_selinux_enabled(selinux_enabled) (void) 0
# define nscd_request_avc_has_perm(fd, req) 0
# define nscd_avc_cache_stats(cstats) (void) 0
# define nscd_avc_print_stats(cstats) (void) 0
#endif /* HAVE_SELINUX */

and Makefile has

ifeq (yes,$(have-selinux))
nscd-modules += selinux
selinux-LIBS := -lselinux
endif

which means that selinux.c is not compiled when HAVE_SELINUX is not
defined and the other files compile just fine too.
Comment 6 Steve Grubb 2004-10-01 17:48:14 EDT
Created attachment 104652 [details]
patch for the specfile

This patch adjusts the specfile so that it optionally includes the SELINUX
requirements. Please apply.
Comment 7 Steve Grubb 2004-10-01 18:37:31 EDT
Created attachment 104653 [details]
Revised patch for spec file

You are right, the patch for nscd is no longer needed. It would have been more
helpful had someone said it was fixed another way instead of go maintain your
own code. Thanks for pointing that out.

However, the spec file needs to have the branching for WITH_SELINUX like all
the other packages do. I have attached a patch for the spec file that lets
SELINUX support be turned on from the rpmbuild command line. ALL other packages
do this.
Comment 8 Jakub Jelinek 2004-10-01 20:22:38 EDT
Why does the spec file need branching?  I really hate unnecessary macros,
this src.rpm is for Fedora Core 3 which has selinux, so it should
be there unconditionally.

Note You need to log in before you can comment on or make changes to this bug.