Bug 139460 - RPM fails to package soft links.
RPM fails to package soft links.
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2004-11-15 22:22 EST by Sam Varshavchik
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-16 08:05:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
SPEC file to demonstrate the bug. (671 bytes, text/plain)
2004-11-15 22:23 EST, Sam Varshavchik
no flags Details

  None (edit)
Description Sam Varshavchik 2004-11-15 22:22:04 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

How reproducible:


Steps to Reproduce:

rpm -bb barf.spec # Attachment
Actual results:

RPM craps out with

error: File not found by glob: /var/tmp/barf-1-1-root/usr/bin/*

Additional info:

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
glob: /var/tmp/barf-1-1-root/usr/bin/*
) = 57
write(1, "\n\nRPM build errors:\n", 20

RPM should be using _lstat_, not _stat_!!!!!!!!!!!
Comment 1 Sam Varshavchik 2004-11-15 22:23:00 EST
Created attachment 106782 [details]
SPEC file to demonstrate the bug.

rpmbuild -bb barf.spec
Comment 2 Jeff Johnson 2004-11-16 08:05:53 EST
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
internal glob.

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

Comment 3 Zenon Panoussis 2005-01-07 20:23:57 EST
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?
Comment 4 Adam C. Greenfield 2005-01-21 09:25:56 EST
I'm also still seeing this issue trying to build RPMs on an rhel3
update 4 machine.
Comment 5 Tim Nelson 2005-04-06 19:40:27 EDT
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?  
Comment 6 Tim Nelson 2005-04-06 20:21:00 EDT
Since no-one else mentioned it, see bug #144587
Comment 7 Paul Nasrat 2005-04-07 03:52:15 EDT
Internal glob will be in U5 - see bug #134362
Comment 8 Sam Varshavchik 2005-04-07 08:23:36 EDT
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().
Comment 9 Tim Nelson 2005-04-07 19:06:53 EDT
They already have an internal glob function that they're using for other things;
this just means that they're using it everywhere.  

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