mirror of
https://github.com/swaywm/sway.git
synced 2025-11-20 06:59:46 -05:00
commit
e4afd33d47
12 changed files with 35 additions and 14 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#define _XOPEN_SOURCE 500
|
||||
#define _POSIX_C_SOURCE 200809
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define _XOPEN_SOURCE 500
|
||||
#define _POSIX_C_SOURCE 200809
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define _XOPEN_SOURCE 500
|
||||
#define _POSIX_C_SOURCE 200809
|
||||
#include <libgen.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
|||
|
|
@ -366,13 +366,15 @@ int main(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
if (getuid() != geteuid() || getgid() != getegid()) {
|
||||
#ifdef __linux__
|
||||
// Retain capabilities after setuid()
|
||||
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) {
|
||||
wlr_log(WLR_ERROR, "Cannot keep caps after setuid()");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
suid = true;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -382,7 +384,7 @@ int main(int argc, char **argv) {
|
|||
detect_proprietary();
|
||||
detect_raspi();
|
||||
|
||||
#ifdef __linux__
|
||||
#if defined(__linux__) || defined(__FreeBSD__)
|
||||
drop_permissions(suid);
|
||||
#endif
|
||||
// handle SIGTERM signals
|
||||
|
|
|
|||
|
|
@ -140,6 +140,10 @@ bool server_init(struct sway_server *server) {
|
|||
|
||||
void server_fini(struct sway_server *server) {
|
||||
// TODO: free sway-specific resources
|
||||
#ifdef HAVE_XWAYLAND
|
||||
wlr_xwayland_destroy(server->xwayland.wlr_xwayland);
|
||||
#endif
|
||||
wl_display_destroy_clients(server->wl_display);
|
||||
wl_display_destroy(server->wl_display);
|
||||
list_free(server->dirty_containers);
|
||||
list_free(server->transactions);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define _XOPEN_SOURCE 500
|
||||
#define _POSIX_C_SOURCE 200809
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue