mv --exchange with one source swaps the entire target directory without -T
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
The bug is in the two-operand branch of exchange_paths in src/uu/mv/src/mv.rs, which passes the target directory itself to exchange_two_paths instead of the path inside it. Read that branch and compare it with the -T and multiple-source handling, then reproduce with the shell snippet in the issue. Done means one source with a populated target directory and no -T swaps the source with target/<source basename>, exits 0 as GNU does, and a regression test in the mv test suite covers this case.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With one source and no -T, mv --exchange manifest release/ swaps the file with the whole release directory and exits 0. Unrelated files move with it.
work=$(mktemp -d) && cd "$work" || exit 1
mkdir release
printf 'staged\n' > manifest
printf 'current\n' > release/manifest
printf 'other\n' > release/notes
mv --exchange manifest release/
find . -type f | LC_ALL=C sort
GNU swaps manifest and release/manifest. The unrelated file stays at release/notes. On uutils, release is now a regular file containing staged, and the entire directory is now at manifest (including manifest/notes and manifest/manifest).
Repeating in a fresh directory without release/manifest, GNU exits 1 and leaves both paths in place. uutils still exchanges the directory and exits 0. With explicit -T, both implementations exchange the whole directory.
Verified on x86_64 Linux with uutils 0.12.0, 0.13.0 and main at 8b16a3dca86ae91df73db3d375205eb7718c4c03 against GNU 9.7 and 9.12. The two-operand arm of exchange_paths passes the target directory itself to exchange_two_paths. Existing tests cover -T and multiple sources. A regression test with one source and a populated target directory without -T would catch this. https://github.com/uutils/coreutils/blob/8b16a3dca86ae91df73db3d375205eb7718c4c03/src/uu/mv/src/mv.rs#L640-L657
- Lingua principale
- Rust
- Stelle
- 24.4k
- Fork
- 2.2k
- Merge medio
- 2g 23h
- PR unite (30g)
- 402
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di uutils/coreutils
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
split -n leaves bytes from a previous run in chunks that should be emptyForse già presa @costajohnt l’ha presa 2 giorni fa. ApertaU - split
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
dircolors: '=' is not escaped and '^'/'\\' do not toggle the backslash state, unlike GNUForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaU - dircolors
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
U - shred
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
chown -v: `+ID` spec echoed verbatim on a broken symlinkForse già presa @sunsss123soldier l’ha presa 7 giorni fa. Apertagood first issue oss-scanner U - chown
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di uutils/coreutils
Issue simili
-
marketing
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
S: Untriaged T: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
libnyanpasu/clash-nyanpasu#6537 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 62/100
tauri-apps/tao#1445 ·
I maintainer di solito rispondono entro 1 giorno
-
bug P3
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
go good first issue test
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 2 giorni