Skip to content

Commit 2b37fda

Browse files
authored
Merge branch 'main' into patch-1
2 parents bd360b8 + 87ba3af commit 2b37fda

File tree

30 files changed

+859
-236
lines changed

30 files changed

+859
-236
lines changed

.github/workflows/GnuTests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ name: GnuTests
66
# spell-checker:ignore (options) Ccodegen Coverflow Cpanic Zpanic
77
# spell-checker:ignore (people) Dawid Dziurla * dawidd dtolnay
88
# spell-checker:ignore (vars) FILESET SUBDIRS XPASS
9+
# spell-checker:ignore userns
910

1011
# * note: to run a single test => `REPO/util/run-gnu-test.sh PATH/TO/TEST/SCRIPT`
1112

@@ -58,7 +59,7 @@ jobs:
5859
path: |
5960
gnu/config.cache
6061
gnu/src/getlimits
61-
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('gnu/configure') }}
62+
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }} # use build-gnu.sh for extremely safe caching
6263

6364
#### Build environment setup
6465
- name: Install dependencies
@@ -110,12 +111,15 @@ jobs:
110111
path: |
111112
gnu/config.cache
112113
gnu/src/getlimits
113-
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('gnu/configure') }}
114+
key: ${{ runner.os }}-gnu-config-${{ hashFiles('gnu/NEWS') }}-${{ hashFiles('uutils/util/build-gnu.sh') }}
114115

115116
### Run tests as user
116117
- name: Run GNU tests
117118
shell: bash
118119
run: |
120+
## Use unshare
121+
sudo sysctl -w kernel.unprivileged_userns_clone=1
122+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
119123
## Run GNU tests
120124
path_GNU='gnu'
121125
path_UUTILS='uutils'

docs/src/extensions.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ Similar to the proc-ps implementation and unlike GNU/Coreutils, `uptime` provide
190190

191191
Just like on macOS, `base32/base64/basenc` provides `-D` to decode data.
192192

193-
## `shred`
194-
195-
The number of random passes is deterministic in both GNU and uutils. However, uutils `shred` computes the number of random passes in a simplified way, specifically `max(3, x / 10)`, which is very close but not identical to the number of random passes that GNU would do. This also satisfies an expectation that reasonable users might have, namely that the number of random passes increases monotonically with the number of passes overall; GNU `shred` violates this assumption.
196-
197193
## `unexpand`
198194

199195
GNU `unexpand` provides `--first-only` to convert only leading sequences of blanks. We support a

src/uu/cat/locales/en-US.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ cat-error-unknown-filetype = unknown filetype: { $ft_debug }
1919
cat-error-is-directory = Is a directory
2020
cat-error-input-file-is-output-file = input file is output file
2121
cat-error-too-many-symbolic-links = Too many levels of symbolic links
22+
cat-error-no-such-device-or-address = No such device or address

src/uu/cat/locales/fr-FR.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ cat-error-unknown-filetype = type de fichier inconnu : { $ft_debug }
1919
cat-error-is-directory = Est un répertoire
2020
cat-error-input-file-is-output-file = le fichier d'entrée est le fichier de sortie
2121
cat-error-too-many-symbolic-links = Trop de niveaux de liens symboliques
22+
cat-error-no-such-device-or-address = Aucun appareil ou adresse de ce type

src/uu/cat/src/cat.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@ use memchr::memchr2;
1313
use std::ffi::OsString;
1414
use std::fs::{File, metadata};
1515
use std::io::{self, BufWriter, ErrorKind, IsTerminal, Read, Write};
16-
/// Unix domain socket support
17-
#[cfg(unix)]
18-
use std::net::Shutdown;
1916
#[cfg(unix)]
2017
use std::os::fd::AsFd;
2118
#[cfg(unix)]
2219
use std::os::unix::fs::FileTypeExt;
23-
#[cfg(unix)]
24-
use std::os::unix::net::UnixStream;
2520
use thiserror::Error;
2621
use uucore::display::Quotable;
2722
use uucore::error::UResult;
@@ -103,6 +98,9 @@ enum CatError {
10398
},
10499
#[error("{}", translate!("cat-error-is-directory"))]
105100
IsDirectory,
101+
#[cfg(unix)]
102+
#[error("{}", translate!("cat-error-no-such-device-or-address"))]
103+
NoSuchDeviceOrAddress,
106104
#[error("{}", translate!("cat-error-input-file-is-output-file"))]
107105
OutputIsInput,
108106
#[error("{}", translate!("cat-error-too-many-symbolic-links"))]
@@ -395,15 +393,7 @@ fn cat_path(path: &OsString, options: &OutputOptions, state: &mut OutputState) -
395393
}
396394
InputType::Directory => Err(CatError::IsDirectory),
397395
#[cfg(unix)]
398-
InputType::Socket => {
399-
let socket = UnixStream::connect(path)?;
400-
socket.shutdown(Shutdown::Write)?;
401-
let mut handle = InputHandle {
402-
reader: socket,
403-
is_interactive: false,
404-
};
405-
cat_handle(&mut handle, options, state)
406-
}
396+
InputType::Socket => Err(CatError::NoSuchDeviceOrAddress),
407397
_ => {
408398
let file = File::open(path)?;
409399
if is_unsafe_overwrite(&file, &io::stdout()) {

src/uu/cksum/src/cksum.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
216216
algo_kind: algo,
217217
output_format,
218218
line_ending,
219-
binary: false,
220-
no_names: false,
221219
};
222220

223221
perform_checksum_computation(opts, files)?;

src/uu/df/locales/en-US.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ df-after-help = Display values are in units of the first available SIZE from --b
77
88
SIZE is an integer and optional unit (example: 10M is 10*1024*1024).
99
Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB,... (powers
10-
of 1000).
10+
of 1000). Units can be decimal, hexadecimal, octal, binary.
1111
1212
# Help messages
1313
df-help-print-help = Print help information.

src/uu/df/locales/fr-FR.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ df-after-help = Les valeurs affichées sont en unités de la première TAILLE di
77
88
TAILLE est un entier et une unité optionnelle (exemple : 10M est 10*1024*1024).
99
Les unités sont K, M, G, T, P, E, Z, Y (puissances de 1024) ou KB, MB,... (puissances
10-
de 1000).
10+
de 1000). Les unités peuvent être décimales, hexadécimales, octales, binaires.
1111
1212
# Messages d'aide
1313
df-help-print-help = afficher les informations d'aide.

src/uu/du/locales/en-US.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ du-after-help = Display values are in units of the first available SIZE from --b
77
88
SIZE is an integer and optional unit (example: 10M is 10*1024*1024).
99
Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB,... (powers
10-
of 1000).
10+
of 1000). Units can be decimal, hexadecimal, octal, binary.
1111
1212
PATTERN allows some advanced exclusions. For example, the following syntaxes
1313
are supported:

src/uu/du/locales/fr-FR.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ du-after-help = Les valeurs affichées sont en unités de la première TAILLE di
77
88
TAILLE est un entier et une unité optionnelle (exemple : 10M est 10*1024*1024).
99
Les unités sont K, M, G, T, P, E, Z, Y (puissances de 1024) ou KB, MB,... (puissances
10-
de 1000).
10+
de 1000). Les unités peuvent être décimales, hexadécimales, octales, binaires.
1111
1212
MOTIF permet des exclusions avancées. Par exemple, les syntaxes suivantes
1313
sont supportées :

0 commit comments

Comments
 (0)