Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information