[Bug 2127970] Re: [Ubuntu 25.10 Questing] rust coreutils "date -r file" returns a wrong date
Nick Rosbrook
2127970 at bugs.launchpad.net
Wed Oct 22 14:31:57 UTC 2025
Hello fprietog, or anyone else affected,
Accepted rust-coreutils into questing-proposed. The package will build
now and be available at https://launchpad.net/ubuntu/+source/rust-
coreutils/0.2.2-0ubuntu2.1 in a few hours, and then in the -proposed
repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
questing to verification-done-questing. If it does not fix the bug for
you, please add a comment stating that, and change the tag to
verification-failed-questing. In either case, without details of your
testing we will not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: rust-coreutils (Ubuntu Questing)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-questing
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils-from in Ubuntu.
https://bugs.launchpad.net/bugs/2127970
Title:
[Ubuntu 25.10 Questing] rust coreutils "date -r file" returns a wrong
date
Status in coreutils-from package in Ubuntu:
Confirmed
Status in rust-coreutils package in Ubuntu:
Fix Committed
Status in coreutils-from source package in Questing:
Won't Fix
Status in rust-coreutils source package in Questing:
Fix Committed
Status in coreutils-from source package in Resolute:
Won't Fix
Status in rust-coreutils source package in Resolute:
Fix Committed
Bug description:
[Impact]
date -r reports current date instead of date specified by reference file. This makes files look "too new", causing for example backup scripts to not run their backups because they think the backups are current, and possible other mayhem.
[Test plan]
Take a file older than now, and check that the output of
date -r <file>
matches
gnudate -r <file>
(except for localization)
If the build passes, then the included test case
test_date_for_file_mtime also passed. Date has a regression test suite
as well checking other code paths for basic functionality and past
fixes.
[Where problems could occur]
The change is straightforward and only affects the code using `-r`, adding the specified file as a date source and using that if specified. This uses an enum member that is newly added, and a match statement. Match statements are exhaustive so the compiler effectively guarantees us that this only affects date -r and no other code paths.
[Original bug report]
Ubuntu 25.10 Questing came with this rust coreutils "date" command version:
$ date -V
date (uutils coreutils) 0.2.2
Problem is that the command "date -r file", that will return the last
modification time of the given file, is returning a wrong date, in
fact, is returning the current date:
Example given, this file "/usr/bin/bash":
-rwxr-xr-x 1 root root 1608840 Sep 8 15:20 /usr/bin/bash*
The command "date -r /usr/bin/bash" correct return will be:
Mon Sep 8 15:20:42 CEST 2025
But instead of that rust coreutils returns the current date:
$ /usr/bin/date -r /usr/bin/bash
Thu Oct 16 10:18:41 CEST 2025
The gnu coreutils works as expected and returns the last modification
date of the given file:
$ /usr/bin/gnudate -r /usr/bin/bash
Mon Sep 8 15:20:42 CEST 2025
IMHO this is a very urgent to fix bug. We've noticed it because a
couple of our monitor scripts started to act weird triggering date
warnings for files that were untouched.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils-from/+bug/2127970/+subscriptions
More information about the foundations-bugs
mailing list