Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: folbricht/desync
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.1
Choose a base ref
...
head repository: folbricht/desync
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.2
Choose a head ref
  • 20 commits
  • 72 files changed
  • 1 contributor

Commits on Apr 30, 2026

  1. Reject --client-ca when --mutual-tls is not set (#333)

    Without --mutual-tls the server's TLS ClientAuth defaults to
    NoClientCert, so the CA pool loaded from --client-ca is never
    consulted and any client (including one with no certificate) can
    connect. Operators reasonably expect that providing a CA restricts
    access to clients holding a cert from that CA, so fail loudly at
    startup instead of silently accepting unverified clients.
    folbricht authored Apr 30, 2026
    Configuration menu
    Copy the full SHA
    1493985 View commit details
    Browse the repository at this point in the history

Commits on May 16, 2026

  1. Confine catar extraction to the target root (symlink-safe) (#336)

    * Confine catar extraction to the target root (symlink-safe)
    
    LocalFS computed every destination as filepath.Join(fs.Root, n.Name) and
    wrote via raw os.OpenFile/RemoveAll/Symlink/Chown/Chmod/Mknod with no
    symlink protection. An archive could plant a symlink (e.g. evil -> /etc)
    and then add a later entry with a clean name (evil/passwd) whose write,
    remove, chown or chmod would be resolved by the kernel through the planted
    symlink, escaping the extraction root. This worked even without ".." in
    names, so lexical filtering alone was insufficient.
    
    Route all LocalFS write/metadata operations through a lazily-opened,
    cached os.Root handle anchored to the extraction root. os.Root refuses to
    traverse any path component or symlink that escapes the root while still
    following benign in-root relative symlinks, neutralizing the symlink-
    follow class regardless of the entry name. Symlink targets are kept
    verbatim (legitimate, matches GNU tar/casync); safety comes from never
    following an escaping link, not from rejecting the target.
    
    os.Root has no Mknod, so CreateDevice creates the node with unix.Mknodat
    against a confined parent-directory fd. xattrs are applied via fd-based
    xattr.FSet on a root-opened handle (no symlink follow). golang.org/x/sys
    is promoted to a direct dependency.
    
    As defense-in-depth, ArchiveDecoder now rejects FormatFilename names that
    are empty, ".", "..", absolute, or contain a path separator, and asserts
    each cumulative entry path stays within the root. This also stops
    TarWriter from forwarding poisoned names into produced tar archives.
    
    Add adversarial tests covering the reported exploit, lexical escape,
    verbatim absolute symlink targets, decoder rejection, and a regression
    guard for benign in-root relative symlinks.
    
    * Fix macOS build: split device-node creation by platform
    
    unix.Mknodat does not exist on Darwin (macOS has no mknodat(2)
    syscall), breaking the macOS CI build. Move the node-creation
    primitive into a per-platform createDeviceNode:
    
    - linux: unix.Mknodat against a confined parent-directory fd
      obtained through os.Root (strong, race-free).
    - other Unix (darwin/bsd): validate the parent resolves within
      the root via os.Root, then path-based unix.Mknod on the
      resolved real path. Extraction is single-threaded, so no
      concurrent attacker can swap a component after the check.
    
    The rest of CreateDevice (Remove/Chown/Chmod/Chtimes/xattr) stays
    in localfs_other.go and continues to go through os.Root on all
    non-Windows platforms.
    folbricht authored May 16, 2026
    Configuration menu
    Copy the full SHA
    d59b3c9 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2026

  1. Reject unsafe index names in the index server (path traversal) (#337)

    HTTPIndexHandler derived the index name via path.Base(r.URL.Path),
    which only treats '/' as a separator, and LocalIndexStore concatenated
    that name onto the store path with no filtering. On Windows '\' is a
    path separator, so a URL-decoded path like '/..\..\..\target' escaped
    the store directory: PUT could truncate/create arbitrary files and
    GET/HEAD acted as a file-existence oracle. Auth is off by default.
    
    Add validIndexName() rejecting empty/'.'/'..', any name containing '/'
    or '\' (both hardcoded so cross-platform payloads are caught on any
    host), and anything filepath.IsLocal flags. Enforce it in
    HTTPIndexHandler.ServeHTTP (flat 400 for GET/HEAD/PUT, closing the
    oracle) and in LocalIndexStore.GetIndexReader/StoreIndex as defense in
    depth for non-HTTP callers.
    folbricht authored May 17, 2026
    Configuration menu
    Copy the full SHA
    c0cb346 View commit details
    Browse the repository at this point in the history
  2. Fix inverted HEAD response and fd leak in index server (#338)

    HTTPIndexHandler.head had inverted status logic: it returned 200 OK
    when GetIndexReader failed and 404 Not Found when it succeeded. A
    client doing HEAD-before-PUT to avoid clobbering would see 404 for an
    existing index and overwrite it.
    
    It also discarded the io.ReadCloser returned by GetIndexReader without
    closing it. For LocalIndexStore that reader is the *os.File from
    os.Open, so every HEAD to an existing index leaked a file descriptor
    until GC finalization, allowing a sustained HEAD burst to exhaust the
    process fd limit.
    
    Correct the status mapping to mirror the sibling GET handler
    (os.IsNotExist -> 404, other error -> stderr log + 400, success ->
    200) and close the reader deterministically with defer. Add a test
    covering the existing-index and missing-index HEAD paths.
    folbricht authored May 17, 2026
    Configuration menu
    Copy the full SHA
    72c165d View commit details
    Browse the repository at this point in the history
  3. Fix sparse-file cache serving zeros after a transient chunk load fail…

    …ure (#339)
    
    sparseFileLoader.loadChunk wrapped the fetch in a per-chunk sync.Once
    whose closure recorded failures in a stack-local error. sync.Once
    latches on invocation, not on success: the first failed load returned
    the error correctly but consumed the Once, so every subsequent call for
    that chunk was a no-op that returned nil without writing the chunk.
    loadRange then reported success and ReadAt served the never-written
    (zeroed) region of the truncated sparse file as valid data, with no
    error and no hash check. A single transient fetch error therefore
    permanently poisoned that chunk's range for the life of the mount.
    preloadChunksFromState had the same defect.
    
    Replace the per-chunk sync.Once with a per-chunk sync.Mutex and use the
    existing l.done bitmap as the authoritative record of what has actually
    been written. loadChunk now serializes same-chunk loads, returns early
    only when the chunk is genuinely loaded, sets done only on success, and
    returns the error directly on any failure. Failed loads stay in a failed
    state (error on every read) and remain retryable until the chunk is
    actually fetched; success is never reported for unfetched data.
    
    Add a regression test that injects a transient GetChunk failure and
    verifies the first read errors while the retry returns the real chunk
    data rather than zeros.
    folbricht authored May 17, 2026
    Configuration menu
    Copy the full SHA
    92fe6ff View commit details
    Browse the repository at this point in the history
  4. Replace deprecated stdlib/x APIs (#340)

    * Replace deprecated stdlib/x APIs
    
    Swap four deprecated APIs for their supported equivalents; no behavior
    change (verified, including byte-for-byte tar output via TestGnuTarWrite):
    
    - os.SEEK_SET -> io.SeekStart (fileseed.go, nullseed.go). Same value (0).
    
    - math/rand's rand.Read -> crypto/rand.Read in make_test.go (test data
      generation only; matches the convention already used in
      failover_test.go, selfseed_test.go and assemble_test.go).
    
    - tar.Header.Xattrs -> PAXRecords in tarfs.go. The archive/tar docs state
      h.Xattrs[k] and h.PAXRecords["SCHILY.xattr."+k] are semantically
      equivalent and the package routes Xattrs through exactly that prefix
      internally, so the on-disk tar format is unchanged. Added
      xattrsToPAXRecords/paxRecordsToXattrs helpers (lazy/nil map to preserve
      the existing File.Xattrs == nil behavior when no xattrs are present).
    
    - golang.org/x/crypto/ssh/terminal -> golang.org/x/term in
      progressbar.go (identical IsTerminal signature). go mod tidy promotes
      golang.org/x/term to a direct dependency and demotes
      golang.org/x/crypto to indirect; go.sum is unchanged.
    
    Add TestTarXattrHelpers (direct unit tests of the conversion helpers,
    including prefix correctness and nil handling) and TestTarXattrsRoundTrip
    (writes xattrs via TarWriter, asserts the wire records are exactly
    SCHILY.xattr.<name>, and round-trips them back through TarReader). The
    round-trip uses CreateDevice because CreateDir/File/Symlink hardcode
    FormatGNU, which archive/tar rejects in combination with xattrs (a
    pre-existing constraint, unchanged by this commit).
    
    * Use testify in new tarfs xattr tests
    
    Convert the xattr helper and round-trip tests added on this branch to
    require/assert, matching the testify style used across the rest of the
    test suite.
    folbricht authored May 17, 2026
    Configuration menu
    Copy the full SHA
    2c1708a View commit details
    Browse the repository at this point in the history
  5. Fix data race on ChunkingStats in IndexFromFile (#341)

    * Fix data race on ChunkingStats in IndexFromFile
    
    IndexFromFile shares &stats with every parallel chunk worker, which
    update it via atomic.AddUint64. Workers were only signalled to stop
    (close(done)) and never joined: the consumer loop breaks early when a
    worker reports EOF, leaving later workers' goroutines running. The
    function then returned `stats` by value while those goroutines were
    still atomically incrementing it -- a data race (flagged by -race in
    TestParallelChunking) that also made ChunksProduced non-deterministic.
    
    Track the worker goroutines with a sync.WaitGroup (using the Go 1.25
    (*sync.WaitGroup).Go helper) and, on the post-spawn exit path, cancel
    the context, stop every worker and wait for all goroutines to exit
    before copying stats into the return value. The wait runs inline before
    the return (deferred cleanup runs after the return value is already
    copied, so it cannot fix this), and before the deferred per-worker
    file Close calls, which also closes a latent read-from-closed-file
    hazard for abandoned stragglers. defer cancel()/defer w.stop() are kept
    as an idempotent panic safety net. No signature or behavior change for
    callers.
    
    Add TestIndexFromFileStats: exercises the early-EOF/straggler path with
    null-heavy inputs across multiple worker counts and asserts the now
    race-free, deterministic invariants (ChunksAccepted == len(index.Chunks),
    ChunksProduced >= ChunksAccepted > 0).
    
    Verified: go test -race -count=5 of TestParallelChunking and the new
    test (no DATA RACE; previously reproduced within a few iterations),
    TestIndexFromFileStats -count=20 without -race, full go test -race .
    and go test ./cmd/desync all green.
    
    * Use testify require in TestIndexFromFileStats
    
    Convert the new test's setup checks and stat invariants from manual
    t.Fatal/t.Fatalf to github.com/stretchr/testify/require (already a
    dependency, used elsewhere in the package). TestParallelChunking is
    left as-is.
    folbricht authored May 17, 2026
    Configuration menu
    Copy the full SHA
    6479455 View commit details
    Browse the repository at this point in the history
  6. Add Code Style section to CLAUDE.md (#342)

    Document two conventions:
    
    - New/modified Go tests use testify (require/assert) instead of
      hand-rolled t.Fatalf conditionals, with a note that require.* calls
      FailNow() so it must only be used from the test goroutine (per the
      existing non-main-goroutine t.Fatal() restriction).
    - Build the CLI into cmd/desync/ (go build -o cmd/desync/ ./cmd/desync);
      a bare go build ./cmd/desync drops an untracked, non-gitignored
      desync binary in the repo root.
    folbricht authored May 17, 2026
    Configuration menu
    Copy the full SHA
    3e77d01 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2026

  1. Fix inverted --trust-insecure flag silently disabling TLS verification (

    #343)
    
    MergedWith() gated TrustInsecure on pflag's .Changed (true whenever the
    flag is present on the command line, regardless of value) but hard-coded
    the assignment to `true`. Passing --trust-insecure=false (e.g. to
    override a config file that set "trust-insecure": true for a store)
    therefore set TrustInsecure=true, propagating to
    tls.Config{InsecureSkipVerify: true} and silently disabling server
    certificate validation for HTTPS chunk/index stores. Since index files
    are not content-verified, a MITM could substitute a forged .caibx.
    
    Use the flag's actual value (o.trustInsecure), matching every other
    .Changed-gated option in the same function, so an explicit
    --trust-insecure=false forces verification on and overrides the config.
    
    Add TestTrustInsecureOption covering config/CLI precedence including the
    regression case.
    folbricht authored May 18, 2026
    Configuration menu
    Copy the full SHA
    782a69d View commit details
    Browse the repository at this point in the history
  2. Escape space in mtree filename output to prevent keyword injection (#344

    )
    
    mtreeFilename() escaped backslash, '#', control bytes, and bytes >126
    but not space (0x20). mtree(5) lines are space-delimited keyword=value
    pairs following the filename, so an untrusted catar entry name like
    "usr ignore" was emitted verbatim, letting mtree(8) parse "ignore"
    (also "optional"/"nochange") as a value-less keyword that suppresses
    integrity verification of the whole subtree. Symlink targets, passed
    through the same function, were a second injection vector.
    
    Add space to the octal-escape set, matching the escaped set used by
    libarchive and BSD mtree (non-printable, '\', ' ', '\t', '#'); space
    becomes \040 and still round-trips through mtree(8) readers. Update
    the doc comment and add tests covering the escaping and a regression
    guard for the keyword-injection attack.
    folbricht authored May 18, 2026
    Configuration menu
    Copy the full SHA
    3c55d53 View commit details
    Browse the repository at this point in the history
  3. Require --client-ca when --mutual-tls is set (#345)

    cmdServerOptions.validate() enforced that --client-ca requires
    --mutual-tls but not the inverse. With --mutual-tls and no
    --client-ca, serve() sets ClientAuth=RequireAndVerifyClientCert but
    leaves tls.Config.ClientCAs nil. crypto/tls then falls back to the
    system root pool for client-cert verification, so any certificate
    chaining to a publicly-trusted CA with the clientAuth EKU is accepted
    - silently bypassing the operator's intended client authentication on
    chunk/index servers.
    
    Make --mutual-tls require an explicitly-configured --client-ca so mTLS
    always pins to an intended trust anchor. Add a defense-in-depth guard
    in serve() in case it is reached without validation, update the
    validation test matrix, and clarify the README.
    folbricht authored May 18, 2026
    Configuration menu
    Copy the full SHA
    0ed78c3 View commit details
    Browse the repository at this point in the history
  4. CI: track go.mod version, test full module, add race detector and sta…

    …tic analysis (#346)
    
    * CI: track go.mod version, test full module, add race detector and static analysis
    
    - Replace the stale pinned Go version ('1.24') with go-version-file:
      go.mod in both workflows so CI tracks the module's required version
      (go.mod now requires go 1.25.0) and never drifts again.
    - Run go test ./... instead of bare go test so the cmd/desync CLI
      tests are actually exercised in CI.
    - Add a Linux-only race detector step (go test -race ./...).
    - Add a Linux-only static analysis step: go vet, gofmt, and
      go mod tidy -diff.
    
    * CI: keep cross-platform test scoped to root package
    
    go test ./... surfaces two pre-existing Windows-only failures in the
    cmd/desync package (binary testdata CRLF corruption and a
    filepath.Match vs path.Match bug in locationMatch). Those are real
    bugs unrelated to CI hardening; fixing them and switching to ./...
    is deferred to a follow-up PR. Keep this PR CI-only and green by
    running bare go test on the cross-platform matrix. The Linux-only
    race and static-analysis steps still exercise the full module.
    
    * Fix two pre-existing Windows-only cmd/desync failures; re-enable go test ./... cross-platform (#347)
    
    * Fix locationMatch using OS-dependent separator for URL matching
    
    locationMatch used filepath.Match for the URL branch, but
    filepath.Match's separator is OS-dependent (backslash on Windows).
    That made glob patterns behave differently on Windows, e.g.
    locationMatch("*", "https://example.com/path") returned true on
    Windows (no backslash in the string, so * matched everything) while
    correctly returning false on Unix. URLs only ever use / as the
    separator, so use path.Match, which always treats / as the
    separator regardless of OS. No behavior change on Unix, where
    filepath.Match and path.Match are equivalent.
    
    * Fix inspectchunks failing on Windows for local stores
    
    On Windows, storeFromLocation wraps every local store in a
    WriteDedupQueue (store.go), so the sr.(desync.LocalStore) type
    assertion in inspectchunks failed and the command returned
    "'<path>' is not a local store" for any local store. Unwrap the
    WriteDedupQueue to reach the underlying LocalStore. No effect on
    Unix, where local stores are not wrapped and the direct assertion
    already succeeds.
    
    * CI: run go test ./... cross-platform now that Windows bugs are fixed
    
    Re-enable full-module testing on the cross-platform matrix (deferred
    from #346 while two pre-existing Windows-only cmd/desync failures
    were outstanding). Both are now fixed in this PR (locationMatch
    separator and the inspectchunks WriteDedupQueue unwrap). Also set
    fail-fast: false so a failure on one OS doesn't cancel the others,
    giving complete per-OS logs.
    
    * Guard POSIX-only path equality assertion in TestLocationEquality on Windows
    
    locationMatch intentionally uses OS-aware filepath semantics for
    local (non-URL) paths. On Windows a leading // is a UNC path root,
    so locationMatch("//path", "/path") is legitimately false there.
    Guard that POSIX-only assertion behind a non-Windows branch,
    matching the existing runtime.GOOS == "windows" path block right
    below it. Test-only change; no behavior change.
    
    * Quarantine TestLocationEquality on Windows pending path-semantics review
    
    cmd/desync tests never ran in CI before, so TestLocationEquality's
    several Windows-only assertion blocks were never executed. Running
    them surfaces genuine, unresolved Windows path-semantics questions
    in locationMatch's local-path branch (UNC // roots,
    trailing-separator globbing, drive letters) that need the intended
    cross-platform matching contract defined. Skip the test on Windows
    with a tracking note rather than block CI on a product decision;
    the function remains fully covered on Linux and macOS. This also
    reverts the interim line-62 guard, now subsumed by the skip.
    folbricht authored May 18, 2026
    Configuration menu
    Copy the full SHA
    1705fc3 View commit details
    Browse the repository at this point in the history
  5. CI: least-privilege token, dedupe runs, release timeout, Node 24 acti…

    …ons (#348)
    
    * CI: least-privilege token, dedupe runs, release timeout, Node 24 actions
    
    - validate.yaml: add an explicit least-privilege 'permissions:
      contents: read' block (it previously ran with the repo-default
      token scope; release.yaml already scopes its token).
    - validate.yaml: add a concurrency group keyed on workflow + branch/PR
      so a push and its pull_request no longer run the full 3-OS matrix
      twice, and superseded runs are cancelled.
    - release.yaml: add timeout-minutes: 30 to the release job (validate
      already had a timeout; release had none).
    - Bump all actions off the deprecated Node 20 runtime (GitHub force-
      migrates Node 20 actions on 2026-06-02 and removes Node 20 on
      2026-09-16): actions/checkout v4->v6, actions/setup-go v5->v6,
      goreleaser/goreleaser-action v6->v7. All target Node 24.
    - validate.yaml: build with -o cmd/desync/ to match the project's
      documented build convention.
    
    * CI: fix concurrency key so push and pull_request actually share a group
    
    github.ref is refs/heads/<branch> for push but refs/pull/N/merge
    for pull_request, so the previous key put them in different
    concurrency groups and the matrix still ran twice. github.ref_name
    is the bare branch name for push and equals github.head_ref for
    pull_request, so the two events now share one group and the
    duplicate run is cancelled.
    
    * CI: scope push trigger to master so PR branches don't double-run
    
    cancel-in-progress dedupes the matrix by cancelling the duplicate
    push run mid-flight, which still starts 3 jobs and leaves a
    cancelled run in the Actions tab. Restrict the push trigger to
    master so a feature-branch push with an open PR never creates a
    push run at all; the pull_request run is the single source of CI
    for branches. Pushes to master (merges) still run once. The
    concurrency group stays for cancelling superseded in-progress runs
    within an event stream.
    folbricht authored May 18, 2026
    Configuration menu
    Copy the full SHA
    b5df9e8 View commit details
    Browse the repository at this point in the history
  6. Fix never-run Windows assertions in TestLocationEquality; un-skip on …

    …Windows (#349)
    
    * TEMP: Windows locationMatch diagnostic + Windows-only diag workflow
    
    Not for merge. Evaluates every TestLocationEquality locationMatch
    case without short-circuiting and dumps filepath.Abs/filepath.Match
    internals so one Windows CI run reveals all divergences at once.
    
    * Fix never-run Windows assertions in TestLocationEquality; un-skip on Windows
    
    Investigation (via a temporary Windows CI diagnostic) showed
    locationMatch itself is correct on Windows. All Windows failures
    were incorrect, never-executed test expectations:
    
    - //path vs /path was asserted equal unconditionally, but that is a
      POSIX-only assumption: on Windows // is a UNC root, so it is
      legitimately not equal to the drive-relative /path. locationMatch
      intentionally uses OS-native local-path semantics. Now asserted
      per-OS.
    - The Windows block under "Not equal paths with globs" asserted
      True for dir\* vs dir\ and dir\? vs dir\123\. Both are wrong
      and inconsistent with the POSIX cases: dir\* does not match the
      bare dir (cf. /path/* vs /path), and ? matches exactly one
      character so it does not match "123". Corrected to False.
    
    Remove the Windows t.Skip; locationMatch is now covered on all
    three platforms. (Diagnostic test and temp workflow are removed
    before merge.)
    
    * Remove temporary Windows diagnostic workflow
    
    Investigation complete: TestLocationEquality passes on Windows with
    the corrected assertions (verified via this workflow before removal).
    folbricht authored May 18, 2026
    Configuration menu
    Copy the full SHA
    5904461 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2026

  1. Validate chunk size in IndexPos read path to prevent panic/hang (#350)

    IndexPos.Read assumes len(curChunk) equals the size the index declares
    for the chunk, but loadChunk never verified it. An index that declares a
    chunk larger than the data actually stored for that chunk ID could drive
    curChunkOffset past len(curChunk), making the slice in Read panic with
    "slice bounds out of range". When the declared size is larger but the
    offset lands exactly at the real end of a non-last chunk, Read instead
    copies zero bytes and Seek(0) makes no progress, spinning forever.
    
    Both are reachable with an untrusted .caibx via 'desync cat' and the
    'desync mount-index' FUSE read handler.
    
    Verify after loading that the actual chunk length matches the declared
    index size and return an error otherwise, the same check AssembleFile
    already performs. Covers the null-chunk shortcut too.
    folbricht authored May 19, 2026
    Configuration menu
    Copy the full SHA
    43f08c2 View commit details
    Browse the repository at this point in the history
  2. Prevent SSH option/shell injection via store URLs (#351)

    SFTPStore and RemoteSSH built their ssh destination from the store URL
    (user@host) and passed it as the first positional argument to ssh. A URL
    whose host begins with '-' (e.g. sftp://-oProxyCommand=.../) was parsed by
    ssh as a command-line option instead of a destination, allowing arbitrary
    local command execution as the desync process user -- the same class of
    bug as Git CVE-2017-1000117 and Mercurial CVE-2017-1000116. Store URLs
    come from CLI flags and from --store-file JSON config re-read on SIGHUP,
    so a less-privileged writer of that file could trigger it.
    
    RemoteSSH additionally interpolated the URL path into the remote command
    string with only single-quote wrapping, so a single quote in the path
    allowed remote-side shell injection.
    
    Fixes:
    - validateSSHHost rejects any destination beginning with '-' (portable
      guarantee, covers non-OpenSSH CASYNC_SSH_PATH implementations).
    - Pass "--" before the destination so ssh can't parse it as an option
      (defense in depth). For sftp, "-s" now precedes "--".
    - shellQuote escapes the path before embedding it in the remote command.
    
    CASYNC_REMOTE_PATH is still interpolated unquoted; it is operator-
    controlled and quoting it would break legitimate "casync <args>" usage.
    folbricht authored May 19, 2026
    Configuration menu
    Copy the full SHA
    fcfe229 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2026

  1. Improve CLI help text and examples (#352)

    - Add a Long description to the root command documenting all supported
      store location formats and the '|' failover-group syntax
    - Fix prune usage line: extra args are indexes, not files; document the
      confirmation prompt and --yes
    - Fix mount-index help: a state file is only written when
      --cor-state-save is given; SIGHUP reload doesn't 'restart the server'
    - Restructure the extract description into paragraphs
    - Clarify misleading flag descriptions (verify/prune 'target store',
      repeatable --listen, cat --length 0, chunk --start in bytes) and make
      --ignore/--ignore-chunks wording consistent between cache and chop
    - Add examples: cat with offset/length, make with custom chunk sizes to
      STDOUT, verify -r, writable/HTTPS chunk-server, writable index-server,
      multi-index prune
    - Add missing Long texts for manpage and chunk
    folbricht authored Jun 10, 2026
    Configuration menu
    Copy the full SHA
    c95093f View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2026

  1. Migrate remaining tests to testify (#354)

    Convert the 17 test files still using hand-rolled t.Fatal/t.Errorf
    checks to testify, using require for fatal assertions and assert where
    tests previously continued after a failure. Checks running in spawned
    goroutines keep passing errors back over channels per the t.Fatal()
    goroutine restriction. Drops the reflect-based comparisons and a stale
    commented-out block, removing ~290 lines.
    folbricht authored Jun 11, 2026
    Configuration menu
    Copy the full SHA
    c7a46a7 View commit details
    Browse the repository at this point in the history
  2. Use t.TempDir() for temp files in tests (#355)

    Replace manual os.CreateTemp/tempfile.New plus deferred cleanup with
    paths inside t.TempDir(), which the test framework cleans up even when
    a test fails early. Target files for AssembleFile and NewSparseFile are
    passed as nonexistent paths since both create the file (O_CREATE).
    Drops the tempfile dependency from make_test.go (still used by
    production code) and makes chop's invalid-store case independent of
    whether /tmp/desync exists.
    folbricht authored Jun 11, 2026
    Configuration menu
    Copy the full SHA
    aaed7a2 View commit details
    Browse the repository at this point in the history
  3. Fix reflink cloning on filesystems with large block sizes such as ZFS (…

    …#356)
    
    * Fix reflink cloning on filesystems with large block sizes such as ZFS
    
    OpenZFS 2.2+ implements FICLONERANGE, so the CanClone probe now succeeds
    on ZFS, but actual clones often fail: ZFS requires alignment to its
    recordsize (128k by default, reported as st_blksize) and returns EAGAIN
    when the source range hasn't been committed to disk yet. Extraction with
    seeds then failed with "invalid argument" or "resource temporarily
    unavailable" errors.
    
    On top of that, the clone math in fileSeedSegment and nullChunkSection
    assumed every segment contains at least one full aligned block, which is
    always true for 4k blocks but not for 128k ones. Segments smaller than a
    block made the aligned length underflow, made the head/tail copies write
    outside the segment, and could call FICLONERANGE with a zero length,
    which the kernel interprets as "clone to the end of the source file",
    silently corrupting the target.
    
    Guard against ranges that contain no full aligned block by copying them
    instead, and fall back to copying the blocks whenever CloneRange fails.
    Cloning failures are no longer fatal on any filesystem.
    
    Verified against a real ZFS pool (zfs 2.2.2, zfs_bclone_enabled=1):
    previously failing extraction tests now pass and properly aligned ranges
    are still reflinked.
    
    Fixes #353
    
    * Fall back to copying silently when cloning fails, like cp does
    folbricht authored Jun 11, 2026
    Configuration menu
    Copy the full SHA
    ab59502 View commit details
    Browse the repository at this point in the history
Loading
⌂ 换网址