Commit Graph
3213 Commits
Author SHA1 Message Date
William Dunn aa4647a777 craft-cloud-local: confine every path through a Dir capability, not a path string
benandez's re-review reproduced three escapes the first confinement fix still
left open. A dangling symlink: canonicalize reported it as missing, so the
old confine_to_root walked up to root and accepted it, and write created the
symlink's target for real, outside root. A check-then-use race: confine_to_root
checked one path string and a later fs::read or fs::write resolved that same
string again, a second lookup a concurrently swapped link could land in
between. A hard link: write truncated the shared inode in place, with nothing
in a canonicalized path to show that another name pointed at the same file
outside root.

list, read, write and create now resolve every already segment-checked
relative path through a cap_std::fs::Dir capability opened on root, instead
of joining an absolute OS path and handing it to plain std::fs. cap_std
resolves one path component at a time against real, already-open directory
handles, so a symlink or a Windows junction cannot walk resolution above
root, dangling or not, and there is no separate check with a window for the
directory tree to change underneath it: the one resolution is the open. This
is the same family of guarantee craft-font-store already depends on through
cap-primitives, which cap_std is built on.

write no longer truncates its target in place either way: it writes a new
sibling file and renames it over the target, so a hard link's directory
entry is replaced rather than its shared content being overwritten.

Per that review's non-blocking notes: a name that already exists on disk
with an ordinary ':' or '\' byte (macOS stores a typed '/' as ':') stays
reachable by list and read, since neither character is a path separator on
any platform's filesystem; the stricter refusal now applies only to a name
being chosen by Create. Create also goes back to bringing a fresh root into
existence, matching its behaviour before the first confinement fix. A
Windows reserved device name (CON, COM1, CONIN$, with or without an
extension) is refused in a chosen name on every platform.

Regression tests reproduce all three escapes (dangling symlink, swapped-link
race, hard link), plus the previously missing coverage: a link in the folder
a Create targets, and a write test that actually reaches disk instead of
being refused for an unrelated reason before confinement ever ran. Verified
by hand that each of the three new write-path tests fails against the
pre-fix pattern (an absolute OS path joined by string concatenation) before
trusting them.
2026-11-17 00:51:58 -05:00
William Dunn e5e9433413 craft-cloud-local: confine list, read, write and create to the configured root
FredApps' re-review found that resolve only split on slash and rejected a
segment equal to parent-dir, with no constraint on a Windows backslash, a
drive letter or UNC prefix, or a filesystem link, and that create joined
the Job::Create name onto the resolved folder with no validation of the
name at all.

Every path segment, and a Create name on its own, now goes through one
shared confine_segment check: accepted only when it parses as exactly one
Component::Normal equal to the original text, with a backslash or colon
refused outright first so a Windows-shaped escape cannot slip past a
Linux build's narrower native parser. A second shared check, confine_to_root,
canonicalises the nearest existing ancestor of a resolved path and
confirms it still sits under the canonicalised root, refusing a symlink or
a Windows junction that would otherwise redirect outside it. List, read,
write and create all run both checks before touching disk.

Regression tests cover the review's own examples (a parent segment, an
absolute path, the three Windows-shaped forms) for Create, the same
Windows-shaped escape for a List folder path, and a symlink (Unix) or
junction (Windows) placed inside the root for list, read and write, each
against a sibling sentinel file and directory that must stay untouched.
2026-11-16 23:48:02 -05:00
skylar taylor-barrick d93b55f7ff fix(cloud): retain conflict-copy identity through retries 2026-11-16 23:48:02 -05:00
William Dunn 658cc01501 craft-ui cloud: stop using unreachable in the conflict modal tests
clippy::unreachable is denied at the crate root with no in-tests
carve-out, unlike unwrap, expect and panic. The three let-else
fallbacks in conflict_tests.rs now panic with a message instead,
matching the pattern used everywhere else in this crate's tests.
2026-11-16 23:48:02 -05:00
William Dunn c5e9e87309 craft-cloud-local: fix stale etag and racing create
Read now stats the file it just read. The returned entry reflects
that read. It no longer echoes the etag of the entry passed in. A
reload after a conflict used to carry the version that was just
refused into the next save, conflicting it again.

