Martin Kletzander baae5b4a06 find_new_[gu]id(): Skip over IDs that are reserved for legacy reasons
Some programs don't support `(uint16_t) -1` or `(uint32_t) -1` as user
or group IDs.  This is because `-1` is used as an error code or as an
unspecified ID, e.g. in `chown(2)` parameters, and in the past, `gid_t`
and `uid_t` have changed width.  For legacy reasons, those values have
been kept reserved in programs today (for example systemd does this; see
the documentation in the link below).

This should not be confused with catching overflow in the ID values,
since that is already caught by our ERANGE checks.  This is about not
using reserved values that have been reserved for legacy reasons.

Link: <https://systemd.io/UIDS-GIDS/>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2023-02-20 12:10:02 +01:00
..
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2023-02-16 11:29:33 +01:00
2023-02-09 10:03:03 -06:00
2021-12-23 19:36:50 -06:00
2023-01-30 18:24:15 +01:00
2022-08-06 11:27:56 -05:00
2022-09-02 20:27:14 -05:00
2021-12-23 19:36:50 -06:00
2022-08-17 12:34:01 -05:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2023-02-16 13:23:08 -06:00
2021-12-23 19:36:50 -06:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2023-02-02 13:08:30 -06:00
2023-02-02 13:08:30 -06:00
2023-02-09 10:03:03 -06:00
2022-12-22 10:31:43 +01:00
2022-12-22 11:43:29 +01:00
2022-12-22 11:43:29 +01:00
2021-12-23 19:36:50 -06:00
2023-02-09 10:03:03 -06:00
2022-08-06 11:27:56 -05:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2023-02-16 11:29:33 +01:00
2022-08-06 11:27:56 -05:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2023-02-02 13:08:30 -06:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2021-12-23 19:36:50 -06:00
2023-02-16 11:29:33 +01:00
2023-02-16 11:29:33 +01:00
2022-08-06 11:27:56 -05:00
2021-12-23 19:36:50 -06:00
2023-02-09 10:03:03 -06:00
2022-12-22 11:43:29 +01:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2022-12-15 16:22:05 -06:00
2023-02-02 13:08:30 -06:00
2022-08-17 12:34:01 -05:00
2022-12-15 16:22:05 -06:00
2023-02-09 10:03:03 -06:00
2021-12-23 19:36:50 -06:00
2023-02-02 13:08:30 -06:00
2023-02-16 11:29:33 +01:00
2023-02-16 11:29:33 +01:00
2021-12-23 19:36:50 -06:00
2023-02-02 13:08:30 -06:00
2023-02-09 10:03:03 -06:00
2023-02-09 10:03:03 -06:00
2023-02-16 13:23:08 -06:00
2023-02-09 10:03:03 -06:00
2021-12-23 19:36:50 -06:00
2023-02-16 13:23:08 -06:00
2023-02-16 13:23:08 -06:00
2023-01-26 22:44:39 -06:00
2023-02-16 13:23:08 -06:00
2023-02-16 13:23:08 -06:00
2023-02-16 13:23:08 -06:00
2023-02-09 10:03:03 -06:00