chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
Completes the English-only standardization for code, comments, scripts and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en, untouched). Covers the remaining crates/, apps/gui/ui/ and apps/gui/src-tauri/ comments, .gitea/ workflow and template comments, .githooks/ hooks, and the scripts/ source comments for the files already renamed in a prior commit (check.sh, generate-logo.py, install-hooks.sh). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
1 parent
da212e6926
commit
6328220c60
129 files changed
+1961
-1834
No files matched your search
@@ -1,5 +1,5 @@
|
||||
//! XFS: imagem real do mkfs.xfs + exclusão simulada (inode liberado e entrada de diretório
|
||||
//! liberada, como o kernel deixa) e a imagem de referência do dfvfs.
|
||||
//! XFS: real `mkfs.xfs` image + simulated unlink (freed inode with leftover extents and freed
|
||||
//! directory entry, matching XFS v4/unwiped behavior) plus the `dfvfs` reference image.
|
||||
|
||||
mod common;
|
||||
use common::*;
|
||||
@@ -135,19 +135,19 @@ fn deleted_file_is_recovered_from_free_inode_and_stale_directory_entry() {
|
||||
|
||||
let mut b = std::fs::read(&img).unwrap();
|
||||
let bs = 4096usize;
|
||||
// extents do arquivo (no inode, formato 3)
|
||||
// read the file's inline extent list before simulating deletion
|
||||
assert_eq!(b[ino_off + 5], 2);
|
||||
let nex = be32(&b[ino_off..], 76) as usize;
|
||||
let exts: Vec<_> = (0..nex)
|
||||
.map(|i| unpack(&b[ino_off + 176 + i * 16..]))
|
||||
.collect();
|
||||
assert!(exts.iter().map(|e| e.2).sum::<u64>() * 4096 >= 150_000);
|
||||
// 1) libera o inode como o kernel: modo 0, links 0, tamanho 0, 0 extents
|
||||
// 1) free the inode (mode = 0, nlink = 0, size = 0, nextents = 0) while leaving fork bytes
|
||||
b[ino_off + 2..ino_off + 4].fill(0);
|
||||
b[ino_off + 16..ino_off + 20].fill(0);
|
||||
b[ino_off + 56..ino_off + 64].fill(0);
|
||||
b[ino_off + 76..ino_off + 80].fill(0);
|
||||
// 2) marca livre na árvore de inodes (AGI -> raiz folha)
|
||||
// 2) mark the inode bit as free in the AGI `inobt` root leaf
|
||||
let agno = (ino >> (agblklog + inopblog)) as usize;
|
||||
let ag_off = agno * agblocks as usize * bs;
|
||||
let agi = &b[ag_off + 2 * 512..ag_off + 2 * 512 + 64];
|
||||
@@ -169,7 +169,7 @@ fn deleted_file_is_recovered_from_free_inode_and_stale_directory_entry() {
|
||||
}
|
||||
}
|
||||
assert!(done);
|
||||
// 3) devolve os blocos à árvore de espaço livre (folha única)
|
||||
// 3) return the file's data blocks to the AGF `bnobt` free-space B+tree leaf
|
||||
let agf = &b[ag_off + 512..ag_off + 512 + 64].to_vec();
|
||||
let (broot, blevel) = (be32(agf, 16) as usize, be32(agf, 28));
|
||||
assert_eq!(blevel, 1);
|
||||
@@ -199,7 +199,7 @@ fn deleted_file_is_recovered_from_free_inode_and_stale_directory_entry() {
|
||||
b[bb + 56 + i * 8 + 4..bb + 56 + i * 8 + 8].copy_from_slice(&r.1.to_be_bytes());
|
||||
}
|
||||
b[bb + 6..bb + 8].copy_from_slice(&(merged.len() as u16).to_be_bytes());
|
||||
// 4) entrada de diretório liberada: perde os 4 primeiros bytes do inode (viram marca + tamanho)
|
||||
// 4) mark the directory entry freed: overwrite the upper 4 bytes of its 8-byte inode with `(0xFFFF, length)`
|
||||
let name = b"relatorio.dat";
|
||||
let pos = (0..b.len() - 20)
|
||||
.find(|&p| {
|
||||
@@ -241,10 +241,10 @@ fn deleted_file_is_recovered_from_free_inode_and_stale_directory_entry() {
|
||||
assert!(rep.failed.is_empty());
|
||||
let rp = PathBuf::from(&rep.recovered[0].path);
|
||||
let got = std::fs::read(if rp.is_absolute() { rp } else { out.join(rp) }).unwrap();
|
||||
// O tamanho exato se perde na exclusão: o arquivo vem com os blocos inteiros (150000 bytes + preenchimento).
|
||||
// Exact byte size was zeroed on deletion: recovered size is rounded up to full filesystem blocks.
|
||||
assert!(got.starts_with(&doc), "conteúdo inicial difere");
|
||||
assert_eq!(got.len() % 4096, 0);
|
||||
// Só um arquivo apagado.
|
||||
// Only the deleted file is reported (live files are excluded).
|
||||
assert_eq!(
|
||||
c.found.iter().filter(|f| f.origin == Origin::Xfs).count(),
|
||||
1
|
||||
@@ -269,14 +269,14 @@ fn reference_image_is_recognized() {
|
||||
assert_eq!(l.partitions[0].fs, FsKind::Xfs);
|
||||
}
|
||||
|
||||
/// Meta: exclusão feita pelo kernel (scripts/make-xfs-real-deletion.sh, precisa de root): cada
|
||||
/// arquivo apagado volta pelo nome, na pasta certa, com o conteúdo original no começo, e os que
|
||||
/// ficaram não aparecem como apagados.
|
||||
/// Target goal for kernel-level XFS v5 unlink (`scripts/make-xfs-real-deletion.sh`, requires root):
|
||||
/// each deleted file should be recovered with its original name, folder, and content without
|
||||
/// reporting live files as deleted.
|
||||
///
|
||||
/// Currently `#[ignore]` because on XFS v5 the Linux kernel zeroes the inode fork on unlink,
|
||||
/// so recovering filenames and extents from a real XFS v5 unlink requires parsing the XFS
|
||||
/// journal log. Run with `cargo test -p guara-core --test xfs -- --ignored`.
|
||||
///
|
||||
/// HOJE FALHA, e é por isso que está `ignore`: num XFS v5 real o kernel zera o inode e a lista de
|
||||
/// extensões ao apagar, então só a simulação (teste acima) deixa a metadados para ler. Recuperar
|
||||
/// nome e conteúdo de um XFS real exige ler o diário (log) do sistema de arquivos. Rodar com
|
||||
/// `cargo test -p guara-core --test xfs -- --ignored` para ver o estado.
|
||||
#[test]
|
||||
#[ignore = "XFS real: o kernel apaga os metadados; falta ler o diário (ver ROADMAP)"]
|
||||
fn real_kernel_deletion_names_are_recovered() {
|
||||
@@ -358,7 +358,7 @@ fn real_kernel_deletion_names_are_recovered() {
|
||||
out.path().join(name).join(rp)
|
||||
})
|
||||
.unwrap();
|
||||
// o tamanho exato se perde na exclusão: o arquivo vem com os blocos inteiros
|
||||
// exact byte size is lost on unlink: recovered size is rounded up to full blocks
|
||||
assert!(
|
||||
got.len() as u64 >= *size,
|
||||
"{rel}: veio menor ({} < {size})",
|
||||
@@ -372,9 +372,9 @@ fn real_kernel_deletion_names_are_recovered() {
|
||||
}
|
||||
}
|
||||
|
||||
/// O que funciona hoje num XFS apagado de verdade: o conteúdo dos blocos livres continua lá e a
|
||||
/// varredura profunda recupera, por carving, o arquivo com estrutura reconhecível (SQLite), com
|
||||
/// o conteúdo idêntico ao original. O nome e a pasta se perdem.
|
||||
/// What works today on a real kernel-unlinked XFS v5 image: the freed data blocks remain intact
|
||||
/// on disk and deep scan recovers structured files (such as SQLite) via signature carving with
|
||||
/// bit-identical content (though original filename and folder path are lost).
|
||||
#[test]
|
||||
fn real_kernel_deletion_content_is_recovered_by_carving() {
|
||||
let dir =
|
||||
|
||||
Reference in new issue
Block a user