Bug 33580 - LPRng does not work after krb5 update
LPRng does not work after krb5 update
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: krb5 (Show other bugs)
7.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Nalin Dahyabhai
Brian Brock
:
: 33591 33592 33670 33689 33709 33731 33736 33748 33809 33911 33971 33974 34008 34009 34060 34089 34129 34149 34169 34177 34323 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-28 02:55 EST by Hermann Schichl
Modified: 2005-10-31 17:00 EST (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-02 13:19:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Hermann Schichl 2001-03-28 02:55:36 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.17-14 i686)


After upgrading the krb5 package, all LPRng tools stop working.
They report:
    lpr: error while loading shared libraries: lpr: undefined symbol: stat

Reproducible: Always
Steps to Reproduce:
1. update krb5 package
2. call e.g. lpr /etc/hosts

	

Actual Results:  lpr reports the following error:
   lpr: error while loading shared libraries: lpr: undefined symbol: stat

Expected Results:  lpr should have printed the contents of /etc/hosts

Workaround: do not upgrade the krb5-libs package.
Not upgrading might result in a security problem, however.
Comment 1 Z.J.T. Elstgeest 2001-03-28 03:11:38 EST
recompiling the lpr 3.6.24-2 rpm from the source rpm after installing the krb5 
update resolves the problem
Comment 2 Gerald Teschl 2001-03-28 11:41:38 EST
Other programs are affected as well and need to be recompiled against the new 
libs. An (incomplete) list is
[gerald@keen gerald]$ rpm -q --whatrequires  krb5-libs
cvs-1.10.8-8
LPRng-3.6.24-2
pine-4.30-2
fetchmail-5.5.0-3
mutt-1.2.5i-8.7
Comment 3 Gerald Teschl 2001-03-28 11:43:05 EST
*** Bug 33592 has been marked as a duplicate of this bug. ***
Comment 4 Bill Nottingham 2001-03-28 12:18:51 EST
*** Bug 33591 has been marked as a duplicate of this bug. ***
Comment 5 Nalin Dahyabhai 2001-03-28 17:34:50 EST
This is a linkage problem that, ironically, the errata fixed.  The cvs binary
actually checks out and commits files correctly, so I'm fairly certain that it
is not affected.  Likewise, Mutt is able to attach files to outgoing mail, and
fetchmail also appears unaffected.  Pine and LPRng, however are going to require
bugfix erratas to correct them.
Comment 6 James Ralston 2001-03-28 18:17:27 EST
The errata didn't fix the linkage problem; the errata just
demonstrated it.  :p

This is the problem:

$ rpm -q krb5-libs
krb5-libs-1.2.1-8

$ nm -a libkrb5.so.3 | grep -i stat
0005e688 T __fstat
         U __fxstat@@GLIBC_2.0
0005e660 T __stat
         U __xstat@@GLIBC_2.0
0005e688 W fstat
0005c198 t parse_init_state
0005e660 W stat

$ rpm -q krb5-libs
krb5-libs-1.2.2-3

$ nm -a libkrb5.so.3 | grep -i stat
         U __fxstat@@GLIBC_2.0
         U __xstat@@GLIBC_2.0
0004c4d0 t parse_init_state

The libkrb5.so.3 from krb5-libs-1.2.1-8 contained stat and fstat
functions (which are normally just wrappers for the __xstat and
__fxstat functions, respectively).  The libkrb5.so.3 from
krb5-libs-1.2.2-3 doesn't have these functions (more on that below).
Any program compiled and linked against krb5-{devel,libs}-1.2.1-8 will
have picked up stat and fstat as *functions* (provided by
libkrb5.so.3), instead of just treating them as inline expansions.

The result is that any program that was previously linked against
krb5-libs-1.2.1-8 will die when it attempts a stat() or fstat() call
if krb5-libs-1.2.2-3 has replaced krb5-libs-1.2.1-8 on the system.

The reason why stat() and fstat() aren't in the libkrb5.so.3 from
krb5-libs-1.2.1-8 is because of this change in the spec file:

