Bug 129946 - [PATCH] nscd selinux addition breaks compile
Summary: [PATCH] nscd selinux addition breaks compile
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc   
(Show other bugs)
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-08-15 12:34 UTC by Steve Grubb
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-02 00:22:38 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 12:40 UTC, Steve Grubb
no flags Details | Diff
revised patch for the -60 release (2.18 KB, patch)
2004-10-01 21:32 UTC, Steve Grubb
no flags Details | Diff
patch for the specfile (1.71 KB, patch)
2004-10-01 21:48 UTC, Steve Grubb
no flags Details | Diff
Revised patch for spec file (1.24 KB, text/plain)
2004-10-01 22:37 UTC, Steve Grubb
no flags Details

Description Steve Grubb 2004-08-15 12:34:42 UTC
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):

How reproducible:

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 12:40:58 UTC
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

BuildPrereq: libselinux-devel

This last one goes down with the rest of the BuildRequires.

Comment 2 Ulrich Drepper 2004-09-30 09:45:35 UTC
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 21:30:55 UTC
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 21:32:11 UTC
Created attachment 104651 [details]
revised patch for the -60 release

Comment 5 Jakub Jelinek 2004-10-01 21:37:10 UTC
Can you explain why do you need that?
selinux.h has:
# 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

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 21:48:14 UTC
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 22:37:31 UTC
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-02 00:22:38 UTC
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.