Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove uid_t/gid_t casts #44914

Merged
merged 1 commit into from Oct 10, 2022

Commits on Oct 7, 2022

  1. 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.
    tniessen committed Oct 7, 2022
    Copy the full SHA
    1b12929 View commit details
    Browse the repository at this point in the history