Bug 139460

Summary: RPM fails to package soft links.
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: nobody+pnasrat, redhatbugs, tim.nelson
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-16 13:05:53 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:
Attachments:
Description Flags
SPEC file to demonstrate the bug. none

Description Sam Varshavchik 2004-11-16 03:22:04 UTC
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:

Always

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-16 03:23:00 UTC
Created attachment 106782 [details]
SPEC file to demonstrate the bug.

rpmbuild -bb barf.spec

Comment 2 Jeff Johnson 2004-11-16 13:05:53 UTC
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-08 01:23:57 UTC
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 14:25:56 UTC
I'm also still seeing this issue trying to build RPMs on an rhel3
update 4 machine.

Comment 5 Tim Nelson 2005-04-06 23:40:27 UTC
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-07 00:21:00 UTC
Since no-one else mentioned it, see bug #144587

Comment 7 Paul Nasrat 2005-04-07 07:52:15 UTC
Internal glob will be in U5 - see bug #134362

Comment 8 Sam Varshavchik 2005-04-07 12:23:36 UTC
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 23:06:53 UTC
They already have an internal glob function that they're using for other things;
this just means that they're using it everywhere.