--- krb5.spec.old       Wed Aug 16 15:35:23 2000
+++ krb5.spec   Thu Mar 15 10:51:13 2001
@@ -339 +403,2 @@
-       --with-cc=%{__cc} --with-ccopts="-ggdb" \
+       --with-cc=%{__cc} \
+       --with-ccopts="$RPM_OPT_FLAGS $LOCAL_OPT_FLAGS -fPIC" \

It's the optimization flag that triggers it.  Passing -O1 or greater
to gcc (gcc-2.96-69) causes gcc to inline the expansions of stat and
fstat (__xstat and __fxstat, respectively):

$ pwd
/tmp/RPM/BUILD/krb5-1.2.2/src/lib/krb5/os

$ gcc -DHAVE_STDARG_H=1 -DHAVE_UNISTD_H=1 -DHAVE_PATHS_H=1 -DHAVE_REGEX_H=1
-DHAVE_REGEXP_H=1 -DHAVE_FCNTL_H=1 -DHAVE_FLOCK=1 -DHAVE_FCHMOD=1 -DHAVE_CHMOD=1
-DHAVE_STRFTIME=1 -DHAVE_STRPTIME=1 -DHAVE_GETEUID=1 -DHAVE_SETENV=1
-DHAVE_UNSETENV=1 -DHAVE_GETENV=1 -DHAVE_SETSID=1 -DHAVE_GETHOSTBYNAME2=1
-DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRDUP=1 -DHAVE_STRCASECMP=1
-DHAVE_STRERROR=1 -DHAVE_MEMMOVE=1 -DHAVE_DAEMON=1 -DHAVE_GETUID=1
-DHAVE_SSCANF=1 -DHAVE_SYSLOG=1 -DHAVE_RE_COMP=1 -DHAVE_RE_EXEC=1
-DHAVE_REGEXEC=1 -DHAVE_REGCOMP=1   -DKRB5_KRB4_COMPAT -I../../../include
-I./../../../include -I../../../include/krb5 -I./../../../include/krb5 -c kuserok.c

$ nm -a kuserok.o | grep stat
         U fstat

$ gcc -DHAVE_STDARG_H=1 -DHAVE_UNISTD_H=1 -DHAVE_PATHS_H=1 -DHAVE_REGEX_H=1
-DHAVE_REGEXP_H=1 -DHAVE_FCNTL_H=1 -DHAVE_FLOCK=1 -DHAVE_FCHMOD=1 -DHAVE_CHMOD=1
-DHAVE_STRFTIME=1 -DHAVE_STRPTIME=1 -DHAVE_GETEUID=1 -DHAVE_SETENV=1
-DHAVE_UNSETENV=1 -DHAVE_GETENV=1 -DHAVE_SETSID=1 -DHAVE_GETHOSTBYNAME2=1
-DHAVE_VFPRINTF=1 -DHAVE_VSPRINTF=1 -DHAVE_STRDUP=1 -DHAVE_STRCASECMP=1
-DHAVE_STRERROR=1 -DHAVE_MEMMOVE=1 -DHAVE_DAEMON=1 -DHAVE_GETUID=1
-DHAVE_SSCANF=1 -DHAVE_SYSLOG=1 -DHAVE_RE_COMP=1 -DHAVE_RE_EXEC=1
-DHAVE_REGEXEC=1 -DHAVE_REGCOMP=1   -DKRB5_KRB4_COMPAT -I../../../include
-I./../../../include -I../../../include/krb5 -I./../../../include/krb5 -O1 -c
kuserok.c

$ nm -a kuserok.o | grep stat
         U __fxstat

According to the comments in /usr/include/sys/stat.h
(glibc-devel-2.2-12), if the stat/fstat/lstat functions are not
inlined, they are always statically linked, so the above is correct
behavior.

The fix:

The krb5 package must continue to be compiled without optimization
until all packages compiled against it can be recompiled against a new
version of krb5 that has been compiled with optimization.

--- krb5.spec.1.2.2-3.BROKEN    Thu Mar 15 10:51:13 2001
+++ krb5.spec   Wed Mar 28 17:58:07 2001
@@ -402,5 +402,5 @@
 ./configure \
        --with-cc=%{__cc} \
-       --with-ccopts="$RPM_OPT_FLAGS $LOCAL_OPT_FLAGS -fPIC" \
+       --with-ccopts="-fPIC" \
        --enable-shared --enable-static \
        --prefix=%{prefix} \

