Red Hat Bugzilla – Bug 139460
RPM fails to package soft links.
Last modified: 2007-11-30 17:10:54 EST
Description of problem:
RPM fails to create a simple package containing:
/usr/share/foo - a dummy shell script
/usr/bin/foo - a soft link to /usr/share/foo
Steps to Reproduce:
rpm -bb barf.spec # Attachment
RPM craps out with
error: File not found by glob: /var/tmp/barf-1-1-root/usr/bin/*
The problem is shown by strace:
getdents64(3, /* 3 entries */, 4096) = 72
stat64("/var/tmp/barf-1-1-root/usr/bin/foo", 0xfeea28b0) = -1 ENOENT
(No such file or directory)
getdents64(3, /* 0 entries */, 4096) = 0
close(3) = 0
write(2, "error: ", 7error: ) = 7
write(2, "File not found by glob: /var/tmp"..., 57File not found by
) = 57
write(1, "\n\nRPM build errors:\n", 20
RPM should be using _lstat_, not _stat_!!!!!!!!!!!
Created attachment 106782 [details]
SPEC file to demonstrate the bug.
rpmbuild -bb barf.spec
glibc has changed glob in order to fix a problem. Unfortunately,
that breaks rpm.
You need a vrsion of rpm that is compiled with internal
glob. Recent (like last 2 months) builds of rpm have
Alternatively, you need to specify symlinks explicitly,
not with a glob.
Your spec file builds for me:
$ rpm -qlvp barf-1-1.i386.rpm
lrwxrwxrwx 1 root root 14 Nov 16 08:03
/usr/bin/foo -> /usr/share/foo
-rwxr-xr-x 1 root root 18 Nov 16 08:03 /usr/share/foo
After U4 I am now seeing the same problem on RHEL3. The two topmost entries in
the FC2 rpm-4.3.1-0.4.1 .spec would probably fix this for RHEL too.
Will the bug owner please change the product and version of the bug and reopen it?
I'm also still seeing this issue trying to build RPMs on an rhel3
update 4 machine.
I'm seeing this too. Can we at least get the changes made to the bug so that
other people with this problem will be able to find it?
Since no-one else mentioned it, see bug #144587
Internal glob will be in U5 - see bug #134362
I don't think an internal glob is needed.
Set the GLOB_ALTDIRFUNC flag, then set both gl_stat and gl_lstat to invoke lstat().
They already have an internal glob function that they're using for other things;
this just means that they're using it everywhere.