diff --git a/backport-chroot-whoami-use-uintmax_t-for-printing-uids.patch b/backport-chroot-whoami-use-uintmax_t-for-printing-uids.patch new file mode 100644 index 0000000000000000000000000000000000000000..fd23e21ba6d6eeafd73464d18d3d8704e35d28b5 --- /dev/null +++ b/backport-chroot-whoami-use-uintmax_t-for-printing-uids.patch @@ -0,0 +1,46 @@ +From 8083944484f2cdf6c9b737642567bcdb54db784d Mon Sep 17 00:00:00 2001 +From: Collin Funk +Date: Sun, 6 Oct 2024 22:19:51 -0700 +Subject: [PATCH] chroot,whoami: use uintmax_t for printing uids + +Reference:https://github.com/coreutils/coreutils/commit/8083944484f2cdf6c9b737642567bcdb54db784d +* src/chroot.c (main): Cast the uid to uintmax_t instead of int. +* src/whoami.c (main): Cast the uid to uintmax_t instead of unsigned +long int. +--- + src/chroot.c | 3 ++- + src/whoami.c | 4 ++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/chroot.c b/src/chroot.c +index 6150af5..db3444d 100644 +--- a/src/chroot.c ++++ b/src/chroot.c +@@ -374,7 +374,8 @@ main (int argc, char **argv) + else if (gid_unset (gid)) + { + error (EXIT_CANCELED, errno, +- _("no group specified for unknown uid: %d"), (int) uid); ++ _("no group specified for unknown uid: %ju"), ++ (uintmax_t) uid); + } + } + +diff --git a/src/whoami.c b/src/whoami.c +index e7a578a..04f6c29 100644 +--- a/src/whoami.c ++++ b/src/whoami.c +@@ -81,8 +81,8 @@ main (int argc, char **argv) + uid = geteuid (); + pw = uid == NO_UID && errno ? nullptr : getpwuid (uid); + if (!pw) +- error (EXIT_FAILURE, errno, _("cannot find name for user ID %lu"), +- (unsigned long int) uid); ++ error (EXIT_FAILURE, errno, _("cannot find name for user ID %ju"), ++ (uintmax_t) uid); + puts (pw->pw_name); + return EXIT_SUCCESS; + } +-- +2.27.0 + diff --git a/coreutils.spec b/coreutils.spec index 1ace8e274302aa6079e229ed53d86001cc687456..c83dc38561607595ed51db09bc064f6f3c94d318 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ Name: coreutils Version: 9.4 -Release: 9 +Release: 10 License: GPLv3+ Summary: A set of basic GNU tools commonly used in shell scripts Url: https://www.gnu.org/software/coreutils/ @@ -28,6 +28,7 @@ patch13: backport-sort-don-t-trust-st_size-on-proc-files.patch patch14: backport-cat-don-t-trust-st_size-on-proc-files.patch patch15: backport-dd-don-t-trust-st_size-on-proc-files.patch patch16: backport-split-don-t-trust-st_size-on-proc-files.patch +patch17: backport-chroot-whoami-use-uintmax_t-for-printing-uids.patch Patch9001: coreutils-9.0-sw.patch @@ -168,6 +169,9 @@ fi %{_mandir}/man*/* %changelog +* Fri Oct 25 2024 zhangyaqi - 9.4-10 +- chroot,whoami: use uintmax_t for printing uids + * Tue Aug 13 2024 huyubiao - 9.4-9 - fix alias sm3sum not working on bash delete redundant backport-chmod-fix-exit-status-when-ignoring-symlinks.patch