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

Allow openat, subject to the same restrictions as open. #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

khuey
Copy link

@khuey khuey commented Oct 26, 2017

glibc 2.26 switches from using open(2) to openat(2). And now everyone on earth with a seccomp filter gets to update it :)

@jdm
Copy link
Member

jdm commented Feb 20, 2018

error[E0425]: cannot find value `O_DIRECTORY` in this scope
   --> platform/linux/seccomp.rs:272:55
    |
272 |                 filter.if_arg2_hasnt_set(!(O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW) as u32,
    |                                                       ^^^^^^^^^^^ not found in this scope
    |
help: possible candidate is found in another module, you can import it into scope
    |
19  | use libc::O_DIRECTORY;
    |
error[E0425]: cannot find value `O_NOFOLLOW` in this scope
   --> platform/linux/seccomp.rs:272:105
    |
272 |                 filter.if_arg2_hasnt_set(!(O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW) as u32,
    |                                                                                                         ^^^^^^^^^^ not found in this scope
    |
help: possible candidate is found in another module, you can import it into scope
    |
19  | use libc::O_NOFOLLOW;
    |
warning: unused `#[macro_use]` import
  --> lib.rs:11:1
   |
11 | #[macro_use]
   | ^^^^^^^^^^^^
   |
   = note: #[warn(unused_imports)] on by default
error[E0308]: mismatched types
   --> platform/linux/seccomp.rs:271:34
    |
271 |             filter.if_syscall_is(libc::SYS_openat, |filter| {
    |                                  ^^^^^^^^^^^^^^^^ expected u32, found i64
    |
    = help: here are some functions which might fulfill your needs:
            - .count_ones()
            - .count_zeros()
            - .leading_zeros()
            - .trailing_zeros()
error[E0599]: no method named `if_arg2_hasnt_set` found for type `&mut platform::linux::seccomp::Filter` in the current scope
   --> platform/linux/seccomp.rs:272:24
    |
272 |                 filter.if_arg2_hasnt_set(!(O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW) as u32,
    |                        ^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
error: Could not compile `gaol`.

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