Fix file saving issues in scurl wrappers

Information

ID: 899
PHID: PHID-TASK-psxb3feaho4bgcyqbptm
Author: Xavier
Status at Migration Time: resolved
Priority at Migration Time: Normal

Description

{icon info-circle color=lightbluetext} //Forum topic with details: scurl - secure curl wrapper //

A few fixes are needed for scurl wrappers to use them in many regular cases.


(NOTE) {icon github color=blue} Pull request: https://github.com/Whonix/scurl/pull/1

  • Fix main scurl wrapper:
    • {icon share-square color=lightbluetext} Remove --remote-name to avoid forced saving to file and restore vanilla behavior of writing to stdout instead
      • this flag breaks correct scurl usage in place of curl
      • download wrappers were already added for saving to file
  • Improve download wrappers:
    • {icon share-square color=lightbluetext} Replace --remote-name with --remote-name-all
      • allows to download multiple URLs at once and auto-save all of them to files with extracted names
      • allows to explicitly specify filename (-o filename) for any URL, or prevent saving to file but write to stdout instead (-o - or --no-remote-name)
        • Attention: the order of naming options and URLs doesn’t matter, the first option is for the first URL and so on, so e.g. to override filename for 3rd URL only, user must specify auto-saving of first 2: -O -O -o -
    • {icon share-square color=lightbluetext} Add --remote-header-name
      • curl will try to get server-specified filename from Content-Disposition response header, otherwise extract it from URL the usual way — allows to download and auto-save dynamically generated files, different files from the same common URL, etc.

(WARNING) {icon question-circle color=orange} Whonix developers decision is needed

  • Consider renaming curl-download / scurl-download wrappers, or adding symlinks with short and simple names for convenience of regular users (to use as a replacement for wget):
    • curld / scurld
    • curlget / scurlget
    • durl / sdurl
    • etc.

Comments


Patrick

2019-04-12 15:25:20 UTC