OpenBSD pledge(2) and unveil(2) support #157

Closed
emma wants to merge 0 commits from openbsd into main
Owner
No description provided.
emma added the
enhancement
label 2024-08-10 19:20:48 -06:00
emma added 25 commits 2024-08-10 19:20:48 -06:00
trinity added 1 commit 2024-08-10 22:04:16 -06:00
trinity added 4 commits 2024-08-10 22:30:28 -06:00
Author
Owner

As far as I’m concerned, this is ready for merging.

As far as I’m concerned, this is ready for merging.
Owner

I'm getting the following error message when trying to make:

rustc --extern getopt=build/o/libgetopt.rlib  --extern strerror=build/o/libstrerror.rlib  --extern sysexits=build/o/libsysexits.rlib --extern openbsd=build/o/libopenbsd.rlib --crate-type=lib --cra
te-name=openbsd  -o build/o/libopenbsd.rlib src/libopenbsd.rs
   |
57 |         match openbsd::pledge(arg1, arg2) {
   |               ^^^^^^^^^^^^^^^
   |
note: expected `*const u8`, found `*const i8`
  --> src/libopenbsd.rs:57:25
   |
57 |         match openbsd::pledge(arg1, arg2) {
   |                               ^^^^
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`
note: expected `*const u8`, found `*const i8`
  --> src/libopenbsd.rs:57:31
   |
57 |         match openbsd::pledge(arg1, arg2) {
   |                                     ^^^^
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`
note: function defined here
  --> src/libopenbsd.rs:28:10
   |
28 |         pub fn pledge(arg1: *const c_char, arg2: *const c_char) -> c_int;
   |                ^^^^^^

error[E0308]: arguments to this function are incorrect
  --> src/libopenbsd.rs:91:9
   |
91 |         match openbsd::unveil(arg1, arg2) {
   |               ^^^^^^^^^^^^^^^
   |
note: expected `*const u8`, found `*const i8`
  --> src/libopenbsd.rs:91:25
   |
91 |         match openbsd::unveil(arg1, arg2) {
   |                               ^^^^
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`
note: expected `*const u8`, found `*const i8`
  --> src/libopenbsd.rs:91:31
   |
91 |         match openbsd::unveil(arg1, arg2) {
   |                                     ^^^^
   = note: expected raw pointer `*const u8`
              found raw pointer `*const i8`
note: function defined here
  --> src/libopenbsd.rs:30:10
   |
30 |         pub fn unveil(arg1: *const c_char, arg2: *const c_char) -> c_int;
   |                ^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
*** Error 1 in /home/trinity/harakit (include/OpenBSD.mk:13 'build/o/libopenbsd.rlib')

Usual troubleshooting turns up empty:

$ git status
On branch openbsd
Your branch is up to date with 'origin/openbsd'.
$ make clean
rm -rf build dist
$ make
[many lines abridged]

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
*** Error 1 in /home/trinity/harakit (include/OpenBSD.mk:13 'build/o/libopenbsd.rlib')

Here's my uname:

$ uname -a
OpenBSD laika.my.domain 7.5 GENERIC#97 arm64
I'm getting the following error message when trying to `make`: ``` rustc --extern getopt=build/o/libgetopt.rlib --extern strerror=build/o/libstrerror.rlib --extern sysexits=build/o/libsysexits.rlib --extern openbsd=build/o/libopenbsd.rlib --crate-type=lib --cra te-name=openbsd -o build/o/libopenbsd.rlib src/libopenbsd.rs | 57 | match openbsd::pledge(arg1, arg2) { | ^^^^^^^^^^^^^^^ | note: expected `*const u8`, found `*const i8` --> src/libopenbsd.rs:57:25 | 57 | match openbsd::pledge(arg1, arg2) { | ^^^^ = note: expected raw pointer `*const u8` found raw pointer `*const i8` note: expected `*const u8`, found `*const i8` --> src/libopenbsd.rs:57:31 | 57 | match openbsd::pledge(arg1, arg2) { | ^^^^ = note: expected raw pointer `*const u8` found raw pointer `*const i8` note: function defined here --> src/libopenbsd.rs:28:10 | 28 | pub fn pledge(arg1: *const c_char, arg2: *const c_char) -> c_int; | ^^^^^^ error[E0308]: arguments to this function are incorrect --> src/libopenbsd.rs:91:9 | 91 | match openbsd::unveil(arg1, arg2) { | ^^^^^^^^^^^^^^^ | note: expected `*const u8`, found `*const i8` --> src/libopenbsd.rs:91:25 | 91 | match openbsd::unveil(arg1, arg2) { | ^^^^ = note: expected raw pointer `*const u8` found raw pointer `*const i8` note: expected `*const u8`, found `*const i8` --> src/libopenbsd.rs:91:31 | 91 | match openbsd::unveil(arg1, arg2) { | ^^^^ = note: expected raw pointer `*const u8` found raw pointer `*const i8` note: function defined here --> src/libopenbsd.rs:30:10 | 30 | pub fn unveil(arg1: *const c_char, arg2: *const c_char) -> c_int; | ^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. *** Error 1 in /home/trinity/harakit (include/OpenBSD.mk:13 'build/o/libopenbsd.rlib') ``` Usual troubleshooting turns up empty: ``` $ git status On branch openbsd Your branch is up to date with 'origin/openbsd'. $ make clean rm -rf build dist $ make [many lines abridged] error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. *** Error 1 in /home/trinity/harakit (include/OpenBSD.mk:13 'build/o/libopenbsd.rlib') ``` Here's my uname: ``` $ uname -a OpenBSD laika.my.domain 7.5 GENERIC#97 arm64 ```
emma added 1 commit 2024-08-14 00:32:40 -06:00
Author
Owner

The latest commit should fix this issue, @trinity. Please let me know.

The latest commit should fix this issue, @trinity. Please let me know.
Owner

Works great.

Works great.
trinity added 2 commits 2024-08-14 09:34:21 -06:00
trinity added 1 commit 2024-08-14 09:43:28 -06:00
trinity approved these changes 2024-08-14 10:10:17 -06:00
Author
Owner

Merged.

Merged.
emma closed this pull request 2024-08-15 18:10:51 -06:00
emma deleted branch openbsd 2024-08-15 18:10:56 -06:00
Owner

It doesn't look like some of my later commits got merged - include/None.mk is still in use in main.

It doesn't look like some of my later commits got merged - include/None.mk is still in use in main.
Author
Owner

It doesn't look like some of my later commits got merged - include/None.mk is still in use in main.

Fixed.

> It doesn't look like some of my later commits got merged - include/None.mk is still in use in main. Fixed.

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bonsai/harakit#157
No description provided.