search for: safe_arg

Displaying 14 results from an estimated 14 matches for "safe_arg".

Did you mean: safe_args
2016 Jul 07
0
[PATCH v2 2/8] curl: Change the API to use an abstract data type.
Change the Curl module to use an ADT to store the name of the curl binary and the arguments. Also add Curl.safe_args, a list of arguments that control redirects etc. The callers in virt-v2v are changed accordingly. There is also a (currently unused) args_of_proxy function allowing proxy parameters to be set. --- mllib/curl.ml | 48 ++++++++++++++++++++++++++++++----------- mllib/curl.mli | 60 +++...
2024 Mar 18
0
[PATCH] add option to skip files based on age/mtime
..., &max_alloc_arg, 0, 0, 0 }, {"sparse", 'S', POPT_ARG_VAL, &sparse_files, 1, 0, 0 }, {"no-sparse", 0, POPT_ARG_VAL, &sparse_files, 0, 0, 0 }, @@ -2815,6 +2819,16 @@ void server_options(char **args, int *argc_p) args[ac++] = safe_arg("--min-size", min_size_arg); if (max_size >= 0) args[ac++] = safe_arg("--max-size", max_size_arg); + if (min_age > 0) { + if (asprintf(&arg, "--min-age=%d", min_age) < 0) + goto oom; + args[ac++] = arg; + } + if (max_age > 0) { + if...
2016 Jul 07
4
[PATCH 0/3] Move Curl wrapper to mllib and use it for virt-builder.
Move the Curl wrapper module from virt-v2v to mllib. Use the module when virt-builder issues curl calls. Rich.
2016 Jul 07
9
[PATCH v2 0/8] v2v: Move Curl wrapper to mllib and use it for virt-builder (and more).
v1 -> v2: - Fixed the bug with precedence of if / @. - Add some imperative list operators inspired by Perl, and use those for constructing the Curl arguments, and more. Rich.
2016 Jul 07
0
[PATCH v3 2/8] curl: Change the API to use an abstract data type.
...on_utils -type curl_args = (string * string option) list +let quote = Filename.quote -let run curl_args = - let config_file, chan = Filename.open_temp_file "v2vcurl" ".conf" in +type t = { + curl : string; + args : args; +} +and args = (string * string option) list + +let safe_args = [ + "max-redirs", Some "5"; + "globoff", None; (* Don't glob URLs. *) +] + +type proxy = UnsetProxy | SystemProxy | ForcedProxy of string + +let args_of_proxy = function + | UnsetProxy -> [ "proxy", Some "" ; "noproxy&...
2019 Jan 16
0
[PATCH 4/5] mltools: curl: turn Curl.run to raise exceptions
...xy = function | SystemProxy -> [] | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] +exception Curl_failed of (int * string) (* exit code, URL *) + let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args = safe_args @ args_of_proxy proxy @ args in { curl = curl; args = args; tmpdir = tmpdir } @@ -71,8 +73,19 @@ let run { curl; args; tmpdir } = close_out chan; let cmd = sprintf "%s -q --config %s" (quote curl) (quote config_file) in - let lines = external_command ~echo_cmd:false cmd in +...
2023 May 17
1
[PATCH] Add --omit-{device,special}-times options
...args[ac++] = "--size-only"; if (do_stats) args[ac++] = "--stats"; + if (omit_device_times) + args[ac++] = "--omit-device-times"; + if (omit_special_times) + args[ac++] = "--omit-special-times"; } else { if (skip_compress) args[ac++] = safe_arg("--skip-compress", skip_compress); diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/rsync.1.md devel-3.2.7/rsync.1.md --- rsync-3.2.7/rsync.1.md 2022-10-16 13:27:30.000000000 -0600 +++ devel-3.2.7/rsync.1.md 2022-10-16 13:27:30.000000000 -0600 @@ -463,6 +463,8 @@ has its own detailed descr...
2016 Jul 07
0
[PATCH 3/3] builder: Use the new Curl module for passing parameters to curl.
...nd cmd in if r <> 0 then error (f_"cp (download) command failed copying '%s'") path; - | _ as protocol -> (* Any other protocol. *) - let outenv = proxy_envvar protocol proxy in + + (* Any other protocol. *) + | _ -> + let common_args = + Curl.safe_args @ + [ "location", None ] @ (* Follow 3XX redirects. *) + match proxy with + | None (* system proxy settings *) -> [] + | Some proxy -> Curl.args_of_proxy proxy in + + let quiet_args = [ "silent", None; "show-error", None ] in + (* Get...
2016 Oct 25
2
[PATCH v2 1/2] mllib: curl: add optional tmpdir parameter
...function | SystemProxy -> [] | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] -let create ?(curl = "curl") ?(proxy = SystemProxy) args = +let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args = safe_args @ args_of_proxy proxy @ args in - { curl = curl; args = args } + { curl = curl; args = args; tmpdir = tmpdir } -let run { curl = curl; args = args } = - let config_file, chan = Filename.open_temp_file "guestfscurl" ".conf" in +let run { curl = curl; args = args; tmpdir = t...
2016 Oct 24
2
[PATCH 1/2] mllib: curl: add optional tmpdir parameter
...function | SystemProxy -> [] | ForcedProxy url -> [ "proxy", Some url; "noproxy", Some "" ] -let create ?(curl = "curl") ?(proxy = SystemProxy) args = +let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args = safe_args @ args_of_proxy proxy @ args in - { curl = curl; args = args } + { curl = curl; args = args; tmpdir = tmpdir } -let run { curl = curl; args = args } = - let config_file, chan = Filename.open_temp_file "guestfscurl" ".conf" in +let run { curl = curl; args = args; tmpdir = t...
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index) that cannot be downloaded (network issues, 404, etc) then virt-builder errors out on this situation. This is not a nice situation, from an user POV. This series does some refactoring to allow to better handle downloading failures, and handle the failures gracefully in virt-builder. RFC because I'm not yet too convinced
2016 Jul 07
12
[PATCH v3 0/8] v2v: Move Curl wrapper to mllib and more.
v2 -> v3: - Changes to the Curl API suggested by Pino.
2017 Oct 04
0
[PATCH 2/9] ocaml: Replace pattern matching { field = field } with { field }.
...t uri = ensure_trailing_slash uri in diff --git a/common/mltools/curl.ml b/common/mltools/curl.ml index 85fe1a8b2..e2bd0c283 100644 --- a/common/mltools/curl.ml +++ b/common/mltools/curl.ml @@ -44,7 +44,7 @@ let create ?(curl = "curl") ?(proxy = SystemProxy) ?tmpdir args = let args = safe_args @ args_of_proxy proxy @ args in { curl = curl; args = args; tmpdir = tmpdir } -let run { curl = curl; args = args; tmpdir = tmpdir } = +let run { curl; args; tmpdir } = let config_file, chan = Filename.open_temp_file ?temp_dir:tmpdir "guestfscurl" ".conf" in Lis...
2017 Oct 04
11
[PATCH 0/9] build: Require OCaml >= 4.02.
Per my previous email: https://www.redhat.com/archives/libguestfs/2017-September/msg00203.html I'd like to talk about requiring a more modern version of the OCaml compiler. These commits show some of the code changes which would be possible with OCaml >= 3.12 [which it turns out we already require by accident] and also with OCaml >= 4.02. The latter is my favoured option. Rich.