Bug 1044 - --enable-static-nss does not support nsswitch "compat"
Summary: --enable-static-nss does not support nsswitch "compat"
Status: RESOLVED WONTFIX
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.5
: P2 minor
Target Milestone: ---
Assignee: GOTO Masanori
URL:
Keywords:
Depends on:
Blocks: 1045
  Show dependency treegraph
 
Reported: 2005-07-03 10:20 UTC by Jan Kratochvil
Modified: 2005-09-22 18:33 UTC (History)
1 user (show)

See Also:
Host: i386-redhat-linux-gnu
Target: i386-redhat-linux-gnu
Build: i386-redhat-linux-gnu
Last reconfirmed:


Attachments
Fixed substitution "compat"->"files" if: --enable-static-nss (416 bytes, patch)
2005-07-03 10:22 UTC, Jan Kratochvil
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2005-07-03 10:20:48 UTC
libc/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.

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"

Patch is intended for vendor-indepent fully static binaries (such as the ones
provided by MySQL).

Originally improperly posted (with broken patch) as:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=111827
Comment 1 Jan Kratochvil 2005-07-03 10:22:20 UTC
Created attachment 535 [details]
Fixed substitution "compat"->"files" if: --enable-static-nss
Comment 2 Ulrich Drepper 2005-09-22 18:33:00 UTC
No way.  static nss is only meant for the initial porting and will never provide
the same functionality as the real nss.