From e538235945ecaf42af35e9f6c4ca890b7b5783c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 06:27:07 +0000 Subject: [PATCH 01/19] build(deps): bump clap from 4.0.16 to 4.0.17 Bumps [clap](https://github.com/clap-rs/clap) from 4.0.16 to 4.0.17. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.16...v4.0.17) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 214 ++++++++++++++++++++++++++--------------------------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fefbb83c..5c5e375e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,9 +270,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.16" +version = "4.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef582e2c00a63a0c0aa1fb4a4870781c4f5729f51196d3537fa7c1c1992eaa3" +checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" dependencies = [ "atty", "bitflags", @@ -289,7 +289,7 @@ version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11cba7abac9b56dfe2f035098cdb3a43946f276e6db83b72c4e692343f9aab9a" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", ] [[package]] @@ -353,7 +353,7 @@ version = "0.0.16" dependencies = [ "atty", "chrono", - "clap 4.0.16", + "clap 4.0.17", "clap_complete", "conv", "filetime", @@ -2154,7 +2154,7 @@ checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" name = "uu_arch" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "platform-info", "uucore", ] @@ -2163,7 +2163,7 @@ dependencies = [ name = "uu_base32" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2179,7 +2179,7 @@ dependencies = [ name = "uu_basename" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2187,7 +2187,7 @@ dependencies = [ name = "uu_basenc" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uu_base32", "uucore", ] @@ -2197,7 +2197,7 @@ name = "uu_cat" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.16", + "clap 4.0.17", "nix", "thiserror", "uucore", @@ -2207,7 +2207,7 @@ dependencies = [ name = "uu_chcon" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "fts-sys", "libc", "selinux", @@ -2219,7 +2219,7 @@ dependencies = [ name = "uu_chgrp" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2227,7 +2227,7 @@ dependencies = [ name = "uu_chmod" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2236,7 +2236,7 @@ dependencies = [ name = "uu_chown" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2244,7 +2244,7 @@ dependencies = [ name = "uu_chroot" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2252,7 +2252,7 @@ dependencies = [ name = "uu_cksum" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2260,7 +2260,7 @@ dependencies = [ name = "uu_comm" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2268,7 +2268,7 @@ dependencies = [ name = "uu_cp" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "exacl", "filetime", "libc", @@ -2284,7 +2284,7 @@ dependencies = [ name = "uu_csplit" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "regex", "thiserror", "uucore", @@ -2296,7 +2296,7 @@ version = "0.0.16" dependencies = [ "atty", "bstr", - "clap 4.0.16", + "clap 4.0.17", "memchr", "uucore", ] @@ -2306,7 +2306,7 @@ name = "uu_date" version = "0.0.16" dependencies = [ "chrono", - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", "winapi", @@ -2317,7 +2317,7 @@ name = "uu_dd" version = "0.0.16" dependencies = [ "byte-unit", - "clap 4.0.16", + "clap 4.0.17", "gcd", "libc", "signal-hook", @@ -2328,7 +2328,7 @@ dependencies = [ name = "uu_df" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "unicode-width", "uucore", ] @@ -2337,7 +2337,7 @@ dependencies = [ name = "uu_dir" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "selinux", "uu_ls", "uucore", @@ -2347,7 +2347,7 @@ dependencies = [ name = "uu_dircolors" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "glob", "uucore", ] @@ -2356,7 +2356,7 @@ dependencies = [ name = "uu_dirname" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2365,7 +2365,7 @@ name = "uu_du" version = "0.0.16" dependencies = [ "chrono", - "clap 4.0.16", + "clap 4.0.17", "glob", "uucore", "winapi", @@ -2375,7 +2375,7 @@ dependencies = [ name = "uu_echo" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2383,7 +2383,7 @@ dependencies = [ name = "uu_env" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "nix", "rust-ini", "uucore", @@ -2393,7 +2393,7 @@ dependencies = [ name = "uu_expand" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "unicode-width", "uucore", ] @@ -2402,7 +2402,7 @@ dependencies = [ name = "uu_expr" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "num-bigint", "num-traits", "onig", @@ -2413,7 +2413,7 @@ dependencies = [ name = "uu_factor" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "coz", "num-traits", "paste", @@ -2427,7 +2427,7 @@ dependencies = [ name = "uu_false" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2435,7 +2435,7 @@ dependencies = [ name = "uu_fmt" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "unicode-width", "uucore", ] @@ -2444,7 +2444,7 @@ dependencies = [ name = "uu_fold" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2452,7 +2452,7 @@ dependencies = [ name = "uu_groups" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2462,7 +2462,7 @@ version = "0.0.16" dependencies = [ "blake2b_simd", "blake3", - "clap 4.0.16", + "clap 4.0.17", "digest", "hex", "md-5", @@ -2478,7 +2478,7 @@ dependencies = [ name = "uu_head" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "memchr", "uucore", ] @@ -2487,7 +2487,7 @@ dependencies = [ name = "uu_hostid" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2496,7 +2496,7 @@ dependencies = [ name = "uu_hostname" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "hostname", "uucore", "winapi", @@ -2506,7 +2506,7 @@ dependencies = [ name = "uu_id" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "selinux", "uucore", ] @@ -2515,7 +2515,7 @@ dependencies = [ name = "uu_install" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "file_diff", "filetime", "libc", @@ -2527,7 +2527,7 @@ dependencies = [ name = "uu_join" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "memchr", "uucore", ] @@ -2536,7 +2536,7 @@ dependencies = [ name = "uu_kill" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "nix", "uucore", ] @@ -2545,7 +2545,7 @@ dependencies = [ name = "uu_link" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2553,7 +2553,7 @@ dependencies = [ name = "uu_ln" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2561,7 +2561,7 @@ dependencies = [ name = "uu_logname" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2572,7 +2572,7 @@ version = "0.0.16" dependencies = [ "atty", "chrono", - "clap 4.0.16", + "clap 4.0.17", "glob", "lscolors", "number_prefix", @@ -2588,7 +2588,7 @@ dependencies = [ name = "uu_mkdir" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2596,7 +2596,7 @@ dependencies = [ name = "uu_mkfifo" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2605,7 +2605,7 @@ dependencies = [ name = "uu_mknod" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2614,7 +2614,7 @@ dependencies = [ name = "uu_mktemp" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "rand", "tempfile", "uucore", @@ -2625,7 +2625,7 @@ name = "uu_more" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.16", + "clap 4.0.17", "crossterm", "nix", "unicode-segmentation", @@ -2637,7 +2637,7 @@ dependencies = [ name = "uu_mv" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "fs_extra", "uucore", ] @@ -2646,7 +2646,7 @@ dependencies = [ name = "uu_nice" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "nix", "uucore", @@ -2656,7 +2656,7 @@ dependencies = [ name = "uu_nl" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "regex", "uucore", ] @@ -2666,7 +2666,7 @@ name = "uu_nohup" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2675,7 +2675,7 @@ dependencies = [ name = "uu_nproc" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "num_cpus", "uucore", @@ -2685,7 +2685,7 @@ dependencies = [ name = "uu_numfmt" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2694,7 +2694,7 @@ name = "uu_od" version = "0.0.16" dependencies = [ "byteorder", - "clap 4.0.16", + "clap 4.0.17", "half", "uucore", ] @@ -2703,7 +2703,7 @@ dependencies = [ name = "uu_paste" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2711,7 +2711,7 @@ dependencies = [ name = "uu_pathchk" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2720,7 +2720,7 @@ dependencies = [ name = "uu_pinky" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2728,7 +2728,7 @@ dependencies = [ name = "uu_pr" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "itertools", "quick-error", "regex", @@ -2740,7 +2740,7 @@ dependencies = [ name = "uu_printenv" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2748,7 +2748,7 @@ dependencies = [ name = "uu_printf" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2756,7 +2756,7 @@ dependencies = [ name = "uu_ptx" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "regex", "uucore", ] @@ -2765,7 +2765,7 @@ dependencies = [ name = "uu_pwd" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2773,7 +2773,7 @@ dependencies = [ name = "uu_readlink" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2781,7 +2781,7 @@ dependencies = [ name = "uu_realpath" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2789,7 +2789,7 @@ dependencies = [ name = "uu_relpath" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2797,7 +2797,7 @@ dependencies = [ name = "uu_rm" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "remove_dir_all 0.7.0", "uucore", "walkdir", @@ -2808,7 +2808,7 @@ dependencies = [ name = "uu_rmdir" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", ] @@ -2817,7 +2817,7 @@ dependencies = [ name = "uu_runcon" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "selinux", "thiserror", @@ -2829,7 +2829,7 @@ name = "uu_seq" version = "0.0.16" dependencies = [ "bigdecimal", - "clap 4.0.16", + "clap 4.0.17", "num-bigint", "num-traits", "uucore", @@ -2839,7 +2839,7 @@ dependencies = [ name = "uu_shred" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "rand", "uucore", ] @@ -2848,7 +2848,7 @@ dependencies = [ name = "uu_shuf" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "memchr", "rand", "rand_core", @@ -2859,7 +2859,7 @@ dependencies = [ name = "uu_sleep" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2868,7 +2868,7 @@ name = "uu_sort" version = "0.0.16" dependencies = [ "binary-heap-plus", - "clap 4.0.16", + "clap 4.0.17", "compare", "ctrlc", "fnv", @@ -2886,7 +2886,7 @@ dependencies = [ name = "uu_split" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "memchr", "uucore", ] @@ -2895,7 +2895,7 @@ dependencies = [ name = "uu_stat" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2903,7 +2903,7 @@ dependencies = [ name = "uu_stdbuf" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "tempfile", "uu_stdbuf_libstdbuf", "uucore", @@ -2923,7 +2923,7 @@ dependencies = [ name = "uu_stty" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "nix", "uucore", ] @@ -2932,7 +2932,7 @@ dependencies = [ name = "uu_sum" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -2940,7 +2940,7 @@ dependencies = [ name = "uu_sync" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "nix", "uucore", @@ -2951,7 +2951,7 @@ dependencies = [ name = "uu_tac" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "memchr", "memmap2", "regex", @@ -2962,7 +2962,7 @@ dependencies = [ name = "uu_tail" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "memchr", "nix", @@ -2977,7 +2977,7 @@ dependencies = [ name = "uu_tee" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "retain_mut", "uucore", @@ -2987,7 +2987,7 @@ dependencies = [ name = "uu_test" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "redox_syscall", "uucore", @@ -2997,7 +2997,7 @@ dependencies = [ name = "uu_timeout" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "nix", "uucore", @@ -3007,7 +3007,7 @@ dependencies = [ name = "uu_touch" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "filetime", "time", "uucore", @@ -3018,7 +3018,7 @@ dependencies = [ name = "uu_tr" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "nom", "uucore", ] @@ -3027,7 +3027,7 @@ dependencies = [ name = "uu_true" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3035,7 +3035,7 @@ dependencies = [ name = "uu_truncate" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3043,7 +3043,7 @@ dependencies = [ name = "uu_tsort" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3052,7 +3052,7 @@ name = "uu_tty" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.16", + "clap 4.0.17", "nix", "uucore", ] @@ -3061,7 +3061,7 @@ dependencies = [ name = "uu_uname" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "platform-info", "uucore", ] @@ -3070,7 +3070,7 @@ dependencies = [ name = "uu_unexpand" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "unicode-width", "uucore", ] @@ -3079,7 +3079,7 @@ dependencies = [ name = "uu_uniq" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "strum", "strum_macros", "uucore", @@ -3089,7 +3089,7 @@ dependencies = [ name = "uu_unlink" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3098,7 +3098,7 @@ name = "uu_uptime" version = "0.0.16" dependencies = [ "chrono", - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3106,7 +3106,7 @@ dependencies = [ name = "uu_users" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3114,7 +3114,7 @@ dependencies = [ name = "uu_vdir" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "selinux", "uu_ls", "uucore", @@ -3125,7 +3125,7 @@ name = "uu_wc" version = "0.0.16" dependencies = [ "bytecount", - "clap 4.0.16", + "clap 4.0.17", "libc", "nix", "unicode-width", @@ -3137,7 +3137,7 @@ dependencies = [ name = "uu_who" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "uucore", ] @@ -3145,7 +3145,7 @@ dependencies = [ name = "uu_whoami" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "uucore", "winapi", @@ -3155,7 +3155,7 @@ dependencies = [ name = "uu_yes" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "libc", "nix", "uucore", @@ -3165,7 +3165,7 @@ dependencies = [ name = "uucore" version = "0.0.16" dependencies = [ - "clap 4.0.16", + "clap 4.0.17", "data-encoding", "data-encoding-macro", "dns-lookup", From e2c368cee076c88c29ce19f792080dfaabb47cad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 06:27:28 +0000 Subject: [PATCH 02/19] build(deps): bump sha3 from 0.10.5 to 0.10.6 Bumps [sha3](https://github.com/RustCrypto/hashes) from 0.10.5 to 0.10.6. - [Release notes](https://github.com/RustCrypto/hashes/releases) - [Commits](https://github.com/RustCrypto/hashes/compare/sha3-v0.10.5...sha3-v0.10.6) --- updated-dependencies: - dependency-name: sha3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- src/uu/hashsum/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fefbb83c..a2a9241dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1876,9 +1876,9 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2904bea16a1ae962b483322a1c7b81d976029203aea1f461e51cd7705db7ba9" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" dependencies = [ "digest", "keccak", diff --git a/src/uu/hashsum/Cargo.toml b/src/uu/hashsum/Cargo.toml index 23e2bba0d..2168d5d70 100644 --- a/src/uu/hashsum/Cargo.toml +++ b/src/uu/hashsum/Cargo.toml @@ -23,7 +23,7 @@ md-5 = "0.10.5" regex = "1.6.0" sha1 = "0.10.1" sha2 = "0.10.2" -sha3 = "0.10.2" +sha3 = "0.10.6" blake2b_simd = "1.0.0" blake3 = "1.3.1" uucore = { version=">=0.0.16", package="uucore", path="../../uucore" } From d46e5df3d3fe4ee6c76cf0a9b41408c6e3000714 Mon Sep 17 00:00:00 2001 From: David Matos Date: Wed, 19 Oct 2022 20:09:56 +0200 Subject: [PATCH 03/19] hashsum: warn on file not found rather than fail --- src/uu/hashsum/src/hashsum.rs | 31 +++++++++++++++++++++++++------ tests/by-util/test_hashsum.rs | 20 ++++++++++++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index e2e904343..828436595 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -498,7 +498,8 @@ where I: Iterator, { let mut bad_format = 0; - let mut failed = 0; + let mut failed_cksum = 0; + let mut failed_open_file = 0; let binary_marker = if options.binary { "*" } else { " " }; for filename in files { let filename = Path::new(filename); @@ -574,8 +575,19 @@ where } }, }; - let f = File::open(ck_filename) - .map_err_context(|| "failed to open file".to_string())?; + let f = match File::open(ck_filename) { + Err(_) => { + failed_open_file += 1; + println!( + "{}: {}: No such file or directory", + uucore::util_name(), + ck_filename + ); + println!("{}: FAILED open or read", ck_filename); + continue; + } + Ok(file) => file, + }; let mut ckf = BufReader::new(Box::new(f) as Box); let real_sum = digest_reader( &mut options.digest, @@ -602,7 +614,7 @@ where if !options.status { println!("{}: FAILED", ck_filename); } - failed += 1; + failed_cksum += 1; } } } else { @@ -628,8 +640,15 @@ where Ordering::Greater => show_warning!("{} lines are improperly formatted", bad_format), _ => {} }; - if failed > 0 { - show_warning!("{} computed checksum did NOT match", failed); + if failed_cksum > 0 { + show_warning!("{} computed checksum did NOT match", failed_cksum); + } + match failed_open_file.cmp(&1) { + Ordering::Equal => show_warning!("{} listed file could not be read", failed_open_file), + Ordering::Greater => { + show_warning!("{} listed files could not be read", failed_open_file); + } + _ => {} } } diff --git a/tests/by-util/test_hashsum.rs b/tests/by-util/test_hashsum.rs index 5fdc6e648..dea958bef 100644 --- a/tests/by-util/test_hashsum.rs +++ b/tests/by-util/test_hashsum.rs @@ -117,6 +117,26 @@ fn test_check_sha1() { .stderr_is(""); } +#[test] +fn test_check_file_not_found_warning() { + let scene = TestScenario::new(util_name!()); + let at = &scene.fixtures; + + at.write("testf", "foobar\n"); + at.write( + "testf.sha1", + "988881adc9fc3655077dc2d4d757d480b5ea0e11 testf\n", + ); + at.remove("testf"); + scene + .ccmd("sha1sum") + .arg("-c") + .arg(at.subdir.join("testf.sha1")) + .succeeds() + .stdout_is("sha1sum: testf: No such file or directory\ntestf: FAILED open or read\n") + .stderr_is("sha1sum: warning: 1 listed file could not be read"); +} + #[test] fn test_invalid_arg() { new_ucmd!().arg("--definitely-invalid").fails().code_is(1); From 11d3e0f7430f65420c60aaefa7731d36110c1c82 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Sun, 4 Sep 2022 10:37:41 -0400 Subject: [PATCH 04/19] cp: refactor Options::preserve_hard_links() Refactor common code into a helper method `Options::preserve_hard_links()`. This also eliminates the need for mutability in a local variable in two places. --- src/uu/cp/src/cp.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index 8b9226c1a..ffabc3c91 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -835,6 +835,15 @@ impl Options { fn dereference(&self, in_command_line: bool) -> bool { self.dereference || (in_command_line && self.cli_dereference) } + + fn preserve_hard_links(&self) -> bool { + for attribute in &self.preserve_attributes { + if *attribute == Attribute::Links { + return true; + } + } + false + } } impl TargetType { @@ -938,12 +947,7 @@ fn copy(sources: &[Source], target: &TargetSlice, options: &Options) -> CopyResu let target_type = TargetType::determine(sources, target); verify_target_type(target, &target_type)?; - let mut preserve_hard_links = false; - for attribute in &options.preserve_attributes { - if *attribute == Attribute::Links { - preserve_hard_links = true; - } - } + let preserve_hard_links = options.preserve_hard_links(); let mut hard_links: Vec<(String, u64)> = vec![]; @@ -1108,12 +1112,7 @@ fn copy_directory( #[cfg(unix)] let mut hard_links: Vec<(String, u64)> = vec![]; - let mut preserve_hard_links = false; - for attribute in &options.preserve_attributes { - if *attribute == Attribute::Links { - preserve_hard_links = true; - } - } + let preserve_hard_links = options.preserve_hard_links(); // This should be changed once Redox supports hardlinks #[cfg(any(windows, target_os = "redox"))] From d8146d1b5cc534f4df74b0e96d9a72164ed5e755 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Sun, 25 Sep 2022 13:03:31 -0400 Subject: [PATCH 05/19] cp: move copy_directory to new module copydir.rs Move the `copy_directory()` helper function to a new module `copydir.rs`. This commit only changes the organization of the code, not its behavior. --- src/uu/cp/src/copydir.rs | 233 +++++++++++++++++++++++++++++++++++++++ src/uu/cp/src/cp.rs | 205 ++-------------------------------- 2 files changed, 243 insertions(+), 195 deletions(-) create mode 100644 src/uu/cp/src/copydir.rs diff --git a/src/uu/cp/src/copydir.rs b/src/uu/cp/src/copydir.rs new file mode 100644 index 000000000..5ad421abc --- /dev/null +++ b/src/uu/cp/src/copydir.rs @@ -0,0 +1,233 @@ +// * This file is part of the uutils coreutils package. +// * +// * For the full copyright and license information, please view the LICENSE +// * file that was distributed with this source code. +// spell-checker:ignore TODO canonicalizes direntry pathbuf symlinked +//! Recursively copy the contents of a directory. +//! +//! See the [`copy_directory`] function for more information. +#[cfg(windows)] +use std::borrow::Cow; +use std::collections::HashSet; +use std::env; +use std::fs; +use std::io; +use std::path::Path; + +use uucore::display::Quotable; +use uucore::error::UIoError; +use uucore::fs::{canonicalize, FileInformation, MissingHandling, ResolveMode}; +use walkdir::WalkDir; + +use crate::{ + copy_attributes, copy_file, copy_link, preserve_hardlinks, CopyResult, Error, Options, + TargetSlice, +}; + +/// Continue next iteration of loop if result of expression is error +macro_rules! or_continue( + ($expr:expr) => (match $expr { + Ok(temp) => temp, + Err(error) => { + show_error!("{}", error); + continue + }, + }) +); + +#[cfg(target_os = "windows")] +fn adjust_canonicalization(p: &Path) -> Cow { + // In some cases, \\? can be missing on some Windows paths. Add it at the + // beginning unless the path is prefixed with a device namespace. + const VERBATIM_PREFIX: &str = r#"\\?"#; + const DEVICE_NS_PREFIX: &str = r#"\\."#; + + let has_prefix = p + .components() + .next() + .and_then(|comp| comp.as_os_str().to_str()) + .map(|p_str| p_str.starts_with(VERBATIM_PREFIX) || p_str.starts_with(DEVICE_NS_PREFIX)) + .unwrap_or_default(); + + if has_prefix { + p.into() + } else { + Path::new(VERBATIM_PREFIX).join(p).into() + } +} + +/// Read the contents of the directory `root` and recursively copy the +/// contents to `target`. +/// +/// Any errors encountered copying files in the tree will be logged but +/// will not cause a short-circuit. +pub(crate) fn copy_directory( + root: &Path, + target: &TargetSlice, + options: &Options, + symlinked_files: &mut HashSet, + source_in_command_line: bool, +) -> CopyResult<()> { + if !options.recursive { + return Err(format!("omitting directory {}", root.quote()).into()); + } + + // if no-dereference is enabled and this is a symlink, copy it as a file + if !options.dereference(source_in_command_line) && root.is_symlink() { + return copy_file( + root, + target, + options, + symlinked_files, + source_in_command_line, + ); + } + + // check if root is a prefix of target + if path_has_prefix(target, root)? { + return Err(format!( + "cannot copy a directory, {}, into itself, {}", + root.quote(), + target.join(root.file_name().unwrap()).quote() + ) + .into()); + } + + let current_dir = + env::current_dir().unwrap_or_else(|e| crash!(1, "failed to get current directory {}", e)); + + let root_path = current_dir.join(root); + + let root_parent = if target.exists() { + root_path.parent() + } else { + Some(root_path.as_path()) + }; + + #[cfg(unix)] + let mut hard_links: Vec<(String, u64)> = vec![]; + let preserve_hard_links = options.preserve_hard_links(); + + // This should be changed once Redox supports hardlinks + #[cfg(any(windows, target_os = "redox"))] + let mut hard_links: Vec<(String, u64)> = vec![]; + + for path in WalkDir::new(root) + .same_file_system(options.one_file_system) + .follow_links(options.dereference) + { + let p = or_continue!(path); + let path = current_dir.join(p.path()); + + let local_to_root_parent = match root_parent { + Some(parent) => { + #[cfg(windows)] + { + // On Windows, some paths are starting with \\? + // but not always, so, make sure that we are consistent for strip_prefix + // See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file for more info + let parent_can = adjust_canonicalization(parent); + let path_can = adjust_canonicalization(&path); + + or_continue!(&path_can.strip_prefix(&parent_can)).to_path_buf() + } + #[cfg(not(windows))] + { + or_continue!(path.strip_prefix(parent)).to_path_buf() + } + } + None => path.clone(), + }; + + let local_to_target = target.join(&local_to_root_parent); + if p.path().is_symlink() && !options.dereference { + copy_link(&path, &local_to_target, symlinked_files)?; + } else if path.is_dir() && !local_to_target.exists() { + if target.is_file() { + return Err("cannot overwrite non-directory with directory".into()); + } + fs::create_dir_all(local_to_target)?; + } else if !path.is_dir() { + if preserve_hard_links { + let mut found_hard_link = false; + let source = path.to_path_buf(); + let dest = local_to_target.as_path().to_path_buf(); + preserve_hardlinks(&mut hard_links, &source, &dest, &mut found_hard_link)?; + if !found_hard_link { + match copy_file( + path.as_path(), + local_to_target.as_path(), + options, + symlinked_files, + false, + ) { + Ok(_) => Ok(()), + Err(err) => { + if source.is_symlink() { + // silent the error with a symlink + // In case we do --archive, we might copy the symlink + // before the file itself + Ok(()) + } else { + Err(err) + } + } + }?; + } + } else { + // At this point, `path` is just a plain old file. + // Terminate this function immediately if there is any + // kind of error *except* a "permission denied" error. + // + // TODO What other kinds of errors, if any, should + // cause us to continue walking the directory? + match copy_file( + path.as_path(), + local_to_target.as_path(), + options, + symlinked_files, + false, + ) { + Ok(_) => {} + Err(Error::IoErrContext(e, _)) + if e.kind() == std::io::ErrorKind::PermissionDenied => + { + show!(uio_error!( + e, + "cannot open {} for reading", + p.path().quote() + )); + } + Err(e) => return Err(e), + } + } + } + } + // Copy the attributes from the root directory to the target directory. + copy_attributes(root, target, &options.preserve_attributes)?; + Ok(()) +} + +/// Decide whether the second path is a prefix of the first. +/// +/// This function canonicalizes the paths via +/// [`uucore::fs::canonicalize`] before comparing. +/// +/// # Errors +/// +/// If there is an error determining the canonical, absolute form of +/// either path. +/// +/// # Examples +/// +/// ```rust,ignore +/// assert!(path_has_prefix(Path::new("/usr/bin"), Path::new("/usr"))) +/// assert!(!path_has_prefix(Path::new("/usr"), Path::new("/usr/bin"))) +/// assert!(!path_has_prefix(Path::new("/usr/bin"), Path::new("/var/log"))) +/// ``` +pub fn path_has_prefix(p1: &Path, p2: &Path) -> io::Result { + let pathbuf1 = canonicalize(p1, MissingHandling::Normal, ResolveMode::Logical)?; + let pathbuf2 = canonicalize(p2, MissingHandling::Normal, ResolveMode::Logical)?; + + Ok(pathbuf1.starts_with(pathbuf2)) +} diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index ffabc3c91..299eca9cf 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -9,7 +9,7 @@ // For the full copyright and license information, please view the LICENSE file // that was distributed with this source code. -// spell-checker:ignore (ToDO) ficlone ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked fiemap +// spell-checker:ignore (ToDO) copydir ficlone ftruncate linkgs lstat nlink nlinks pathbuf pwrite reflink strs xattrs symlinked fiemap #[macro_use] extern crate quick_error; @@ -38,12 +38,14 @@ use libc::mkfifo; use quick_error::ResultExt; use uucore::backup_control::{self, BackupMode}; use uucore::display::Quotable; -use uucore::error::{set_exit_code, UClapError, UError, UIoError, UResult, UUsageError}; +use uucore::error::{set_exit_code, UClapError, UError, UResult, UUsageError}; use uucore::format_usage; use uucore::fs::{ canonicalize, paths_refer_to_same_file, FileInformation, MissingHandling, ResolveMode, }; -use walkdir::WalkDir; + +mod copydir; +use crate::copydir::copy_directory; mod platform; use platform::copy_on_write; @@ -103,17 +105,6 @@ impl UError for Error { } } -/// Continue next iteration of loop if result of expression is error -macro_rules! or_continue( - ($expr:expr) => (match $expr { - Ok(temp) => temp, - Err(error) => { - show_error!("{}", error); - continue - }, - }) -); - /// Prompts the user yes/no and returns `true` if they successfully /// answered yes. macro_rules! prompt_yes( @@ -1041,179 +1032,6 @@ fn copy_source( } } -#[cfg(target_os = "windows")] -fn adjust_canonicalization(p: &Path) -> Cow { - // In some cases, \\? can be missing on some Windows paths. Add it at the - // beginning unless the path is prefixed with a device namespace. - const VERBATIM_PREFIX: &str = r#"\\?"#; - const DEVICE_NS_PREFIX: &str = r#"\\."#; - - let has_prefix = p - .components() - .next() - .and_then(|comp| comp.as_os_str().to_str()) - .map(|p_str| p_str.starts_with(VERBATIM_PREFIX) || p_str.starts_with(DEVICE_NS_PREFIX)) - .unwrap_or_default(); - - if has_prefix { - p.into() - } else { - Path::new(VERBATIM_PREFIX).join(p).into() - } -} - -/// Read the contents of the directory `root` and recursively copy the -/// contents to `target`. -/// -/// Any errors encountered copying files in the tree will be logged but -/// will not cause a short-circuit. -fn copy_directory( - root: &Path, - target: &TargetSlice, - options: &Options, - symlinked_files: &mut HashSet, - source_in_command_line: bool, -) -> CopyResult<()> { - if !options.recursive { - return Err(format!("omitting directory {}", root.quote()).into()); - } - - // if no-dereference is enabled and this is a symlink, copy it as a file - if !options.dereference(source_in_command_line) && root.is_symlink() { - return copy_file( - root, - target, - options, - symlinked_files, - source_in_command_line, - ); - } - - // check if root is a prefix of target - if path_has_prefix(target, root)? { - return Err(format!( - "cannot copy a directory, {}, into itself, {}", - root.quote(), - target.join(root.file_name().unwrap()).quote() - ) - .into()); - } - - let current_dir = - env::current_dir().unwrap_or_else(|e| crash!(1, "failed to get current directory {}", e)); - - let root_path = current_dir.join(root); - - let root_parent = if target.exists() { - root_path.parent() - } else { - Some(root_path.as_path()) - }; - - #[cfg(unix)] - let mut hard_links: Vec<(String, u64)> = vec![]; - let preserve_hard_links = options.preserve_hard_links(); - - // This should be changed once Redox supports hardlinks - #[cfg(any(windows, target_os = "redox"))] - let mut hard_links: Vec<(String, u64)> = vec![]; - - for path in WalkDir::new(root) - .same_file_system(options.one_file_system) - .follow_links(options.dereference) - { - let p = or_continue!(path); - let path = current_dir.join(p.path()); - - let local_to_root_parent = match root_parent { - Some(parent) => { - #[cfg(windows)] - { - // On Windows, some paths are starting with \\? - // but not always, so, make sure that we are consistent for strip_prefix - // See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file for more info - let parent_can = adjust_canonicalization(parent); - let path_can = adjust_canonicalization(&path); - - or_continue!(&path_can.strip_prefix(&parent_can)).to_path_buf() - } - #[cfg(not(windows))] - { - or_continue!(path.strip_prefix(parent)).to_path_buf() - } - } - None => path.clone(), - }; - - let local_to_target = target.join(&local_to_root_parent); - if p.path().is_symlink() && !options.dereference { - copy_link(&path, &local_to_target, symlinked_files)?; - } else if path.is_dir() && !local_to_target.exists() { - if target.is_file() { - return Err("cannot overwrite non-directory with directory".into()); - } - fs::create_dir_all(local_to_target)?; - } else if !path.is_dir() { - if preserve_hard_links { - let mut found_hard_link = false; - let source = path.to_path_buf(); - let dest = local_to_target.as_path().to_path_buf(); - preserve_hardlinks(&mut hard_links, &source, &dest, &mut found_hard_link)?; - if !found_hard_link { - match copy_file( - path.as_path(), - local_to_target.as_path(), - options, - symlinked_files, - false, - ) { - Ok(_) => Ok(()), - Err(err) => { - if source.is_symlink() { - // silent the error with a symlink - // In case we do --archive, we might copy the symlink - // before the file itself - Ok(()) - } else { - Err(err) - } - } - }?; - } - } else { - // At this point, `path` is just a plain old file. - // Terminate this function immediately if there is any - // kind of error *except* a "permission denied" error. - // - // TODO What other kinds of errors, if any, should - // cause us to continue walking the directory? - match copy_file( - path.as_path(), - local_to_target.as_path(), - options, - symlinked_files, - false, - ) { - Ok(_) => {} - Err(Error::IoErrContext(e, _)) - if e.kind() == std::io::ErrorKind::PermissionDenied => - { - show!(uio_error!( - e, - "cannot open {} for reading", - p.path().quote() - )); - } - Err(e) => return Err(e), - } - } - } - } - // Copy the attributes from the root directory to the target directory. - copy_attributes(root, target, &options.preserve_attributes)?; - Ok(()) -} - impl OverwriteMode { fn verify(&self, path: &Path) -> CopyResult<()> { match *self { @@ -1234,7 +1052,11 @@ impl OverwriteMode { } /// Copy the specified attributes from one path to another. -fn copy_attributes(source: &Path, dest: &Path, attributes: &[Attribute]) -> CopyResult<()> { +pub(crate) fn copy_attributes( + source: &Path, + dest: &Path, + attributes: &[Attribute], +) -> CopyResult<()> { for attribute in attributes { copy_attribute(source, dest, attribute)?; } @@ -1707,13 +1529,6 @@ pub fn localize_to_target(root: &Path, source: &Path, target: &Path) -> CopyResu Ok(target.join(local_to_root)) } -pub fn path_has_prefix(p1: &Path, p2: &Path) -> io::Result { - let pathbuf1 = canonicalize(p1, MissingHandling::Normal, ResolveMode::Logical)?; - let pathbuf2 = canonicalize(p2, MissingHandling::Normal, ResolveMode::Logical)?; - - Ok(pathbuf1.starts_with(pathbuf2)) -} - #[test] fn test_cp_localize_to_target() { assert!( From aeba601335a4c42b396fef2b4180487cffefd221 Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Sun, 25 Sep 2022 13:05:31 -0400 Subject: [PATCH 06/19] cp: break up copy_directory() into helper funcs Add some additional structs and helper functions to make the code in `copydir.rs` easier to read and maintain. This commit changes only the organization of the code, not its function. --- src/uu/cp/src/copydir.rs | 353 +++++++++++++++++++++++++++------------ 1 file changed, 242 insertions(+), 111 deletions(-) diff --git a/src/uu/cp/src/copydir.rs b/src/uu/cp/src/copydir.rs index 5ad421abc..e0d6e96db 100644 --- a/src/uu/cp/src/copydir.rs +++ b/src/uu/cp/src/copydir.rs @@ -12,29 +12,19 @@ use std::collections::HashSet; use std::env; use std::fs; use std::io; -use std::path::Path; +use std::path::{Path, PathBuf, StripPrefixError}; use uucore::display::Quotable; use uucore::error::UIoError; use uucore::fs::{canonicalize, FileInformation, MissingHandling, ResolveMode}; -use walkdir::WalkDir; +use walkdir::{DirEntry, WalkDir}; use crate::{ copy_attributes, copy_file, copy_link, preserve_hardlinks, CopyResult, Error, Options, TargetSlice, }; -/// Continue next iteration of loop if result of expression is error -macro_rules! or_continue( - ($expr:expr) => (match $expr { - Ok(temp) => temp, - Err(error) => { - show_error!("{}", error); - continue - }, - }) -); - +/// Ensure a Windows path starts with a `\\?`. #[cfg(target_os = "windows")] fn adjust_canonicalization(p: &Path) -> Cow { // In some cases, \\? can be missing on some Windows paths. Add it at the @@ -56,6 +46,226 @@ fn adjust_canonicalization(p: &Path) -> Cow { } } +/// Get a descendant path relative to the given parent directory. +/// +/// If `root_parent` is `None`, then this just returns the `path` +/// itself. Otherwise, this function strips the parent prefix from the +/// given `path`, leaving only the portion of the path relative to the +/// parent. +fn get_local_to_root_parent( + path: &Path, + root_parent: Option<&Path>, +) -> Result { + match root_parent { + Some(parent) => { + // On Windows, some paths are starting with \\? + // but not always, so, make sure that we are consistent for strip_prefix + // See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file for more info + #[cfg(windows)] + let (path, parent) = ( + adjust_canonicalization(path), + adjust_canonicalization(parent), + ); + let path = path.strip_prefix(&parent)?; + Ok(path.to_path_buf()) + } + None => Ok(path.to_path_buf()), + } +} + +/// Paths that are invariant throughout the traversal when copying a directory. +struct Context<'a> { + /// The current working directory at the time of starting the traversal. + current_dir: PathBuf, + + /// The path to the parent of the source directory, if any. + root_parent: Option, + + /// The target path to which the directory will be copied. + target: &'a Path, +} + +impl<'a> Context<'a> { + fn new(root: &'a Path, target: &'a Path) -> std::io::Result { + let current_dir = env::current_dir()?; + let root_path = current_dir.join(root); + let root_parent = if target.exists() { + root_path.parent().map(|p| p.to_path_buf()) + } else { + Some(root_path) + }; + Ok(Self { + current_dir, + root_parent, + target, + }) + } +} + +/// Data needed to perform a single copy operation while traversing a directory. +/// +/// For convenience while traversing a directory, the [`Entry::new`] +/// function allows creating an entry from a [`Context`] and a +/// [`walkdir::DirEntry`]. +/// +/// # Examples +/// +/// For example, if the source directory structure is `a/b/c`, the +/// target is `d/`, a directory that already exists, and the copy +/// command is `cp -r a/b/c d`, then the overall set of copy +/// operations could be represented as three entries, +/// +/// ```rust,ignore +/// let operations = [ +/// Entry { +/// source_absolute: "/tmp/a".into(), +/// source_relative: "a".into(), +/// local_to_target: "d/a".into(), +/// target_is_file: false, +/// } +/// Entry { +/// source_absolute: "/tmp/a/b".into(), +/// source_relative: "a/b".into(), +/// local_to_target: "d/a/b".into(), +/// target_is_file: false, +/// } +/// Entry { +/// source_absolute: "/tmp/a/b/c".into(), +/// source_relative: "a/b/c".into(), +/// local_to_target: "d/a/b/c".into(), +/// target_is_file: false, +/// } +/// ]; +/// ``` +struct Entry { + /// The absolute path to file or directory to copy. + source_absolute: PathBuf, + + /// The relative path to file or directory to copy. + source_relative: PathBuf, + + /// The path to the destination, relative to the target. + local_to_target: PathBuf, + + /// Whether the destination is a file. + target_is_file: bool, +} + +impl Entry { + fn new(context: &Context, direntry: &DirEntry) -> Result { + let source_relative = direntry.path().to_path_buf(); + let source_absolute = context.current_dir.join(&source_relative); + let descendant = + get_local_to_root_parent(&source_absolute, context.root_parent.as_deref())?; + let local_to_target = context.target.join(descendant); + let target_is_file = context.target.is_file(); + Ok(Self { + source_absolute, + source_relative, + local_to_target, + target_is_file, + }) + } +} + +/// Copy a single entry during a directory traversal. +fn copy_direntry( + entry: Entry, + options: &Options, + symlinked_files: &mut HashSet, + preserve_hard_links: bool, + hard_links: &mut Vec<(String, u64)>, +) -> CopyResult<()> { + let Entry { + source_absolute, + source_relative, + local_to_target, + target_is_file, + } = entry; + + // If the source is a symbolic link and the options tell us not to + // dereference the link, then copy the link object itself. + if source_absolute.is_symlink() && !options.dereference { + return copy_link(&source_absolute, &local_to_target, symlinked_files); + } + + // If the source is a directory and the destination does not + // exist, ... + if source_absolute.is_dir() && !local_to_target.exists() { + if target_is_file { + return Err("cannot overwrite non-directory with directory".into()); + } else { + // TODO Since the calling code is traversing from the root + // of the directory structure, I don't think + // `create_dir_all()` will have any benefit over + // `create_dir()`, since all the ancestor directories + // should have already been created. + fs::create_dir_all(local_to_target)?; + return Ok(()); + } + } + + // If the source is not a directory, then we need to copy the file. + if !source_absolute.is_dir() { + if preserve_hard_links { + let mut found_hard_link = false; + let dest = local_to_target.as_path().to_path_buf(); + preserve_hardlinks(hard_links, &source_absolute, &dest, &mut found_hard_link)?; + if !found_hard_link { + match copy_file( + &source_absolute, + local_to_target.as_path(), + options, + symlinked_files, + false, + ) { + Ok(_) => Ok(()), + Err(err) => { + if source_absolute.is_symlink() { + // silent the error with a symlink + // In case we do --archive, we might copy the symlink + // before the file itself + Ok(()) + } else { + Err(err) + } + } + }?; + } + } else { + // At this point, `path` is just a plain old file. + // Terminate this function immediately if there is any + // kind of error *except* a "permission denied" error. + // + // TODO What other kinds of errors, if any, should + // cause us to continue walking the directory? + match copy_file( + &source_absolute, + local_to_target.as_path(), + options, + symlinked_files, + false, + ) { + Ok(_) => {} + Err(Error::IoErrContext(e, _)) + if e.kind() == std::io::ErrorKind::PermissionDenied => + { + show!(uio_error!( + e, + "cannot open {} for reading", + source_relative.quote(), + )); + } + Err(e) => return Err(e), + } + } + } + + // In any other case, there is nothing to do, so we just return to + // continue the traversal. + Ok(()) +} + /// Read the contents of the directory `root` and recursively copy the /// contents to `target`. /// @@ -93,114 +303,35 @@ pub(crate) fn copy_directory( .into()); } - let current_dir = - env::current_dir().unwrap_or_else(|e| crash!(1, "failed to get current directory {}", e)); - - let root_path = current_dir.join(root); - - let root_parent = if target.exists() { - root_path.parent() - } else { - Some(root_path.as_path()) - }; - - #[cfg(unix)] let mut hard_links: Vec<(String, u64)> = vec![]; let preserve_hard_links = options.preserve_hard_links(); - // This should be changed once Redox supports hardlinks - #[cfg(any(windows, target_os = "redox"))] - let mut hard_links: Vec<(String, u64)> = vec![]; + // Collect some paths here that are invariant during the traversal + // of the given directory, like the current working directory and + // the target directory. + let context = match Context::new(root, target) { + Ok(c) => c, + Err(e) => return Err(format!("failed to get current directory {}", e).into()), + }; - for path in WalkDir::new(root) + // Traverse the contents of the directory, copying each one. + for direntry_result in WalkDir::new(root) .same_file_system(options.one_file_system) .follow_links(options.dereference) { - let p = or_continue!(path); - let path = current_dir.join(p.path()); - - let local_to_root_parent = match root_parent { - Some(parent) => { - #[cfg(windows)] - { - // On Windows, some paths are starting with \\? - // but not always, so, make sure that we are consistent for strip_prefix - // See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file for more info - let parent_can = adjust_canonicalization(parent); - let path_can = adjust_canonicalization(&path); - - or_continue!(&path_can.strip_prefix(&parent_can)).to_path_buf() - } - #[cfg(not(windows))] - { - or_continue!(path.strip_prefix(parent)).to_path_buf() - } - } - None => path.clone(), - }; - - let local_to_target = target.join(&local_to_root_parent); - if p.path().is_symlink() && !options.dereference { - copy_link(&path, &local_to_target, symlinked_files)?; - } else if path.is_dir() && !local_to_target.exists() { - if target.is_file() { - return Err("cannot overwrite non-directory with directory".into()); - } - fs::create_dir_all(local_to_target)?; - } else if !path.is_dir() { - if preserve_hard_links { - let mut found_hard_link = false; - let source = path.to_path_buf(); - let dest = local_to_target.as_path().to_path_buf(); - preserve_hardlinks(&mut hard_links, &source, &dest, &mut found_hard_link)?; - if !found_hard_link { - match copy_file( - path.as_path(), - local_to_target.as_path(), - options, - symlinked_files, - false, - ) { - Ok(_) => Ok(()), - Err(err) => { - if source.is_symlink() { - // silent the error with a symlink - // In case we do --archive, we might copy the symlink - // before the file itself - Ok(()) - } else { - Err(err) - } - } - }?; - } - } else { - // At this point, `path` is just a plain old file. - // Terminate this function immediately if there is any - // kind of error *except* a "permission denied" error. - // - // TODO What other kinds of errors, if any, should - // cause us to continue walking the directory? - match copy_file( - path.as_path(), - local_to_target.as_path(), + match direntry_result { + Ok(direntry) => { + let entry = Entry::new(&context, &direntry)?; + copy_direntry( + entry, options, symlinked_files, - false, - ) { - Ok(_) => {} - Err(Error::IoErrContext(e, _)) - if e.kind() == std::io::ErrorKind::PermissionDenied => - { - show!(uio_error!( - e, - "cannot open {} for reading", - p.path().quote() - )); - } - Err(e) => return Err(e), - } + preserve_hard_links, + &mut hard_links, + )?; } + // Print an error message, but continue traversing the directory. + Err(e) => show_error!("{}", e), } } // Copy the attributes from the root directory to the target directory. From 49c435a25bce22c5bd102abb3b1129192d4e4ad4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 20 Oct 2022 07:46:38 +0200 Subject: [PATCH 07/19] ignore a word --- tests/by-util/test_hashsum.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/by-util/test_hashsum.rs b/tests/by-util/test_hashsum.rs index dea958bef..f30eb42ce 100644 --- a/tests/by-util/test_hashsum.rs +++ b/tests/by-util/test_hashsum.rs @@ -1,5 +1,5 @@ use crate::common::util::*; -// spell-checker:ignore checkfile, nonames, testf +// spell-checker:ignore checkfile, nonames, testf, ntestf macro_rules! get_hash( ($str:expr) => ( $str.split(' ').collect::>()[0] From 76ee0db26cee62b0d548a41c503847054c40f7f2 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 18:02:03 +0300 Subject: [PATCH 08/19] uucore: migrate from `winapi` to `windows-sys` crate --- Cargo.lock | 79 ++++++++++++++++++++++++---- src/uucore/Cargo.toml | 6 +-- src/uucore/src/lib/features/fs.rs | 5 +- src/uucore/src/lib/features/fsext.rs | 32 +++++------ src/uucore/src/lib/lib.rs | 4 +- 5 files changed, 89 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6bb895a12..076707d31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -869,7 +869,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1264,7 +1264,7 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1469,7 +1469,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1790,7 +1790,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -2029,7 +2029,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8440c860cf79def6164e4a0a983bcc2305d82419177a0e0c71930d049e3ac5a1" dependencies = [ "rustix", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -3181,8 +3181,8 @@ dependencies = [ "uucore_procs", "walkdir", "wild", - "winapi", "winapi-util", + "windows-sys 0.42.0", "z85", ] @@ -3334,43 +3334,100 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[package]] name = "windows_i686_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[package]] name = "windows_i686_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "xattr" version = "0.2.3" diff --git a/src/uucore/Cargo.toml b/src/uucore/Cargo.toml index af78e3f94..d9489c281 100644 --- a/src/uucore/Cargo.toml +++ b/src/uucore/Cargo.toml @@ -45,16 +45,16 @@ clap = "4.0" once_cell = "1.13" [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "winerror"] } winapi-util = { version= "0.1.5", optional=true } +windows-sys = { version = "0.42.0", optional = true, default-features = false, features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_WindowsProgramming"] } [features] default = [] # * non-default features encoding = ["data-encoding", "data-encoding-macro", "z85", "thiserror"] entries = ["libc"] -fs = ["libc", "nix", "winapi-util"] -fsext = ["libc", "nix", "time"] +fs = ["libc", "nix", "winapi-util", "windows-sys"] +fsext = ["libc", "nix", "time", "windows-sys"] lines = [] memo = ["itertools"] mode = ["libc"] diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index 42b7edf35..27dcdee82 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -81,9 +81,10 @@ impl FileInformation { let mut open_options = OpenOptions::new(); let mut custom_flags = 0; if !dereference { - custom_flags |= winapi::um::winbase::FILE_FLAG_OPEN_REPARSE_POINT; + custom_flags |= + windows_sys::Win32::Storage::FileSystem::FILE_FLAG_OPEN_REPARSE_POINT; } - custom_flags |= winapi::um::winbase::FILE_FLAG_BACKUP_SEMANTICS; + custom_flags |= windows_sys::Win32::Storage::FileSystem::FILE_FLAG_BACKUP_SEMANTICS; open_options.custom_flags(custom_flags); let file = open_options.read(true).open(path.as_ref())?; Self::from_file(&file) diff --git a/src/uucore/src/lib/features/fsext.rs b/src/uucore/src/lib/features/fsext.rs index 8f2047355..f306f34de 100644 --- a/src/uucore/src/lib/features/fsext.rs +++ b/src/uucore/src/lib/features/fsext.rs @@ -32,18 +32,14 @@ use std::ffi::OsStr; #[cfg(windows)] use std::os::windows::ffi::OsStrExt; #[cfg(windows)] -use winapi::shared::minwindef::DWORD; +use windows_sys::Win32::Foundation::{ERROR_NO_MORE_FILES, INVALID_HANDLE_VALUE}; #[cfg(windows)] -use winapi::um::fileapi::GetDiskFreeSpaceW; -#[cfg(windows)] -use winapi::um::fileapi::{ - FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDriveTypeW, GetVolumeInformationW, - GetVolumePathNamesForVolumeNameW, QueryDosDeviceW, +use windows_sys::Win32::Storage::FileSystem::{ + FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, GetDiskFreeSpaceW, GetDriveTypeW, + GetVolumeInformationW, GetVolumePathNamesForVolumeNameW, QueryDosDeviceW, }; #[cfg(windows)] -use winapi::um::handleapi::INVALID_HANDLE_VALUE; -#[cfg(windows)] -use winapi::um::winbase::DRIVE_REMOTE; +use windows_sys::Win32::System::WindowsProgramming::DRIVE_REMOTE; // Warning: the pointer has to be used *immediately* or the Vec // it points to will be dropped! @@ -265,7 +261,7 @@ impl MountInfo { .collect::>() .as_ptr(), dev_name_buf.as_mut_ptr(), - dev_name_buf.len() as DWORD, + dev_name_buf.len() as u32, ) }; volume_name.push('\\'); @@ -276,7 +272,7 @@ impl MountInfo { GetVolumePathNamesForVolumeNameW( String2LPWSTR!(volume_name), mount_root_buf.as_mut_ptr(), - mount_root_buf.len() as DWORD, + mount_root_buf.len() as u32, ptr::null_mut(), ) }; @@ -296,7 +292,7 @@ impl MountInfo { ptr::null_mut(), ptr::null_mut(), fs_type_buf.as_mut_ptr(), - fs_type_buf.len() as DWORD, + fs_type_buf.len() as u32, ) }; let fs_type = if 0 != success { @@ -443,9 +439,8 @@ pub fn read_fs_list() -> Result, std::io::Error> { { let mut volume_name_buf = [0u16; MAX_PATH]; // As recommended in the MS documentation, retrieve the first volume before the others - let find_handle = unsafe { - FindFirstVolumeW(volume_name_buf.as_mut_ptr(), volume_name_buf.len() as DWORD) - }; + let find_handle = + unsafe { FindFirstVolumeW(volume_name_buf.as_mut_ptr(), volume_name_buf.len() as u32) }; if INVALID_HANDLE_VALUE == find_handle { crash!( EXIT_ERR, @@ -467,12 +462,11 @@ pub fn read_fs_list() -> Result, std::io::Error> { FindNextVolumeW( find_handle, volume_name_buf.as_mut_ptr(), - volume_name_buf.len() as DWORD, + volume_name_buf.len() as u32, ) } { let err = IOError::last_os_error(); - if err.raw_os_error() != Some(winapi::shared::winerror::ERROR_NO_MORE_FILES as i32) - { + if err.raw_os_error() != Some(ERROR_NO_MORE_FILES as i32) { crash!(EXIT_ERR, "FindNextVolumeW failed: {}", err); } break; @@ -524,7 +518,7 @@ impl FsUsage { //path_utf8.as_ptr(), String2LPWSTR!(path.as_os_str()), root_path.as_mut_ptr(), - root_path.len() as DWORD, + root_path.len() as u32, ptr::null_mut(), ) }; diff --git a/src/uucore/src/lib/lib.rs b/src/uucore/src/lib/lib.rs index 5780092be..662a371c4 100644 --- a/src/uucore/src/lib/lib.rs +++ b/src/uucore/src/lib/lib.rs @@ -6,8 +6,8 @@ // * feature-gated external crates (re-shared as public internal modules) #[cfg(feature = "libc")] pub extern crate libc; -#[cfg(feature = "winapi")] -pub extern crate winapi; +#[cfg(all(feature = "windows-sys", target_os = "windows"))] +pub extern crate windows_sys; //## internal modules From 45dea119fa5cddba938d44d208880b82bd92403e Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 18:58:22 +0300 Subject: [PATCH 09/19] cp: remove unused `winapi` dependency --- Cargo.lock | 1 - src/uu/cp/Cargo.toml | 3 --- 2 files changed, 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 076707d31..57b6ab4ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2276,7 +2276,6 @@ dependencies = [ "selinux", "uucore", "walkdir", - "winapi", "xattr", ] diff --git a/src/uu/cp/Cargo.toml b/src/uu/cp/Cargo.toml index 2c71b725f..15ce7c8f5 100644 --- a/src/uu/cp/Cargo.toml +++ b/src/uu/cp/Cargo.toml @@ -27,9 +27,6 @@ selinux = { version="0.3", optional=true } uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries", "fs", "perms", "mode"] } walkdir = "2.2" -[target.'cfg(target_os = "windows")'.dependencies] -winapi = { version="0.3", features=["fileapi"] } - [target.'cfg(unix)'.dependencies] xattr="0.2.3" exacl= { version = "0.9.0", optional=true } From c26bf02a04a0ba0cdeba7b4daae701c88471345d Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:09:51 +0300 Subject: [PATCH 10/19] du: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/du/Cargo.toml | 2 +- src/uu/du/src/du.rs | 31 ++++++++++++------------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57b6ab4ca..fde01840b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2367,7 +2367,7 @@ dependencies = [ "clap 4.0.17", "glob", "uucore", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/du/Cargo.toml b/src/uu/du/Cargo.toml index e41cc753e..b9a3f71fc 100644 --- a/src/uu/du/Cargo.toml +++ b/src/uu/du/Cargo.toml @@ -22,7 +22,7 @@ clap = { version = "4.0", features = ["wrap_help", "cargo"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore" } [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version="0.3", features=[] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } [[bin]] name = "du" diff --git a/src/uu/du/src/du.rs b/src/uu/du/src/du.rs index 18e9a4af3..6bd59297a 100644 --- a/src/uu/du/src/du.rs +++ b/src/uu/du/src/du.rs @@ -41,15 +41,12 @@ use uucore::format_usage; use uucore::parse_glob; use uucore::parse_size::{parse_size, ParseSizeError}; #[cfg(windows)] -use winapi::shared::minwindef::{DWORD, LPVOID}; +use windows_sys::Win32::Foundation::HANDLE; #[cfg(windows)] -use winapi::um::fileapi::{FILE_ID_INFO, FILE_STANDARD_INFO}; -#[cfg(windows)] -use winapi::um::minwinbase::{FileIdInfo, FileStandardInfo}; -#[cfg(windows)] -use winapi::um::winbase::GetFileInformationByHandleEx; -#[cfg(windows)] -use winapi::um::winnt::FILE_ID_128; +use windows_sys::Win32::Storage::FileSystem::{ + FileIdInfo, FileStandardInfo, GetFileInformationByHandleEx, FILE_ID_128, FILE_ID_INFO, + FILE_STANDARD_INFO, +}; mod options { pub const HELP: &str = "help"; @@ -208,21 +205,19 @@ fn get_size_on_disk(path: &Path) -> u64 { Err(_) => return size_on_disk, // opening directories will fail }; - let handle = file.as_raw_handle(); - unsafe { let mut file_info: FILE_STANDARD_INFO = core::mem::zeroed(); let file_info_ptr: *mut FILE_STANDARD_INFO = &mut file_info; let success = GetFileInformationByHandleEx( - handle, + file.as_raw_handle() as HANDLE, FileStandardInfo, - file_info_ptr as LPVOID, - std::mem::size_of::() as DWORD, + file_info_ptr as _, + std::mem::size_of::() as u32, ); if success != 0 { - size_on_disk = *file_info.AllocationSize.QuadPart() as u64; + size_on_disk = file_info.AllocationSize as u64; } } @@ -238,17 +233,15 @@ fn get_file_info(path: &Path) -> Option { Err(_) => return result, }; - let handle = file.as_raw_handle(); - unsafe { let mut file_info: FILE_ID_INFO = core::mem::zeroed(); let file_info_ptr: *mut FILE_ID_INFO = &mut file_info; let success = GetFileInformationByHandleEx( - handle, + file.as_raw_handle() as HANDLE, FileIdInfo, - file_info_ptr as LPVOID, - std::mem::size_of::() as DWORD, + file_info_ptr as _, + std::mem::size_of::() as u32, ); if success != 0 { From 05a224d40e9b62ceb278c04ef5ca15b9af537dad Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:14:31 +0300 Subject: [PATCH 11/19] rm: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/rm/Cargo.toml | 2 +- src/uu/rm/src/rm.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fde01840b..ff9cd8db8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2800,7 +2800,7 @@ dependencies = [ "remove_dir_all 0.7.0", "uucore", "walkdir", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/rm/Cargo.toml b/src/uu/rm/Cargo.toml index 646e08005..9d372a5f5 100644 --- a/src/uu/rm/Cargo.toml +++ b/src/uu/rm/Cargo.toml @@ -21,7 +21,7 @@ remove_dir_all = "0.7.0" uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["fs"] } [target.'cfg(windows)'.dependencies] -winapi = { version="0.3", features=[] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Storage_FileSystem"] } [[bin]] name = "rm" diff --git a/src/uu/rm/src/rm.rs b/src/uu/rm/src/rm.rs index 0f080be6c..dcd457aa6 100644 --- a/src/uu/rm/src/rm.rs +++ b/src/uu/rm/src/rm.rs @@ -510,7 +510,7 @@ use std::os::windows::prelude::MetadataExt; #[cfg(windows)] fn is_symlink_dir(metadata: &fs::Metadata) -> bool { - use winapi::um::winnt::FILE_ATTRIBUTE_DIRECTORY; + use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_DIRECTORY; metadata.file_type().is_symlink() && ((metadata.file_attributes() & FILE_ATTRIBUTE_DIRECTORY) != 0) From b0b7565ba91db23af02453402284931e22d67575 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:22:05 +0300 Subject: [PATCH 12/19] hostname: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/hostname/Cargo.toml | 4 ++-- src/uu/hostname/src/hostname.rs | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff9cd8db8..a788a8744 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2498,7 +2498,7 @@ dependencies = [ "clap 4.0.17", "hostname", "uucore", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/hostname/Cargo.toml b/src/uu/hostname/Cargo.toml index 120440005..f3563be2b 100644 --- a/src/uu/hostname/Cargo.toml +++ b/src/uu/hostname/Cargo.toml @@ -20,11 +20,11 @@ hostname = { version = "0.3", features = ["set"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["wide"] } [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version="0.3", features=["sysinfoapi", "winsock2"] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Networking_WinSock", "Win32_Foundation"] } [[bin]] name = "hostname" path = "src/main.rs" [package.metadata.cargo-udeps.ignore] -normal = ["uucore_procs", "winapi"] +normal = ["uucore_procs"] diff --git a/src/uu/hostname/src/hostname.rs b/src/uu/hostname/src/hostname.rs index 7aec443a9..b9699d99a 100644 --- a/src/uu/hostname/src/hostname.rs +++ b/src/uu/hostname/src/hostname.rs @@ -32,15 +32,14 @@ static OPT_HOST: &str = "host"; mod wsa { use std::io; - use winapi::shared::minwindef::MAKEWORD; - use winapi::um::winsock2::{WSACleanup, WSAStartup, WSADATA}; + use windows_sys::Win32::Networking::WinSock::{WSACleanup, WSAStartup, WSADATA}; pub(super) struct WsaHandle(()); pub(super) fn start() -> io::Result { let err = unsafe { let mut data = std::mem::MaybeUninit::::uninit(); - WSAStartup(MAKEWORD(2, 2), data.as_mut_ptr()) + WSAStartup(0x0202, data.as_mut_ptr()) }; if err != 0 { Err(io::Error::from_raw_os_error(err)) From ff30cacbe10f124e6675cf4e49ae6dc883386cf9 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:28:30 +0300 Subject: [PATCH 13/19] date: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/date/Cargo.toml | 2 +- src/uu/date/src/date.rs | 19 ++++++++----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a788a8744..e17f84fd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2308,7 +2308,7 @@ dependencies = [ "clap 4.0.17", "libc", "uucore", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/date/Cargo.toml b/src/uu/date/Cargo.toml index de504f8c5..ffca6d3a4 100644 --- a/src/uu/date/Cargo.toml +++ b/src/uu/date/Cargo.toml @@ -23,7 +23,7 @@ uucore = { version=">=0.0.16", package="uucore", path="../../uucore" } libc = "0.2" [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3", features = ["minwinbase", "sysinfoapi", "minwindef"] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Foundation", "Win32_System_SystemInformation"] } [[bin]] name = "date" diff --git a/src/uu/date/src/date.rs b/src/uu/date/src/date.rs index 43b54898d..076cdbf43 100644 --- a/src/uu/date/src/date.rs +++ b/src/uu/date/src/date.rs @@ -23,10 +23,7 @@ use uucore::error::FromIo; use uucore::error::{UResult, USimpleError}; use uucore::{format_usage, show_error}; #[cfg(windows)] -use winapi::{ - shared::minwindef::WORD, - um::{minwinbase::SYSTEMTIME, sysinfoapi::SetSystemTime}, -}; +use windows_sys::Win32::{Foundation::SYSTEMTIME, System::SystemInformation::SetSystemTime}; // Options const DATE: &str = "date"; @@ -409,16 +406,16 @@ fn set_system_datetime(date: DateTime) -> UResult<()> { /// https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-systemtime fn set_system_datetime(date: DateTime) -> UResult<()> { let system_time = SYSTEMTIME { - wYear: date.year() as WORD, - wMonth: date.month() as WORD, + wYear: date.year() as u16, + wMonth: date.month() as u16, // Ignored wDayOfWeek: 0, - wDay: date.day() as WORD, - wHour: date.hour() as WORD, - wMinute: date.minute() as WORD, - wSecond: date.second() as WORD, + wDay: date.day() as u16, + wHour: date.hour() as u16, + wMinute: date.minute() as u16, + wSecond: date.second() as u16, // TODO: be careful of leap seconds - valid range is [0, 999] - how to handle? - wMilliseconds: ((date.nanosecond() / 1_000_000) % 1000) as WORD, + wMilliseconds: ((date.nanosecond() / 1_000_000) % 1000) as u16, }; let result = unsafe { SetSystemTime(&system_time) }; From 5ef1745960d47b3fce1c0d34d5fc041f2fcd2257 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:40:00 +0300 Subject: [PATCH 14/19] tail: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/tail/Cargo.toml | 2 +- src/uu/tail/src/platform/windows.rs | 21 ++++++++------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e17f84fd3..8972b01b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2968,8 +2968,8 @@ dependencies = [ "notify", "same-file", "uucore", - "winapi", "winapi-util", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/tail/Cargo.toml b/src/uu/tail/Cargo.toml index e417a49a5..a912bf352 100644 --- a/src/uu/tail/Cargo.toml +++ b/src/uu/tail/Cargo.toml @@ -24,7 +24,7 @@ uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=[ same-file = "1.0.6" [target.'cfg(windows)'.dependencies] -winapi = { version="0.3", features=["fileapi", "handleapi", "processthreadsapi", "synchapi", "winbase"] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_System_Threading", "Win32_Foundation"] } winapi-util = { version="0.1.5" } [target.'cfg(unix)'.dependencies] diff --git a/src/uu/tail/src/platform/windows.rs b/src/uu/tail/src/platform/windows.rs index b5c139bbd..3e4cc7edc 100644 --- a/src/uu/tail/src/platform/windows.rs +++ b/src/uu/tail/src/platform/windows.rs @@ -6,17 +6,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +use windows_sys::Win32::Foundation::{CloseHandle, BOOL, HANDLE, WAIT_FAILED, WAIT_OBJECT_0}; +use windows_sys::Win32::System::Threading::{ + OpenProcess, WaitForSingleObject, PROCESS_SYNCHRONIZE, +}; -extern crate winapi; - -use self::winapi::shared::minwindef::DWORD; -use self::winapi::um::handleapi::CloseHandle; -use self::winapi::um::processthreadsapi::OpenProcess; -use self::winapi::um::synchapi::WaitForSingleObject; -use self::winapi::um::winbase::{WAIT_FAILED, WAIT_OBJECT_0}; -use self::winapi::um::winnt::{HANDLE, SYNCHRONIZE}; - -pub type Pid = DWORD; +pub type Pid = u32; pub struct ProcessChecker { dead: bool, @@ -26,10 +21,10 @@ pub struct ProcessChecker { impl ProcessChecker { pub fn new(process_id: self::Pid) -> Self { #[allow(non_snake_case)] - let FALSE = 0i32; - let h = unsafe { OpenProcess(SYNCHRONIZE, FALSE, process_id as DWORD) }; + let FALSE: BOOL = 0; + let h = unsafe { OpenProcess(PROCESS_SYNCHRONIZE, FALSE, process_id) }; Self { - dead: h.is_null(), + dead: h == 0, handle: h, } } From 580bff02f8ba9e9dcdfcc460eab3133da26479d7 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Wed, 19 Oct 2022 23:53:26 +0300 Subject: [PATCH 15/19] sync: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/sync/Cargo.toml | 4 ++-- src/uu/sync/src/sync.rs | 53 ++++++++++++++++------------------------- 3 files changed, 23 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8972b01b4..508f03ab0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2943,7 +2943,7 @@ dependencies = [ "libc", "nix", "uucore", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/sync/Cargo.toml b/src/uu/sync/Cargo.toml index 07f7305c9..dc5754e43 100644 --- a/src/uu/sync/Cargo.toml +++ b/src/uu/sync/Cargo.toml @@ -23,11 +23,11 @@ uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=[ nix = "0.25" [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "std", "winbase", "winerror"] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Storage_FileSystem", "Win32_System_WindowsProgramming", "Win32_Foundation"] } [[bin]] name = "sync" path = "src/main.rs" [package.metadata.cargo-udeps.ignore] -normal = ["uucore_procs", "winapi"] +normal = ["uucore_procs"] diff --git a/src/uu/sync/src/sync.rs b/src/uu/sync/src/sync.rs index 5db957178..7e953d7dd 100644 --- a/src/uu/sync/src/sync.rs +++ b/src/uu/sync/src/sync.rs @@ -70,29 +70,27 @@ mod platform { #[cfg(windows)] mod platform { - extern crate winapi; - use self::winapi::shared::minwindef; - use self::winapi::shared::winerror; - use self::winapi::um::handleapi; - use self::winapi::um::winbase; - use self::winapi::um::winnt; use std::fs::OpenOptions; use std::os::windows::prelude::*; use std::path::Path; use uucore::crash; use uucore::wide::{FromWide, ToWide}; + use windows_sys::Win32::Foundation::{ + GetLastError, ERROR_NO_MORE_FILES, HANDLE, INVALID_HANDLE_VALUE, MAX_PATH, + }; + use windows_sys::Win32::Storage::FileSystem::{ + FindFirstVolumeW, FindNextVolumeW, FindVolumeClose, FlushFileBuffers, GetDriveTypeW, + }; + use windows_sys::Win32::System::WindowsProgramming::DRIVE_FIXED; unsafe fn flush_volume(name: &str) { let name_wide = name.to_wide_null(); - if winapi::um::fileapi::GetDriveTypeW(name_wide.as_ptr()) == winbase::DRIVE_FIXED { + if GetDriveTypeW(name_wide.as_ptr()) == DRIVE_FIXED { let sliced_name = &name[..name.len() - 1]; // eliminate trailing backslash match OpenOptions::new().write(true).open(sliced_name) { Ok(file) => { - if winapi::um::fileapi::FlushFileBuffers(file.as_raw_handle()) == 0 { - crash!( - winapi::um::errhandlingapi::GetLastError() as i32, - "failed to flush file buffer" - ); + if FlushFileBuffers(file.as_raw_handle() as HANDLE) == 0 { + crash!(GetLastError() as i32, "failed to flush file buffer"); } } Err(e) => crash!( @@ -103,17 +101,11 @@ mod platform { } } - unsafe fn find_first_volume() -> (String, winnt::HANDLE) { - let mut name: [winnt::WCHAR; minwindef::MAX_PATH] = [0; minwindef::MAX_PATH]; - let handle = winapi::um::fileapi::FindFirstVolumeW( - name.as_mut_ptr(), - name.len() as minwindef::DWORD, - ); - if handle == handleapi::INVALID_HANDLE_VALUE { - crash!( - winapi::um::errhandlingapi::GetLastError() as i32, - "failed to find first volume" - ); + unsafe fn find_first_volume() -> (String, HANDLE) { + let mut name: [u16; MAX_PATH as usize] = [0; MAX_PATH as usize]; + let handle = FindFirstVolumeW(name.as_mut_ptr(), name.len() as u32); + if handle == INVALID_HANDLE_VALUE { + crash!(GetLastError() as i32, "failed to find first volume"); } (String::from_wide_null(&name), handle) } @@ -122,16 +114,11 @@ mod platform { let (first_volume, next_volume_handle) = find_first_volume(); let mut volumes = vec![first_volume]; loop { - let mut name: [winnt::WCHAR; minwindef::MAX_PATH] = [0; minwindef::MAX_PATH]; - if winapi::um::fileapi::FindNextVolumeW( - next_volume_handle, - name.as_mut_ptr(), - name.len() as minwindef::DWORD, - ) == 0 - { - match winapi::um::errhandlingapi::GetLastError() { - winerror::ERROR_NO_MORE_FILES => { - winapi::um::fileapi::FindVolumeClose(next_volume_handle); + let mut name: [u16; MAX_PATH as usize] = [0; MAX_PATH as usize]; + if FindNextVolumeW(next_volume_handle, name.as_mut_ptr(), name.len() as u32) == 0 { + match GetLastError() { + ERROR_NO_MORE_FILES => { + FindVolumeClose(next_volume_handle); return volumes; } err => crash!(err as i32, "failed to find next volume"), From f95a14537b27ea47992f82a24d388d0eeed66f8e Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Thu, 20 Oct 2022 00:00:08 +0300 Subject: [PATCH 16/19] touch: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/touch/Cargo.toml | 2 +- src/uu/touch/src/touch.rs | 19 ++++++++----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 508f03ab0..cfa6d4e7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3010,7 +3010,7 @@ dependencies = [ "filetime", "time", "uucore", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/touch/Cargo.toml b/src/uu/touch/Cargo.toml index 2e3504cbe..a8fadffdb 100644 --- a/src/uu/touch/Cargo.toml +++ b/src/uu/touch/Cargo.toml @@ -21,7 +21,7 @@ time = { version = "0.3", features = ["parsing", "formatting", "local-offset", " uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["libc"] } [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "0.3" } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } [[bin]] name = "touch" diff --git a/src/uu/touch/src/touch.rs b/src/uu/touch/src/touch.rs index e94426aff..f397d2eaf 100644 --- a/src/uu/touch/src/touch.rs +++ b/src/uu/touch/src/touch.rs @@ -472,19 +472,16 @@ fn pathbuf_from_stdout() -> UResult { #[cfg(windows)] { use std::os::windows::prelude::AsRawHandle; - use winapi::shared::minwindef::{DWORD, MAX_PATH}; - use winapi::shared::winerror::{ - ERROR_INVALID_PARAMETER, ERROR_NOT_ENOUGH_MEMORY, ERROR_PATH_NOT_FOUND, + use windows_sys::Win32::Foundation::{ + GetLastError, ERROR_INVALID_PARAMETER, ERROR_NOT_ENOUGH_MEMORY, ERROR_PATH_NOT_FOUND, + HANDLE, MAX_PATH, + }; + use windows_sys::Win32::Storage::FileSystem::{ + GetFinalPathNameByHandleW, FILE_NAME_OPENED, }; - use winapi::um::errhandlingapi::GetLastError; - use winapi::um::fileapi::GetFinalPathNameByHandleW; - use winapi::um::winnt::WCHAR; - let handle = std::io::stdout().lock().as_raw_handle(); - let mut file_path_buffer: [WCHAR; MAX_PATH as usize] = [0; MAX_PATH as usize]; - - // Couldn't find this in winapi - const FILE_NAME_OPENED: DWORD = 0x8; + let handle = std::io::stdout().lock().as_raw_handle() as HANDLE; + let mut file_path_buffer: [u16; MAX_PATH as usize] = [0; MAX_PATH as usize]; // https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea#examples // SAFETY: We transmute the handle to be able to cast *mut c_void into a From 0eae0fdb744540f95e5ca789205621d73318e405 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Thu, 20 Oct 2022 00:03:28 +0300 Subject: [PATCH 17/19] whoami: migrate `winapi` to `windows-sys` crate --- Cargo.lock | 2 +- src/uu/whoami/Cargo.toml | 2 +- src/uu/whoami/src/platform/windows.rs | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cfa6d4e7d..e483c2c2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3147,7 +3147,7 @@ dependencies = [ "clap 4.0.17", "libc", "uucore", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/src/uu/whoami/Cargo.toml b/src/uu/whoami/Cargo.toml index 8f2266ff2..f3a277e89 100644 --- a/src/uu/whoami/Cargo.toml +++ b/src/uu/whoami/Cargo.toml @@ -19,7 +19,7 @@ clap = { version = "4.0", features = ["wrap_help", "cargo"] } uucore = { version=">=0.0.16", package="uucore", path="../../uucore", features=["entries"] } [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "0.3", features = ["lmcons"] } +windows-sys = { version = "0.42.0", default-features = false, features = ["Win32_NetworkManagement_NetManagement", "Win32_System_WindowsProgramming", "Win32_Foundation"] } [target.'cfg(unix)'.dependencies] libc = "0.2.135" diff --git a/src/uu/whoami/src/platform/windows.rs b/src/uu/whoami/src/platform/windows.rs index a627bed8e..3bad1eb21 100644 --- a/src/uu/whoami/src/platform/windows.rs +++ b/src/uu/whoami/src/platform/windows.rs @@ -10,17 +10,15 @@ use std::ffi::OsString; use std::io; use std::os::windows::ffi::OsStringExt; - -use winapi::shared::lmcons; -use winapi::shared::minwindef::DWORD; -use winapi::um::winbase; +use windows_sys::Win32::NetworkManagement::NetManagement::UNLEN; +use windows_sys::Win32::System::WindowsProgramming::GetUserNameW; pub fn get_username() -> io::Result { - const BUF_LEN: DWORD = lmcons::UNLEN + 1; + const BUF_LEN: u32 = UNLEN + 1; let mut buffer = [0_u16; BUF_LEN as usize]; let mut len = BUF_LEN; // SAFETY: buffer.len() == len - if unsafe { winbase::GetUserNameW(buffer.as_mut_ptr(), &mut len) } == 0 { + if unsafe { GetUserNameW(buffer.as_mut_ptr(), &mut len) } == 0 { return Err(io::Error::last_os_error()); } Ok(OsString::from_wide(&buffer[..len as usize - 1])) From 3973e8dd79342fa52be2712a940b7a264c63ea00 Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Thu, 20 Oct 2022 00:19:54 +0300 Subject: [PATCH 18/19] deny: add `windows-sys` and its subcrates as duplicates --- deny.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deny.toml b/deny.toml index 2c8a473c0..ec0e5e115 100644 --- a/deny.toml +++ b/deny.toml @@ -74,6 +74,13 @@ skip = [ { name = "clap", version = "=3.2.22" }, # bindgen (via selinux-sys & fts-sys) { name = "clap_lex", version = "=0.2.4" }, + # windows-sys (via terminal_size, crossterm -> parking_lot, notify -> filetime) + { name = "windows-sys", version = "=0.36.1" }, + { name = "windows_aarch64_msvc", version = "=0.36.1" }, + { name = "windows_i686_gnu", version = "=0.36.1" }, + { name = "windows_i686_msvc", version = "=0.36.1" }, + { name = "windows_x86_64_gnu", version = "=0.36.1" }, + { name = "windows_x86_64_msvc", version = "=0.36.1" }, ] # spell-checker: enable From 2a0ac55f9aeeb740abd57ce1654f6a0e8452542d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 06:44:57 +0000 Subject: [PATCH 19/19] build(deps): bump clap from 4.0.17 to 4.0.18 Bumps [clap](https://github.com/clap-rs/clap) from 4.0.17 to 4.0.18. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.17...v4.0.18) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 214 ++++++++++++++++++++++++++--------------------------- 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e483c2c2b..cc8cf8424 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,9 +270,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.17" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" +checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" dependencies = [ "atty", "bitflags", @@ -289,7 +289,7 @@ version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11cba7abac9b56dfe2f035098cdb3a43946f276e6db83b72c4e692343f9aab9a" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", ] [[package]] @@ -353,7 +353,7 @@ version = "0.0.16" dependencies = [ "atty", "chrono", - "clap 4.0.17", + "clap 4.0.18", "clap_complete", "conv", "filetime", @@ -2154,7 +2154,7 @@ checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" name = "uu_arch" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "platform-info", "uucore", ] @@ -2163,7 +2163,7 @@ dependencies = [ name = "uu_base32" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2179,7 +2179,7 @@ dependencies = [ name = "uu_basename" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2187,7 +2187,7 @@ dependencies = [ name = "uu_basenc" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uu_base32", "uucore", ] @@ -2197,7 +2197,7 @@ name = "uu_cat" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.17", + "clap 4.0.18", "nix", "thiserror", "uucore", @@ -2207,7 +2207,7 @@ dependencies = [ name = "uu_chcon" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "fts-sys", "libc", "selinux", @@ -2219,7 +2219,7 @@ dependencies = [ name = "uu_chgrp" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2227,7 +2227,7 @@ dependencies = [ name = "uu_chmod" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2236,7 +2236,7 @@ dependencies = [ name = "uu_chown" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2244,7 +2244,7 @@ dependencies = [ name = "uu_chroot" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2252,7 +2252,7 @@ dependencies = [ name = "uu_cksum" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2260,7 +2260,7 @@ dependencies = [ name = "uu_comm" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2268,7 +2268,7 @@ dependencies = [ name = "uu_cp" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "exacl", "filetime", "libc", @@ -2283,7 +2283,7 @@ dependencies = [ name = "uu_csplit" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "regex", "thiserror", "uucore", @@ -2295,7 +2295,7 @@ version = "0.0.16" dependencies = [ "atty", "bstr", - "clap 4.0.17", + "clap 4.0.18", "memchr", "uucore", ] @@ -2305,7 +2305,7 @@ name = "uu_date" version = "0.0.16" dependencies = [ "chrono", - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", "windows-sys 0.42.0", @@ -2316,7 +2316,7 @@ name = "uu_dd" version = "0.0.16" dependencies = [ "byte-unit", - "clap 4.0.17", + "clap 4.0.18", "gcd", "libc", "signal-hook", @@ -2327,7 +2327,7 @@ dependencies = [ name = "uu_df" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "unicode-width", "uucore", ] @@ -2336,7 +2336,7 @@ dependencies = [ name = "uu_dir" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "selinux", "uu_ls", "uucore", @@ -2346,7 +2346,7 @@ dependencies = [ name = "uu_dircolors" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "glob", "uucore", ] @@ -2355,7 +2355,7 @@ dependencies = [ name = "uu_dirname" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2364,7 +2364,7 @@ name = "uu_du" version = "0.0.16" dependencies = [ "chrono", - "clap 4.0.17", + "clap 4.0.18", "glob", "uucore", "windows-sys 0.42.0", @@ -2374,7 +2374,7 @@ dependencies = [ name = "uu_echo" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2382,7 +2382,7 @@ dependencies = [ name = "uu_env" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "nix", "rust-ini", "uucore", @@ -2392,7 +2392,7 @@ dependencies = [ name = "uu_expand" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "unicode-width", "uucore", ] @@ -2401,7 +2401,7 @@ dependencies = [ name = "uu_expr" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "num-bigint", "num-traits", "onig", @@ -2412,7 +2412,7 @@ dependencies = [ name = "uu_factor" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "coz", "num-traits", "paste", @@ -2426,7 +2426,7 @@ dependencies = [ name = "uu_false" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2434,7 +2434,7 @@ dependencies = [ name = "uu_fmt" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "unicode-width", "uucore", ] @@ -2443,7 +2443,7 @@ dependencies = [ name = "uu_fold" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2451,7 +2451,7 @@ dependencies = [ name = "uu_groups" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2461,7 +2461,7 @@ version = "0.0.16" dependencies = [ "blake2b_simd", "blake3", - "clap 4.0.17", + "clap 4.0.18", "digest", "hex", "md-5", @@ -2477,7 +2477,7 @@ dependencies = [ name = "uu_head" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "memchr", "uucore", ] @@ -2486,7 +2486,7 @@ dependencies = [ name = "uu_hostid" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2495,7 +2495,7 @@ dependencies = [ name = "uu_hostname" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "hostname", "uucore", "windows-sys 0.42.0", @@ -2505,7 +2505,7 @@ dependencies = [ name = "uu_id" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "selinux", "uucore", ] @@ -2514,7 +2514,7 @@ dependencies = [ name = "uu_install" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "file_diff", "filetime", "libc", @@ -2526,7 +2526,7 @@ dependencies = [ name = "uu_join" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "memchr", "uucore", ] @@ -2535,7 +2535,7 @@ dependencies = [ name = "uu_kill" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "nix", "uucore", ] @@ -2544,7 +2544,7 @@ dependencies = [ name = "uu_link" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2552,7 +2552,7 @@ dependencies = [ name = "uu_ln" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2560,7 +2560,7 @@ dependencies = [ name = "uu_logname" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2571,7 +2571,7 @@ version = "0.0.16" dependencies = [ "atty", "chrono", - "clap 4.0.17", + "clap 4.0.18", "glob", "lscolors", "number_prefix", @@ -2587,7 +2587,7 @@ dependencies = [ name = "uu_mkdir" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2595,7 +2595,7 @@ dependencies = [ name = "uu_mkfifo" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2604,7 +2604,7 @@ dependencies = [ name = "uu_mknod" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2613,7 +2613,7 @@ dependencies = [ name = "uu_mktemp" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "rand", "tempfile", "uucore", @@ -2624,7 +2624,7 @@ name = "uu_more" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.17", + "clap 4.0.18", "crossterm", "nix", "unicode-segmentation", @@ -2636,7 +2636,7 @@ dependencies = [ name = "uu_mv" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "fs_extra", "uucore", ] @@ -2645,7 +2645,7 @@ dependencies = [ name = "uu_nice" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "nix", "uucore", @@ -2655,7 +2655,7 @@ dependencies = [ name = "uu_nl" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "regex", "uucore", ] @@ -2665,7 +2665,7 @@ name = "uu_nohup" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2674,7 +2674,7 @@ dependencies = [ name = "uu_nproc" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "num_cpus", "uucore", @@ -2684,7 +2684,7 @@ dependencies = [ name = "uu_numfmt" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2693,7 +2693,7 @@ name = "uu_od" version = "0.0.16" dependencies = [ "byteorder", - "clap 4.0.17", + "clap 4.0.18", "half", "uucore", ] @@ -2702,7 +2702,7 @@ dependencies = [ name = "uu_paste" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2710,7 +2710,7 @@ dependencies = [ name = "uu_pathchk" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2719,7 +2719,7 @@ dependencies = [ name = "uu_pinky" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2727,7 +2727,7 @@ dependencies = [ name = "uu_pr" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "itertools", "quick-error", "regex", @@ -2739,7 +2739,7 @@ dependencies = [ name = "uu_printenv" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2747,7 +2747,7 @@ dependencies = [ name = "uu_printf" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2755,7 +2755,7 @@ dependencies = [ name = "uu_ptx" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "regex", "uucore", ] @@ -2764,7 +2764,7 @@ dependencies = [ name = "uu_pwd" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2772,7 +2772,7 @@ dependencies = [ name = "uu_readlink" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2780,7 +2780,7 @@ dependencies = [ name = "uu_realpath" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2788,7 +2788,7 @@ dependencies = [ name = "uu_relpath" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2796,7 +2796,7 @@ dependencies = [ name = "uu_rm" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "remove_dir_all 0.7.0", "uucore", "walkdir", @@ -2807,7 +2807,7 @@ dependencies = [ name = "uu_rmdir" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", ] @@ -2816,7 +2816,7 @@ dependencies = [ name = "uu_runcon" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "selinux", "thiserror", @@ -2828,7 +2828,7 @@ name = "uu_seq" version = "0.0.16" dependencies = [ "bigdecimal", - "clap 4.0.17", + "clap 4.0.18", "num-bigint", "num-traits", "uucore", @@ -2838,7 +2838,7 @@ dependencies = [ name = "uu_shred" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "rand", "uucore", ] @@ -2847,7 +2847,7 @@ dependencies = [ name = "uu_shuf" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "memchr", "rand", "rand_core", @@ -2858,7 +2858,7 @@ dependencies = [ name = "uu_sleep" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2867,7 +2867,7 @@ name = "uu_sort" version = "0.0.16" dependencies = [ "binary-heap-plus", - "clap 4.0.17", + "clap 4.0.18", "compare", "ctrlc", "fnv", @@ -2885,7 +2885,7 @@ dependencies = [ name = "uu_split" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "memchr", "uucore", ] @@ -2894,7 +2894,7 @@ dependencies = [ name = "uu_stat" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2902,7 +2902,7 @@ dependencies = [ name = "uu_stdbuf" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "tempfile", "uu_stdbuf_libstdbuf", "uucore", @@ -2922,7 +2922,7 @@ dependencies = [ name = "uu_stty" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "nix", "uucore", ] @@ -2931,7 +2931,7 @@ dependencies = [ name = "uu_sum" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -2939,7 +2939,7 @@ dependencies = [ name = "uu_sync" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "nix", "uucore", @@ -2950,7 +2950,7 @@ dependencies = [ name = "uu_tac" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "memchr", "memmap2", "regex", @@ -2961,7 +2961,7 @@ dependencies = [ name = "uu_tail" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "memchr", "nix", @@ -2976,7 +2976,7 @@ dependencies = [ name = "uu_tee" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "retain_mut", "uucore", @@ -2986,7 +2986,7 @@ dependencies = [ name = "uu_test" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "redox_syscall", "uucore", @@ -2996,7 +2996,7 @@ dependencies = [ name = "uu_timeout" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "nix", "uucore", @@ -3006,7 +3006,7 @@ dependencies = [ name = "uu_touch" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "filetime", "time", "uucore", @@ -3017,7 +3017,7 @@ dependencies = [ name = "uu_tr" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "nom", "uucore", ] @@ -3026,7 +3026,7 @@ dependencies = [ name = "uu_true" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3034,7 +3034,7 @@ dependencies = [ name = "uu_truncate" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3042,7 +3042,7 @@ dependencies = [ name = "uu_tsort" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3051,7 +3051,7 @@ name = "uu_tty" version = "0.0.16" dependencies = [ "atty", - "clap 4.0.17", + "clap 4.0.18", "nix", "uucore", ] @@ -3060,7 +3060,7 @@ dependencies = [ name = "uu_uname" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "platform-info", "uucore", ] @@ -3069,7 +3069,7 @@ dependencies = [ name = "uu_unexpand" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "unicode-width", "uucore", ] @@ -3078,7 +3078,7 @@ dependencies = [ name = "uu_uniq" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "strum", "strum_macros", "uucore", @@ -3088,7 +3088,7 @@ dependencies = [ name = "uu_unlink" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3097,7 +3097,7 @@ name = "uu_uptime" version = "0.0.16" dependencies = [ "chrono", - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3105,7 +3105,7 @@ dependencies = [ name = "uu_users" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3113,7 +3113,7 @@ dependencies = [ name = "uu_vdir" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "selinux", "uu_ls", "uucore", @@ -3124,7 +3124,7 @@ name = "uu_wc" version = "0.0.16" dependencies = [ "bytecount", - "clap 4.0.17", + "clap 4.0.18", "libc", "nix", "unicode-width", @@ -3136,7 +3136,7 @@ dependencies = [ name = "uu_who" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "uucore", ] @@ -3144,7 +3144,7 @@ dependencies = [ name = "uu_whoami" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "uucore", "windows-sys 0.42.0", @@ -3154,7 +3154,7 @@ dependencies = [ name = "uu_yes" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "libc", "nix", "uucore", @@ -3164,7 +3164,7 @@ dependencies = [ name = "uucore" version = "0.0.16" dependencies = [ - "clap 4.0.17", + "clap 4.0.18", "data-encoding", "data-encoding-macro", "dns-lookup",