SHA256
1
0
forked from pool/coreutils
coreutils/coreutils-invalid-ids.patch
Dirk Mueller 4f67da60bc Accepting request 922533 from home:berny:branches:Base:System
- Update to 8.32 (see NEWS).
- Remove patches which are included in the new upstream version now:
  * coreutils-gnulib-disable-test-float.patch
  * coreutils-ls-restore-8.31-behavior-on-removed-dirs.patch
  * coreutils-tests-fix-FP-in-ls-stat-free-color.patch
  * gnulib-test-avoid-FP-perror-strerror.patch
- coreutils-i18n.patch: Refresh patch.  Also patch 'tests/Coreutils.pm' used
  by perl-based tests to allow longer test names ... which the i18n tests with
  their "-mb" suffix have.
- coreutils-chmod-fix-exit-status-ign-symlinks.patch: Add upstream patch to
  fix a regression with the exit code of chmod introduced in 9.0.
- coreutils-skip-tests-rm-ext3-perf.patch: Add patch to skip the test
  'tests/rm/ext3-perf.sh' temporarily as it hangs on OBS.
- coreutils.spec:
  * Version: bump version.
  * Remove the above removed patches.
  * Reference the above new patches.

OBS-URL: https://build.opensuse.org/request/show/922533
OBS-URL: https://build.opensuse.org/package/show/Base:System/coreutils?expand=0&rev=322
2021-10-01 19:34:37 +00:00

31 lines
974 B
Diff

While uid_t and gid_t are both unsigned, the values (uid_t) -1 and
(gid_t) -1 are reserved. A uid or gid argument of -1 to the chown(2)
system call means to leave the uid/gid unchanged. Catch this case
so that trying to set a uid or gid to -1 will result in an error.
Test cases:
chown 4294967295 file
chown :4294967295 file
chgrp 4294967295 file
Andreas Gruenbacher <agruen@suse.de>
---
src/chgrp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: src/chgrp.c
===================================================================
--- src/chgrp.c.orig
+++ src/chgrp.c
@@ -89,7 +89,7 @@ parse_group (char const *name)
{
uintmax_t tmp;
if (! (xstrtoumax (name, NULL, 10, &tmp, "") == LONGINT_OK
- && tmp <= GID_T_MAX))
+ && tmp <= GID_T_MAX && (gid_t) tmp != (gid_t) -1))
die (EXIT_FAILURE, 0, _("invalid group: %s"),
quote (name));
gid = tmp;