-
Notifications
You must be signed in to change notification settings - Fork 223
Add support for OpenBSD #325
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
base: master
Are you sure you want to change the base?
Conversation
it's already defined in /usr/include/math.h on OpenBSD
sprinkle #if HAVE_WORDEXP where used include config.h first to only include wordexp.h if needed
more lines, but functionally equivalent.
OpenBSD doesn't have/need libcrypt or librt
- like done in swaywm/swaylock#325, provide an alternative for swayidle configuration file lookup - and provide a handrolled config line parser for 'timeout' commands, using strspn(), strchr() and asprintf() - the latter is in recent POSIX so move _POSIX_C_SOURCE 200809L definition within #if HAVE_WORDEXP - OpenBSD doesn't (and won't) have support for systemd/logind, so only care about timeout commands
Our Can we just completely get rid of it? |
oh definitely ! i see that |
Yeah, that one is for |
backports/adapted from swaywm/sway@1d62d6bf note: as a side effect, env vars can't be used anymore for image paths
|
elif is_openbsd | ||
warning('The swaylock binary must be setgid when compiled with bsd auth') | ||
warning('You must do this manually post-install: chgrp auth /path/to/swaylock ; chmod g+s /path/to/swaylock') | ||
sources += ['bsdauth.c'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use login_passwd(8) instead to avoid this requirement?
Running the locker as root likely has funny attack vectors.
E.g.: point WAYLAND_DISPLAY
to another user's socket and lock their session.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swaylock already has a SUID-root mode for the shadow backend. We drop privileges early in the main process.
OpenBSD has initial/wip wayland support, so add support for building/using swaylock on OpenBSD. It uses http://man.openbsd.org/auth_userokay for user authentication so integrates well with the various login methods.
There's no
wordexp()
on OpenBSD:so i've written a small function to lookup for configuration files in the same paths, and i've tested that it was functionally equivalent.
been able to use swaylock with
image=/usr/local/share/backgrounds/xfce/xfce-blue.jpg
in~/.config/swaylock/config swaylock
and it does what's expected.Feedback welcome !