Bug 178782

Summary: 'rename' in spec file causes build failure when username contains 'rand' or 'passwd'
Product: [Fedora] Fedora Reporter: Rob Andrews <rob>
Component: opensslAssignee: Tomas Mraz <tmraz>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: medium    
Version: rawhide   
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: 2006-08-07 15:42:01 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 Rob Andrews 2006-01-24 12:22:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

Description of problem:
A brief explanation.

I am building the openssl RPM from Fedora on a RHEL 4ES box. So it's not a bug in the Fedora OpenSSL RPM per se.
I have an .rpmmacros file reading:

%_topdir                /home/randrews/redhat
%_tmppath               /home/randrews/redhat/TEMP

Hence I build all of my RPMs as the user 'randrews'.

Whilst trying to build the openssl-0.9.8a-5 RPM, I received the message:

+ for conflict in passwd rand
+ rename passwd sslpasswd /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/passwd.1ssl
+ for conflict in passwd rand
+ rename rand sslrand /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/rand.1ssl /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man3/rand.3ssl
rename: renaming /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/rand.1ssl to /home/sslrandrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/rand.1ssl failed: No such file or directory
error: Bad exit status from /home/randrews/redhat/TEMP/rpm-tmp.52746 (%install)

This is because it's trying to rename my username "randrews" to "sslrandrews" too early on in the path.

Upon inspecting the openssl.spec, I found the block:

for conflict in passwd rand ; do
       rename ${conflict} ssl${conflict} $RPM_BUILD_ROOT%{_mandir}/man*/${conflict}*
done

Now, this fails for 'randrews', but would also fail for a username of 'passwd*something*' (highly unlikely, I know, but possible).

I have changed this to:

for conflict in passwd rand ; do
        eval `find $RPM_BUILD_ROOT%{_mandir}/man*/ \
                -name ${conflict}* \
                -printf "mv -v '%h/%f' '%h/ssl%f' ;"`
done

Which correctly renames the rand.1ssl/passwd.1ssl files to sslrand.1ssl/sslpasswd.1ssl respectively.

This will only affect users whose usernames have 'rand' or 'passwd' in them (most likely at the beginning) build RPMs in their home directory. If you choose not to accept this change, that's fine!

Version-Release number of selected component (if applicable):
0.9.8a-5

How reproducible:
Always

Steps to Reproduce:
1. Fetch the openssl-0.9.8a-5 SRPM.
2. Install it with .rpmmacros to build in the home directory of a user of 'rand<something>'.
3. rpmbuild --rebuild/rpmbuild -bb the package.


Actual Results:  RPM build failed with:
+ for conflict in passwd rand
+ rename passwd sslpasswd /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/passwd.1ssl
+ for conflict in passwd rand
+ rename rand sslrand /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/rand.1ssl /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man3/rand.3ssl
rename: renaming /home/randrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/rand.1ssl to /home/sslrandrews/redhat/TEMP/openssl-0.9.8a-root/usr/share/man/man1/rand.1ssl failed: No such file or directory
error: Bad exit status from /home/randrews/redhat/TEMP/rpm-tmp.52746 (%install)

Expected Results:  It should have successfully built an RPM.

Additional info:

Comment 1 Rob Andrews 2006-01-24 13:52:06 UTC
Also affects the build of package openssl097a 0.9.7a-4.1.

Comment 2 Tomas Mraz 2006-01-24 14:26:09 UTC
I used a different approach - pushd to the $RPM_BUILD_ROOT%{_mandir} first.

Fixed packages will be built when there will be more fixes done.