Bug 111827

Summary: --enable-static-nss does not support nsswitch "compat"
Product: [Retired] Red Hat Linux Reporter: Jan Kratochvil <jan>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: fweimer
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-27 15:53:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch translating "compat" to "files" for libc.a in --enable-static-nss case (where no "compat" is supported anyway). none

Description Jan Kratochvil 2003-12-10 17:27:21 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701

Description of problem:
glibc/configure --enable-static-nss
and program compiled using "-static" (->.a) currently supports
/etc/nsswitch.conf fields "files" and "dns". It does not support "compat".

Some distributions such as VectorLinux define "compat" for "passwd"
and "group" nsswitch items. getpwuid(2) etc. fails there for
--enable-static-nss built binaries.

I am not aware of any incompatibilities brought by this patch.
Sure the "nis" part of "compat" feature is still missing if
--enable-static-nss.


Version-Release number of selected component (if applicable):
glibc-2.3.2-27.9.7

How reproducible:
Always

Steps to Reproduce:
1. /etc/nsswitch.conf: passwd: compat
2. glibc/configure --enable-static-nss
3. echo 'getpwuid(0);' >>program.c
4. gcc -static -o program program.c


Actual Results:  ./program getpwuid(0) returns NULL


Expected Results:  ./program getpwuid(0) returns "root"


Additional info:

Comment 1 Jan Kratochvil 2003-12-10 17:28:37 UTC
Created attachment 96447 [details]
Patch translating "compat" to "files" for libc.a in --enable-static-nss case (where no "compat" is supported anyway).

Comment 2 Jakub Jelinek 2003-12-27 15:53:56 UTC
Why have you filed this bug against RHL9 though?
We don't ship glibc built with --enable-static-nss, nor recommend it in any way
(that option is solely for glibc bootstrapping purposes).
And for bootstrapping purposes you can easily edit your nsswitch.conf.

Comment 3 Jan Kratochvil 2003-12-27 16:02:16 UTC
I use --enable-static-nss rebuilt glibc to build Linux distribution
independent fully-static binaries of a product on RHL9 build host.
You can consider this patch as RFE instead.
I do not mind the patch import, my separate patch is OK for my purposes.