bugGNU Octave - Bugs: bug #40274, unpack error on failure to move...

 
 

bug #40274: unpack error on failure to move files into destination dir

Submitter:  Muhali <muhali>
Submitted:  Tue 15 Oct 2013 08:45:10 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 25 Nov 2015 07:35:13 PM UTC, comment #10: 

Okay, I added a change here which appears to fix the unpack issue (http://hg.savannah.gnu.org/hgweb/octave/rev/46b15c018fa5).  At this point, both tar.gz and gz archives extracted through URLs to /tmp seem to work.  The examples I used were


unpack("ftp://ftp.gnu.org/gnu/bc/bc-1.03.tar.gz", "/tmp")
unpack("http://mirrors.ctan.org/support/tex2rtf/rtfutils/rtftohtml/README.gz", "/tmp")



Rik <rik5>
Group administrator
Wed 25 Nov 2015 03:26:32 PM UTC, comment #9: 

Unpacking a tar from a URL works for me. Unpacking a compressed file as in the original comment leaves it as a "oct-XXXXXX" file, is that correct?

Mike Miller <mtmiller>
Group Member
Tue 24 Nov 2015 08:25:29 PM UTC, comment #8: 

Actually, could someone else check?  Everything seems to work okay now for


unpack("ftp://ftp.gnu.org/gnu/bc/bc-1.03.tar.gz", "/tmp")



Rik <rik5>
Group administrator
Tue 24 Nov 2015 07:55:56 PM UTC, comment #7: 

I fixed bug #46504.

Now when I attempt to unpack one of the URL examples from this bug report into '/tmp' I end up with the file in a temporary name.  For example, "oct-4mSrub.tar.gz" instead of "bc-1.03.tar.gz.

Rik <rik5>
Group administrator
Tue 24 Nov 2015 07:14:07 PM UTC, comment #6: 

see bug #46504. The reason is the call to glob that was added recently (and which does not work for urls).

Muhali <muhali>
Sat 21 Nov 2015 03:42:50 PM UTC, comment #5: 

Is this bug relevant anymore?  I tried the command in question and I now get a "file not found" error from Octave.  Apparently http and ftp files are no longer accepted directly into unpack, only real files on a local filesystem.

Rik <rik5>
Group administrator
Tue 22 Oct 2013 01:47:19 AM UTC, comment #4: 

Confirmed in two cases. First, your case where you are unpacking from a URL string into /tmp. This is because the URL is first saved to a temporary file in /tmp and then the unpack function fails to recognize that the file is already in /tmp so it doesn't need to be moved.

The other case is when an absolute or relative path are given to a file to unpack and the destination directory is actually the same path.

There is logic in the function already to try to figure out when it needs to move files or not, but that only works if the first argument is a plain file with no path component.

Mike Miller <mtmiller>
Group Member
Tue 15 Oct 2013 11:37:59 AM UTC, comment #3: 

well, savannah does not like my quoted text. Here it is unquoted:

unpack("http://mirrors.ctan.org/support/tex2rtf/rtfutils/rtftohtml/README.gz", "/tmp")

Muhali <muhali>
Tue 15 Oct 2013 11:34:55 AM UTC, comment #2: 

one more time:


unpack("http://mirrors.ctan.org/support/tex2rtf/rtfutils/rtftohtml/README.gz", "/tmp")


Muhali <muhali>
Tue 15 Oct 2013 11:32:33 AM UTC, comment #1: 

Sorry, the first command was meant to be


unpack("http://mirrors.ctan.org/support/tex2rtf/rtfutils/rtftohtml/README.gz", "/tmp")
+verbatim+

Muhali <muhali>
Tue 15 Oct 2013 08:45:10 AM UTC, original submission:  

unpacking into /tmp produces the following:


unpack("http://mirrors.ctan.org/support/tex2rtf/rtfutils/rtftohtml/README.gz", "/tmp")


mv: `/tmp/oct-WqCcGr' and `/tmp/oct-WqCcGr' are the same file
error: unpack: unable to move files to "/tmp":
error: called from:
error:   /usr/local/share/octave/3.7.7+/m/miscellaneous/unpack.m at line 207, column 9

Corresponding errors occur with unpacking tar files. For example,


unpack("ftp://ftp.gnu.org/gnu/bc/bc-1.03.tar.gz", "/tmp")


just produces a copy of bc-1.03.tar.gz in /tmp. In contrast,


unpack("ftp://ftp.gnu.org/gnu/bc/bc-1.03.tar.gz", "/tmp/foo")


does extract into /tmp/foo.

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-26 rik5 Open/ClosedOpen Closed
    2015-11-25 rik5 StatusReady For Test Fixed
    2015-11-24 rik5 StatusConfirmed Ready For Test
    2015-11-24 rik5 StatusNeed Info Confirmed
    2015-11-21 rik5 StatusConfirmed Need Info
    2013-10-22 mtmiller CategoryNone Octave Function
        Item GroupNone Incorrect Result
        StatusNone Confirmed
        Summaryunpack into /tmp name clash unpack error on failure to move files into destination dir

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code