Bug 111827 - --enable-static-nss does not support nsswitch "compat"
--enable-static-nss does not support nsswitch "compat"
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-12-10 12:27 EST by Jan Kratochvil
Modified: 2016-11-24 10:13 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-12-27 10:53:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch translating "compat" to "files" for libc.a in --enable-static-nss case (where no "compat" is supported anyway). (766 bytes, patch)
2003-12-10 12:28 EST, Jan Kratochvil
no flags Details | Diff

  None (edit)
Description Jan Kratochvil 2003-12-10 12:27:21 EST
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

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

How reproducible:

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 12:28:37 EST
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 10:53:56 EST
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 11:02:16 EST
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.

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