Bug 52871

Summary: ar generates bad name for temporary file when creating ar archive using mri-script
Product: [Retired] Red Hat Linux Reporter: seiki
Component: binutilsAssignee: Jakub Jelinek <jakub>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
URL: http://sources.redhat.com/ml/bug-binutils/2001-q3/msg00017.html
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 19:41:46 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 seiki 2001-08-30 09:07:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; NetCaptor 
6.5.0B7)

Description of problem:
The 'ar' command prepend 'tmp-' prefix for name of temporary file when 
creating archive using CREATE command of mri-script ('-M' option).
'echo CREATE ../../test.a | ar -M' produce error message '


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


How reproducible:
Always

Steps to Reproduce:
1. 'echo CREATE /tmp/test.a | ar -M'


Actual Results:  Error Message: Can't open output archive tmp-/tmp/test.a


Expected Results:  create an empty archive '/tmp/test.a' silently


Additional info:

function 'ar_open()' in arsup.c is problematic.
should prepend 'tmp-' prefix to base name of path name.
patch at the attached URL does not work when path name contains more than 
single path separator ('/' or '\').

Comment 1 seiki 2001-08-30 09:24:00 UTC
Expected Results was not correct: '/tmp/test.a' will not be created


Comment 2 Jakub Jelinek 2001-10-18 09:38:54 UTC
See http://sources.redhat.com/ml/binutils/2001-10/msg00337.html
BTW: If you want to create empty /tmp/test.a archive, you need to do:
echo -e 'CREATE /tmp/test.a\nSAVE' | ar -M
(SAVE is important).

Comment 3 seiki 2002-08-08 06:14:46 UTC
Not resolved in 7.2 either

Comment 4 Jakub Jelinek 2004-10-02 19:41:46 UTC
echo -e 'CREATE /tmp/test.a\nSAVE' | ar -M
definitely works in current binutils, and as mentioned above
without SAVE the command doesn't write any output.