Red Hat Bugzilla – Bug 129946
[PATCH] nscd selinux addition breaks compile
Last modified: 2007-11-30 17:10:47 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.4.2)
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):
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.
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
This last one goes down with the rest of the BuildRequires.
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.
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.
Created attachment 104651 [details]
revised patch for the -60 release
Can you explain why do you need that?
# 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
nscd-modules += selinux
selinux-LIBS := -lselinux
which means that selinux.c is not compiled when HAVE_SELINUX is not
defined and the other files compile just fine too.
Created attachment 104652 [details]
patch for the specfile
This patch adjusts the specfile so that it optionally includes the SELINUX
requirements. Please apply.
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
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.