Bug 52871 - ar generates bad name for temporary file when creating ar archive using mri-script
Summary: ar generates bad name for temporary file when creating ar archive using mri-s...
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: binutils (Show other bugs)
(Show other bugs)
Version: 7.1
Hardware: i686 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL: http://sources.redhat.com/ml/bug-binu...
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-30 09:07 UTC by seiki
Modified: 2007-04-18 16:36 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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.


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