This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
src: remove uid_t/gid_t casts
If uid_t/gid_t are uint32_t, then the casts are unnecessary. This appears to be true in all recent versions of all supported platforms, so this change makes that assumption explicit and removes the casts. Conversely, if uid_t/gid_t are smaller unsigned integer types (such as uint16_t in earlier versions of Linux) or signed integer types (such as int32_t), then the casts are potentially dangerous because they might change the value of the uid/gid. If this happens on any platform, the added static_assert will fail, and additional bound checks should be introduced. PR-URL: #44914 Reviewed-By: Anna Henningsen <email@example.com> Reviewed-By: Ben Noordhuis <firstname.lastname@example.org>
- Loading branch information
Showing 1 changed file with 4 additions and 2 deletions.