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

Fix Instances of Memory Corruption on Illumos #93

Merged
merged 3 commits into from
Mar 3, 2024
Merged

Conversation

AldaronLau
Copy link
Member

In the future it would be nice to use libc (once an MSRV policy is decided on that's compatible with whoami 1.0's MSRV guarantees) or nix (in whoami 2.1), but for now doing a minimal patch.

Also, supporting Illumos as a tested target.

@AldaronLau
Copy link
Member Author

Should fix #91

@AldaronLau AldaronLau marked this pull request as ready for review March 3, 2024 06:15
@AldaronLau AldaronLau disabled auto-merge March 3, 2024 06:16
@AldaronLau AldaronLau changed the title Minimal patch for Correct Illumos PassWd Definition Fix Instances of Memory on Illumos Mar 3, 2024
@AldaronLau AldaronLau changed the title Fix Instances of Memory on Illumos Fix Instances of Memory Corruption on Illumos Mar 3, 2024
@AldaronLau AldaronLau added this pull request to the merge queue Mar 3, 2024
Merged via the queue into v1 with commit d6ee13e Mar 3, 2024
134 checks passed
@AldaronLau AldaronLau deleted the illumos-fun branch March 3, 2024 06:26
@sunshowers
Copy link

sunshowers commented Mar 3, 2024

Thanks!

Just a couple of comments:

  1. I don't think this catch-all should exist:

    whoami/src/os/unix.rs

    Lines 26 to 34 in d6ee13e

    #[cfg(not(any(
    target_os = "macos",
    target_os = "freebsd",
    target_os = "dragonfly",
    target_os = "bitrig",
    target_os = "openbsd",
    target_os = "netbsd",
    target_os = "illumos",
    )))]
    . Instead, if a platform isn't known then it should fail to compile.
  2. I think you can use libc 0.2 -- the MSRV for that won't change. It's just the MSRV for libc 1.0 that will change. If you do that, 1 is moot -- since you'll be pulling in all the definitions from libc.

Also, could you rename Illumos to illumos? It's always spelled with a lowercase "i" to avoid confusion between uppercase I and lowercase l.

@AldaronLau
Copy link
Member Author

  1. I don't think this catch-all should exist:

    whoami/src/os/unix.rs

    Lines 26 to 34 in d6ee13e

    #[cfg(not(any(
    target_os = "macos",
    target_os = "freebsd",
    target_os = "dragonfly",
    target_os = "bitrig",
    target_os = "openbsd",
    target_os = "netbsd",
    target_os = "illumos",
    )))]

    . Instead, if a platform isn't known then it should fail to compile.

Yeah, I agree this should be reworked. I'll work on switching it for whoami 1.5.0, aiming to get that out today.

2. I think you can use libc 0.2 -- the MSRV for that won't change. It's just the MSRV for libc 1.0 that will change. If you do that, 1 is moot -- since you'll be pulling in all the definitions from libc.

This should be fine, will aim to get this change in for 1.6.0 since there's already a lot going into 1.5.0.

Also, could you rename Illumos to illumos? It's always spelled with a lowercase "i" to avoid confusion between uppercase I and lowercase l.

Where exactly should it be renamed? The platform enum should stay Illumos to match Rust casing guidelines. Just the README and Display implementation on Platform?

@sunshowers
Copy link

sunshowers commented Mar 3, 2024

Yeah, readme, doc comments and Display impl. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants