base-files: fix uid/gid auto-enumeration to avoid 16-bit limit
authorThomas Winkler <tewinkler86@gmail.com>
Fri, 10 Nov 2023 21:48:59 +0000 (22:48 +0100)
committerRISCi_ATOM <bob@bobcall.me>
Thu, 11 Jul 2024 15:25:03 +0000 (11:25 -0400)
commitd7cb7029c8001d868375ee7fe69b5b87e4715564
tree7b324164caafde0db29111b02b4e6d72714552fd
parentb3bd80738c7a88f889543ce7861d3e0d1ce2d154
base-files: fix uid/gid auto-enumeration to avoid 16-bit limit

uid/gid range should be limited to 16bit unsigned integer range to
avoid "wraparound" issues with permissions where jffs2
is employed for storage and chown 65536 (first auto-created user)
becomes equivalent to chown 0

Fixes: #13927

Signed-off-by: Thomas Winkler <tewinkler86@gmail.com>
(cherry picked from commit 140b48a9e93909873bee777ca5bdf49fe4f01271)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/base-files/files/lib/functions.sh