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

Address review comments on libuv patch #41

Merged
merged 6 commits into from
Feb 6, 2025

Conversation

staticfloat
Copy link
Member

This is a new version of #16 based against julia-uv2-1.48.0.

This hopefully addresses the two actionable comments from @erw7. In particular:

  • We use AccessCheck() unconditionally on during access().

  • I don't allow other to have more permissions than group. This is necessary because in cases like chmod("foo", 0o757), the DENY entry for group (necessary because other has more permissions than group) ends up blocking the user, due to the fact that user belongs to group. So I just mask out any bits that other has that group doesn't, so 0o757 turns into 0o755. You can still have 0o057, or 0o700 or whatever, it's just the case where other has bits that group doesn't that gets fixed up.

@staticfloat
Copy link
Member Author

I'm testing Yggdrasil build here: JuliaPackaging/Yggdrasil#10316

staticfloat added a commit to JuliaLang/julia that referenced this pull request Jan 22, 2025
@staticfloat
Copy link
Member Author

Julia testing PR: JuliaLang/julia#57126

staticfloat added a commit to JuliaLang/julia that referenced this pull request Jan 23, 2025
staticfloat added a commit to JuliaLang/julia that referenced this pull request Feb 3, 2025
staticfloat added a commit to JuliaLang/julia that referenced this pull request Feb 4, 2025
staticfloat added a commit to JuliaLang/julia that referenced this pull request Feb 4, 2025
@staticfloat
Copy link
Member Author

@vtjnash This passed tests in https://buildkite.com/julialang/julia-master/builds/44361#0194cf76-9df8-4206-bbb2-6bcbbade9ff3, so I've rebased to clean up history a bit and I think it's ready to merge now.

@staticfloat
Copy link
Member Author

One thing to note, the following tests needed to be adjusted:

@vtjnash
Copy link
Member

vtjnash commented Feb 5, 2025

CI did something weird there it seems. Can you rebase? I just pushed the various recent commits to fix CI from upstream

@vtjnash
Copy link
Member

vtjnash commented Feb 5, 2025

I see; that wasn't actually your fault. I've fixed the branch content mistake, so now it should go through.

No longer shy away from using `AccessCheck()` for simple `W_OK`/`R_OK`
checks; use it for all calls unconditionally.

It turns out that `F_OK` is supposed to only check for path existence,
and because it is `0x00`, it ends up confusing the Windows APIs below
where it looks like we're asking for the null set of permissions, so
handle that as well.
Because our ACL implementation does not have the required flexibility to
represent situations such as `0o757` due to the permissions ordering
that Windows naturally applies, we simply do not allow the `other`
entity to have permissions that the `group` entity does not have.  This
causes `chmod(0o757)` to be transparently mapped to `chmod(0o755)`, as
an example.
Previously, we would apply permissions only to groups that we were a
part of, but we should apply our "other" permissions to groups that we
are not a part of.
So we must handle that appropriately in this helper function
* Use `DWORD` instead of `mode_t` on Windows. It's not needed to use `mode_t` here, and it just confuses VS.

* Define `S_IRWXU` and others if not already defined.

* When compiling on my windows testing box, I get the error:

```
error: initialization of 'SECURITY_INFORMATION' {aka 'long unsigned int'} from 'void *' makes integer from pointer without a cast [-Wint-conversion]
 2317 |   SECURITY_INFORMATION si = NULL;
```
@staticfloat staticfloat merged commit b859d12 into julia-uv2-1.48.0 Feb 6, 2025
6 of 17 checks passed
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.

2 participants