Bug 694915

Summary: filename quoting problem in livecd-iso-to-disk
Product: [Fedora] Fedora Reporter: cam <camilo>
Component: livecd-toolsAssignee: Brian Lane <bcl>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: adam.stokes, bcling, bcl, bruno, dhuff, Jasper.Hartline, katzj, stephent98, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: livecd-tools-17.0-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-11 23:38:58 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
patch for livecd-iso-to-disk to quote $ISO in case it has unusual characters
none
f15 branch version of the patch
none
Patch for master branch none

Description cam 2011-04-08 20:32:05 UTC
Description of problem:
After downloading an iso with the same name as a previous one, the browser often saves the file with a space and brackets in the new filename, eg.

"/home/cxm/Downloads/Fedora-15-Beta-i686-Live-Desktop (1).iso"

This foxes livecd-iso-to-disk:

/usr/bin/livecd-iso-to-disk: line 576: [: /home/cxm/Downloads/Fedora-15-Beta-i686-Live-Desktop: binary operator expected
/usr/bin/livecd-iso-to-disk: line 578: [: /home/cxm/Downloads/Fedora-15-Beta-i686-Live-Desktop: binary operator expected
/home/cxm/Downloads/Fedora-15-Beta-i686-Live-Desktop (1).iso is not a file or block device.




Version-Release number of selected component (if applicable):
livecd-tools-14.2-1.fc14.i686


How reproducible:
100%

Steps to Reproduce:
1. Normal command line with escaped special characters, ie
livecd-iso-to-disk /home/cxm/Downloads/Fedora-15-Beta-i686-Live-Desktop\ \(1\).iso /dev/sdb1
  
Actual results:
Errors as above

Expected results:
Normal operation with filenames even if they are browser mangled

Additional info:
Browser was Chrome.

Comment 1 Steve Tyler 2011-04-08 21:41:04 UTC
(In reply to comment #0)
> Description of problem:
> After downloading an iso with the same name as a previous one, the browser
> often saves the file with a space and brackets in the new filename, eg.
...

I used do try to do this too.
My workaround is to create separate directories for each of the candidates, which eliminates naming conflicts.

$ ls -F fedora/F14/
F14-Alpha/  F14-Beta-RC1/  F14-Beta-RC2/  F14-Beta-RC3/  F14-Final-RC1/

Comment 2 cam 2011-04-08 22:55:57 UTC
(In reply to comment #1)
[...]
> My workaround is to create separate directories for each of the candidates,
> which eliminates naming conflicts.

Renaming the file also works around the problem, although we should probably fix the bug anyway. I didn't realise it was just a bash script, I will attach a patch that attempts to fix the problem.

Comment 3 cam 2011-04-08 22:58:10 UTC
Created attachment 490882 [details]
patch for livecd-iso-to-disk to quote $ISO in case it has unusual characters

I tried this with the filename that caused the bug and the disk was written correctly.

Comment 4 Bruno Wolff III 2011-04-09 01:02:47 UTC
Note that this patch doesn't apply against current upstream since most references to $ISO are now $SRC. I am not sure if that change is going to make it to F14 or not. If not I don't see a problem with doing two patches. F14 has enough life left, and the fix is simple enough, that I think its worth doing.

Comment 5 Bruno Wolff III 2011-04-09 01:11:10 UTC
Created attachment 490901 [details]
f15 branch version of the patch

I have made an f15 branch version of the patch. I didn't check, but likely this would work for the master branch as well.

Comment 6 Bruno Wolff III 2011-04-09 01:18:43 UTC
I looked at master now and the patch probably won't apply cleanly. So I'll look at making one for master as well.

Comment 7 Bruno Wolff III 2011-04-09 01:26:40 UTC
Created attachment 490903 [details]
Patch for master branch

There is now a patch for master as well. I didn't actually test either of my two patches yet. But I can do some testing and get these applied if I get some agreement for another developer that this is a good way to go.

Comment 8 Bruno Wolff III 2011-05-03 05:22:14 UTC
*** Bug 698070 has been marked as a duplicate of this bug. ***

Comment 9 Brian Lane 2011-08-11 21:52:09 UTC
*** Bug 715262 has been marked as a duplicate of this bug. ***