Bug 33580

Summary: LPRng does not work after krb5 update
Product: [Retired] Red Hat Linux Reporter: Hermann Schichl <hermann.schichl>
Component: krb5Assignee: Nalin Dahyabhai <nalin>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: bbaetz, benito, bob, christof, cmmiller, dmerrill, fbuehlmann, klmitch, leon, marc.schmitt, mscampbe, nigel, pdurst, ralston, sefreeman, tobias
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-04-02 17:19:20 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:

Description Hermann Schichl 2001-03-28 07:55:36 UTC
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 08:11:38 UTC
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 16:41:38 UTC
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 16:43:05 UTC
*** Bug 33592 has been marked as a duplicate of this bug. ***

Comment 4 Bill Nottingham 2001-03-28 17:18:51 UTC
*** Bug 33591 has been marked as a duplicate of this bug. ***

Comment 5 Nalin Dahyabhai 2001-03-28 22:34:50 UTC
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 23:17:27 UTC
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 23:20:48 UTC
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 23:57:23 UTC
*** Bug 33689 has been marked as a duplicate of this bug. ***

Comment 9 Jeremy Katz 2001-03-29 00:01:56 UTC
*** Bug 33709 has been marked as a duplicate of this bug. ***

Comment 10 Jeremy Katz 2001-03-29 02:48:00 UTC
*** Bug 33731 has been marked as a duplicate of this bug. ***

Comment 11 Bill Nottingham 2001-03-29 03:09:05 UTC
*** Bug 33670 has been marked as a duplicate of this bug. ***

Comment 12 Jeremy Katz 2001-03-29 04:21:00 UTC
*** Bug 33736 has been marked as a duplicate of this bug. ***

Comment 13 Daniel Roesen 2001-03-29 14:15:24 UTC
*** Bug 33809 has been marked as a duplicate of this bug. ***

Comment 14 Daniel Roesen 2001-03-29 14:16:24 UTC
*** Bug 33809 has been marked as a duplicate of this bug. ***

Comment 15 Bill Nottingham 2001-03-29 15:57:21 UTC
*** Bug 33748 has been marked as a duplicate of this bug. ***

Comment 16 Jeremy Katz 2001-03-29 19:10:05 UTC
*** Bug 33911 has been marked as a duplicate of this bug. ***

Comment 17 Bill Nottingham 2001-03-29 22:27:09 UTC
*** Bug 33971 has been marked as a duplicate of this bug. ***

Comment 18 Jeremy Katz 2001-03-30 01:57:55 UTC
*** Bug 33974 has been marked as a duplicate of this bug. ***

Comment 19 Jeremy Katz 2001-03-30 06:36:12 UTC
*** Bug 34008 has been marked as a duplicate of this bug. ***

Comment 20 Jeremy Katz 2001-03-30 06:36:48 UTC
*** Bug 34009 has been marked as a duplicate of this bug. ***

Comment 21 Jeremy Katz 2001-03-30 18:29:17 UTC
*** Bug 34060 has been marked as a duplicate of this bug. ***

Comment 22 Jeremy Katz 2001-03-30 18:32:20 UTC
*** Bug 34089 has been marked as a duplicate of this bug. ***

Comment 23 Jeremy Katz 2001-03-30 19:15:59 UTC
*** Bug 34129 has been marked as a duplicate of this bug. ***

Comment 24 Jeremy Katz 2001-03-30 20:36:51 UTC
*** Bug 34149 has been marked as a duplicate of this bug. ***

Comment 25 Jeremy Katz 2001-03-30 21:19:19 UTC
*** Bug 34169 has been marked as a duplicate of this bug. ***

Comment 26 Jeremy Katz 2001-03-31 02:21:36 UTC
*** Bug 34177 has been marked as a duplicate of this bug. ***

Comment 27 Jeremy Katz 2001-04-02 17:19:17 UTC
*** Bug 34323 has been marked as a duplicate of this bug. ***