find: -printf %A@ and %T@ reject timestamps before 1970

オープン
#927 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@zhangpan2001 がすでに取り組んでいます。

2026年10月27日 から。

  • #928 @zhangpan2001 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust
領域
cli

調査の方向性

The issue points to src/find/matchers/printf.rs, where TimeFormat::SinceEpoch calls duration_since(UNIX_EPOCH)?. Read that implementation and inspect nearby tests for %A@ and %T@; reproduce with the issue’s pre-1970 example. Done means -printf and -fprintf print negative epoch seconds, including fractional timestamps, without the error.

索引モデルが issue の本文から書いたものです。

説明

%A@ and %T@ should print negative epoch seconds for files whose access or modification time is before 1970. Current main instead reports an error and stops rendering the format for that file, while still exiting 0.

From the repository root after building:

uu_find="$PWD/target/debug/find"
tmp=$(mktemp -d)
(
    cd "$tmp" || exit
    touch -a -m -d '1969-12-31 23:59:59 UTC' file
    LC_ALL=C /usr/bin/find file -printf '%A@|%T@\n'
    LC_ALL=C "$uu_find" file -printf '%A@|%T@\n'
)

GNU findutils 4.11.0 prints:

-1.0000000000|-1.0000000000

uutils prints no stdout and reports:

Error processing 'file': second time provided was later than self

Both exit 0. The same problem occurs with -fprintf, and fractional timestamps before the epoch also fail. Timestamps at or after the epoch work.

TimeFormat::SinceEpoch uses duration_since(UNIX_EPOCH)?, which rejects negative offsets. This is separate from #914, which fixes pre-1970 comparisons for -newerXt.

Tested with uutils findutils 0.11.0, main 82cfc21f0d45fc654588f0f4243e9c6e5f57fc97, on Debian forky/sid, Linux x86_64, against /usr/bin/find from GNU findutils 4.11.0.

主要言語
Rust
スター
657
フォーク
115
平均マージ
1日 9時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uutils/findutils のほかの issue

uutils/findutils の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。