Skip to content

Commit

Permalink
Remove pledge() support for OpenBSD (#6048)
Browse files Browse the repository at this point in the history
While this initially worked fine, at some point these patches broke
because libcairo started calling shmget(2) - a syscall not covered by
any pledge promise - and a common pitfall when using pledge with
graphics-oriented applications.

Various attempts were made to fix them, but at some time they were
simply disabled in the OpenBSD port:


openbsd/ports@a4a9f41
openbsd/ports@5a03c38

This seems pointless and creates needless friction both for the i3 team
who was willing to carry ugly code and for the OpenBSD ports maintainers
who had to disable that code again.

Let's abandon this experiment.
  • Loading branch information
botovq committed May 17, 2024
1 parent c06ac08 commit 854696c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions i3-msg/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ static yajl_callbacks config_callbacks = {
};

int main(int argc, char *argv[]) {
#if defined(__OpenBSD__)
if (pledge("stdio rpath unix", NULL) == -1) {
err(EXIT_FAILURE, "pledge");
}
#endif
char *socket_path = NULL;
int o, option_index = 0;
uint32_t message_type = I3_IPC_MESSAGE_TYPE_RUN_COMMAND;
Expand Down
6 changes: 0 additions & 6 deletions i3-nagbar/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,6 @@ int main(int argc, char *argv[]) {
font = load_font(pattern, true);
set_font(&font);

#if defined(__OpenBSD__)
if (pledge("stdio rpath wpath cpath getpw proc exec", NULL) == -1) {
err(EXIT_FAILURE, "pledge");
}
#endif

/* Default values if we cannot determine the preferred window position. */
xcb_rectangle_t win_pos = (xcb_rectangle_t){50, 50, 500, font.height + 2 * MSG_PADDING + BAR_BORDER};
if (position_on_primary) {
Expand Down
6 changes: 0 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,12 +1147,6 @@ int main(int argc, char *argv[]) {
}
}

#if defined(__OpenBSD__)
if (pledge("stdio rpath wpath cpath proc exec unix", NULL) == -1) {
err(EXIT_FAILURE, "pledge");
}
#endif

if (!disable_signalhandler) {
setup_signal_handler();
} else {
Expand Down

0 comments on commit 854696c

Please sign in to comment.