The alternative is to individually audit all of these packages for
stat/fstat calls, and ensure that they all function correctly:

$ rpm --redhatrequires libkrb5.so.3
LPRng-3.6.22-5
cvs-1.10.8-8
fetchmail-5.5.0-2
gnome-kerberos-0.2.1-1
imap-4.7c2-12
krb5-devel-1.2.1-8
krb5-libs-1.2.1-8
krb5-server-1.2.1-8
krb5-workstation-1.2.1-8
krbafs-1.0.2-3
krbafs-utils-1.0.2-3
mutt-1.2.5i-3
pam_krb5-1-19
php-imap-4.0.1pl2-9
pine-4.21-23
samba-2.0.7-21ssl
samba-client-2.0.7-21ssl
samba-common-2.0.7-21ssl

(Hopefully the recompilation of everything krb5-related can occur in
time for Red Hat 7.1...)
Comment 7 James Ralston 2001-03-28 18:20:48 EST
BTW, I just rebuilt krb5-1.2.2-3.src.rpm with the above patch applied,
and the resulting krb5-{devel,libs,server,workstation}-1.2.2-3 RPMs
are working fine for me.
Comment 8 Jeremy Katz 2001-03-28 18:57:23 EST
*** Bug 33689 has been marked as a duplicate of this bug. ***
Comment 9 Jeremy Katz 2001-03-28 19:01:56 EST
*** Bug 33709 has been marked as a duplicate of this bug. ***
Comment 10 Jeremy Katz 2001-03-28 21:48:00 EST
*** Bug 33731 has been marked as a duplicate of this bug. ***
Comment 11 Bill Nottingham 2001-03-28 22:09:05 EST
*** Bug 33670 has been marked as a duplicate of this bug. ***
Comment 12 Jeremy Katz 2001-03-28 23:21:00 EST
*** Bug 33736 has been marked as a duplicate of this bug. ***
Comment 13 Daniel Roesen 2001-03-29 09:15:24 EST
*** Bug 33809 has been marked as a duplicate of this bug. ***
Comment 14 Daniel Roesen 2001-03-29 09:16:24 EST
*** Bug 33809 has been marked as a duplicate of this bug. ***
Comment 15 Bill Nottingham 2001-03-29 10:57:21 EST
*** Bug 33748 has been marked as a duplicate of this bug. ***
Comment 16 Jeremy Katz 2001-03-29 14:10:05 EST
*** Bug 33911 has been marked as a duplicate of this bug. ***
Comment 17 Bill Nottingham 2001-03-29 17:27:09 EST
*** Bug 33971 has been marked as a duplicate of this bug. ***
Comment 18 Jeremy Katz 2001-03-29 20:57:55 EST
*** Bug 33974 has been marked as a duplicate of this bug. ***
Comment 19 Jeremy Katz 2001-03-30 01:36:12 EST
*** Bug 34008 has been marked as a duplicate of this bug. ***
Comment 20 Jeremy Katz 2001-03-30 01:36:48 EST
*** Bug 34009 has been marked as a duplicate of this bug. ***
Comment 21 Jeremy Katz 2001-03-30 13:29:17 EST
*** Bug 34060 has been marked as a duplicate of this bug. ***
Comment 22 Jeremy Katz 2001-03-30 13:32:20 EST
*** Bug 34089 has been marked as a duplicate of this bug. ***
Comment 23 Jeremy Katz 2001-03-30 14:15:59 EST
*** Bug 34129 has been marked as a duplicate of this bug. ***
Comment 24 Jeremy Katz 2001-03-30 15:36:51 EST
*** Bug 34149 has been marked as a duplicate of this bug. ***
Comment 25 Jeremy Katz 2001-03-30 16:19:19 EST
*** Bug 34169 has been marked as a duplicate of this bug. ***
Comment 26 Jeremy Katz 2001-03-30 21:21:36 EST
*** Bug 34177 has been marked as a duplicate of this bug. ***
Comment 27 Jeremy Katz 2001-04-02 13:19:17 EDT
*** Bug 34323 has been marked as a duplicate of this bug. ***

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