TRAMP's Customs agents open up our .gz luggage and forget...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

TRAMP's Customs agents open up our .gz luggage and forget...

積丹尼 Dan Jacobson
Today I discovered,
let's say one has, on their cellphone,
  /adb::/sdcard/osmtracker:
  -rw-rw----  1 root sdcard_rw 3606065 2018-06-25  N
  -rw-rw----  1 root sdcard_rw 3606065 2018-06-25  OSMTracker.sqlitedb.gz
and uses
C runs the command dired-do-copy
to copy them to /tmp , one their computer.

Well, here's what the result is:
  /tmp:
  -rw-rw----  1 jidanni 3606065 2018-06-25  N
  -rw-------  1 jidanni 9449472 2018-06-25  OSMTracker.sqlitedb.gz

That's right. TRAMP, sniffing the ".gz" from the filename, uncompresses
the file, copies it, (then forgets to recompress it,) but still adds the
".gz" back on.

If one wants such files to cross intact, the user had better remove any
".gz" from their filenames.

Actually wouldn't it be better for TRAMP, to not attempt to uncompress
when copying files in the first place, just like it did when we sent the
same file, calling it "N", to keep TRAMP's Customs agents from opening
up our luggage and (so enthralled by our multicolored underwear, forget
to put everything back in place, hence revealing this bug.) Really, we
are not intending to browse the file, just transfer it. So certainly
TRAMP should do like the FTP command did, and switch into pure binary
mode.

emacs-version "27.1"
tramp-version "2.4.3.27.1"
My dot files are all public at
https://www.jidanni.org/comp/configuration/

Same problem happens with
R runs the command dired-do-rename

Renaming /adb::/sdcard/OSMTracker.sqlitedb.gz to /tmp/OSMTracker.sqlitedb.gz...
Copying /adb::/sdcard/OSMTracker.sqlitedb.gz to /tmp/OSMTracker.sqlitedb.gz...
Tramp: Fetching /adb::/sdcard/OSMTracker.sqlitedb.gz to tmp file /tmp/tramp.XHky2i.gz...done
uncompressing OSMTracker.sqlitedb.gz...done
Copying /adb::/sdcard/OSMTracker.sqlitedb.gz to /tmp/OSMTracker.sqlitedb.gz...done
Renaming /adb::/sdcard/OSMTracker.sqlitedb.gz to /tmp/OSMTracker.sqlitedb.gz...done
Move: 1 of 1
Move: 1 file done

It only says uncompressing. I.e., it never recompresses it. However it
slaps the ".gz" back on anyway.

Reply | Threaded
Open this post in threaded view
|

Re: TRAMP's Customs agents open up our .gz luggage and forget...

Michael Albinus
積丹尼 Dan Jacobson <[hidden email]> writes:

Hi Dan,

> Actually wouldn't it be better for TRAMP, to not attempt to uncompress
> when copying files in the first place, just like it did when we sent the
> same file, calling it "N", to keep TRAMP's Customs agents from opening
> up our luggage and (so enthralled by our multicolored underwear, forget
> to put everything back in place, hence revealing this bug.) Really, we
> are not intending to browse the file, just transfer it. So certainly
> TRAMP should do like the FTP command did, and switch into pure binary
> mode.
>
> Same problem happens with
> R runs the command dired-do-rename
Thanks for the report, there is an error, indeed. The appended patch
fixes it. It is on top of Tramp 2.5.1-pre, but I guess the patch applies
also on your Tramp 2.4.

Will be included in Tramp 2.5.0.1, which I plan to release end of this
week via GNU ELPA.

Best regards, Michael.


attachment0 (1K) Download Attachment