find: -printf %A@ and %T@ reject timestamps before 1970
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/findutils のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
uutils/findutils#692 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
find on Windows: opt in to / as the path separator対応中かも @mutewinter が 24 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
メンテナーはふだん 1 日以内に返信
-
xargs: -x runs a pending command before rejecting an oversized argument対応中かも @SichenLiang が 26 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 28/100
メンテナーはふだん 1 日以内に返信
uutils/findutils の issue をすべて見る
似ている issue
-
needs-triage tooling
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
neilsh/stunt-reel#317 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
storytold/craft-fonts#65 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
storytold/craft-libs#723 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
n0-computer/iroh#4669 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信