Create opens the file with exclusive creation. An exists check no
longer precedes a separate write. Two creates of the same name can no
longer both observe an empty slot and both report success. Regression
tests drive both fixes through craft_ui::cloud's public functions
against a real folder on disk.
2026-11-16 23:48:02 -05:00
William Dunn b49ac50ed5 craft-ui cloud: fix conflict modal and session identity bugs
Reload from the conflict modal now acts on the conflicted document's
uid. Save as a copy acts on that same uid too. Neither acts on the
active tab anymore. A window with more than one document open keeps
them separate.

Sign-out bumps an account generation. Sign-in bumps it too. Each
clears busy. A job's reply carries the generation it was issued
under. A reply from an older generation gets dropped. A stale session
cannot restore its account or its files over a newer one. A job that
never answers cannot refuse every save afterward. Regression tests
for both pairs of findings run through a held backend that answers
jobs on the test's own schedule.
2026-11-16 23:48:01 -05:00
William Dunn a170341225 craft-cloud-local test: name the opened-documents type
The current clippy warns on the inline Arc Mutex tuple type in the test harness. A named OpenedDocs alias carries the same meaning.
2026-11-16 23:48:00 -05:00
William Dunn 07d2747efc craft-cloud-local: collapse the etag conflict check into one let chain
The current clippy denies collapsible_if here. Behaviour is unchanged. A missing file still has nothing to conflict with.
2026-11-16 23:48:00 -05:00
William Dunn b1fce2be74 craft-ui cloud pages: move off deprecated egui aliases
The current egui pin denies the deprecated egui::WidgetType alias and egui::Id::new. The slice's pages (account, cloud, share, presence, the menu helper) move to egui::Role::Button and egui::Id::unique, the same spellings main's craft-ui already uses.
2026-11-16 23:47:59 -05:00
William Dunn 8334fd3c83 craft-cloud: cut-down contract plus ui pages 2026-11-16 23:47:58 -05:00
Dylan M. TayloranddotCooCoo 453b0da782 Restore XLSB fixtures and Unix atomic-report test compilation (#1994)
* xtask: delegate Unix group restoration in report test filesystem

* craft-xlsx: xlsb tests unwrap the zip fixture's Result

#1386 made the test zip writer return Result<Vec<u8>, Error>. The xlsb
tests from #1263, #1323, #1330 and #1337 merged alongside it and still
used the return value as bytes, so `cargo check --workspace --tests`
failed on main with seven E0308 errors in crates/xlsx/tests/xlsb.rs.
These call sites now unwrap the result, as #1386 did for the others.

---------

Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
2026-11-16 23:06:56 -05:00
Dylan M. Taylor 064afccce8 craft-penpot: incremental container writer for bounded serialization (#1985) 2026-11-16 23:01:56 -05:00
Dylan M. Taylor af9985523a svg: share bounded prefix-preserving kurbo path parsing (#1972) 2026-11-16 22:37:02 -05:00
Dylan M. Taylor de97c35f2b craft-palette: share bounded GIMP palette reading from AniCraft (#1977) 2026-11-16 22:30:28 -05:00
Dylan M. Taylor fbb3f47f7a craft-markdown: share extracted-text paragraphs and pipe-table writer (#1981) 2026-11-16 22:24:56 -05:00
Dylan M. Taylor 06496f5bf2 craft-psd: decode strict PackBits rows into caller-owned slices (#1978) 2026-11-16 22:22:35 -05:00
Dylan M. Taylor bee6842e8a lottie: caller-owned numeric precision for Bezier path writing (#1979) 2026-11-16 22:22:32 -05:00
Dylan M. Taylor c153d95e55 craft-plist: explicit legacy binary minor-version compatibility (#1980) 2026-11-16 22:22:29 -05:00
Dylan M. Taylor 08e922c020 Merge pull request #1973 from storytold/fix/flow-hsl-numeric-scale
fix(flow): use percentage scale for numeric HSL channels
2026-11-16 21:49:33 -05:00
.CooCoo 64b181977a update: inspect a release the app offers on its own thread, not in offer (#1149) 2026-11-16 21:37:22 -05:00
.CooCoo 49f88cbed4 craft-update: an AppImage install that stopped partway no longer leaves its copy behind (#1159) 2026-11-16 21:37:17 -05:00
Nibras Abo Alzahab 185ba5bca3 craft-ai: shared AI providers — BYO endpoints and one-click local models (#1181) 2026-11-16 21:37:13 -05:00
.CooCoo a50bf4a94c craft-ui: a combo box cut short shows its selected text in full on hover (#1207) 2026-11-16 21:37:09 -05:00
.CooCoo c7bb86a7f5 prepress: an even-odd clip stays even-odd when its nonzero rebuild fails (#1260) 2026-11-16 21:36:55 -05:00
.CooCoo d6b2db7031 update: Later on a ready update no longer closes the app after a save (#1262) 2026-11-16 21:36:51 -05:00
.CooCoo fef9459b3f craft-mesh: list FBX and 3MF once in the READMEs and correct the crate description (#1268) 2026-11-16 21:36:48 -05:00
.CooCoo b554424c08 docking: a restored native window opens in the monitor's work area (#1270) 2026-11-16 21:36:37 -05:00
.CooCoo 5018f14e14 craft-update: process and install tests no longer depend on sleeps or short time limits (#1274) 2026-11-16 21:36:32 -05:00
Bruno 1c927e5e4d craft-raw: a CR2 opens with the camera's aspect crop (AspectInfo), as a CR3 does (#1336) 2026-11-16 21:36:28 -05:00
mtlcl410 19f851b8db craft-pdf: crypt and cos read every password spelling and key length other readers accept, and report crypt filter methods they can't decrypt (#1343) 2026-11-16 21:36:23 -05:00
.CooCoo 30a3dbae95 craft-affinity: pin every name from the PhotoCraft and VectorCraft Affinity corpus lists (#1372) 2026-11-16 21:36:17 -05:00
.CooCoo 8e22dc4541 craft-xls: test fixtures that cannot be built as asked return an error (#1374) 2026-11-16 21:36:11 -05:00
.CooCoo 4dc91cdaf8 craft-xls: the testing module is built only for tests and the test-support feature (#1377) 2026-11-16 21:36:07 -05:00
.CooCoo 27fe59ab79 craft-raw: the pinned RAF corpus list separates digest and path with a tab (#1379) 2026-11-16 21:36:03 -05:00
.CooCoo e62945a8da craft-psd: test-support is the name of the testgen feature, which stays as an alias (#1380) 2026-11-16 21:36:00 -05:00
.CooCoo 20389ae46a craft-heif: the fixture writer feature is named test-support (#1381) 2026-11-16 21:35:56 -05:00
.CooCoo 2b47d508da craft-image-codecs: test PngSuite against one pinned SHA-256 list (#1382) 2026-11-16 21:35:52 -05:00
.CooCoo d21fa0f65e craft-pst: name the test writer's feature test-support, with test-writer as its alias (#1383) 2026-11-16 21:35:49 -05:00
.CooCoo d33b8a228f craft-ods: test fixtures return the writer's error instead of empty bytes (#1384) 2026-11-16 21:35:45 -05:00
.CooCoo 05d5350511 craft-ui: testing gains shared input steps and a review screenshot folder (#1385) 2026-11-16 21:35:41 -05:00
.CooCoo d55f0505c9 craft-xlsx: test fixtures return the writer's error instead of empty bytes (#1386) 2026-11-16 21:35:37 -05:00
.CooCoo 3948c83c00 craft-xlsx: the testing module is built only for tests and the test-support feature (#1387) 2026-11-16 21:35:33 -05:00
.CooCoo 33fcc89398 craft-pdf: test-support exports the test PDF builder as craft_pdf::testing::Pdf (#1398) 2026-11-16 21:35:17 -05:00
.CooCoo 2c5f2e10b5 craft-xtask: add the asset attribution check against a document and folders the app supplies (#1424) 2026-11-16 21:34:47 -05:00
.CooCoo c91e32eb67 craft-media-testkit: run hostile and with_deadline on craft-testkit (#1462) 2026-11-16 21:34:35 -05:00
.CooCoo e2583a4a58 craft-ods: add an option to cut text past max_text short instead of refusing (#1482) 2026-11-16 21:34:31 -05:00
Ken Mantle b8eaa8e2f3 pdf: blend each element of a non-isolated knockout group with its backdrop (#1137) 2026-11-16 21:32:26 -05:00
Ken Mantle 94ad5948a8 press-print: print a page through craft-prepress plates, application-managed (#1138) 2026-11-16 21:32:22 -05:00
.CooCoo e36f7973da craft-texture: add height to normal and ORM packing over row-read sources (#1403) 2026-11-16 21:32:18 -05:00
midasmatterhorn 93598bc018 craft-docx: documentProtection without w:enforcement is enforced, as in Word, and survives a save (#1750) 2026-11-16 21:31:25 -05:00