Skip to content

Commit

Permalink
Release 2.2.2
Browse files Browse the repository at this point in the history
- Adjust Cagebreak to wlroot 0.17
- Improve README & SECURITY.md
  • Loading branch information
project-repo committed Dec 4, 2023
1 parent 61e7f8a commit 61fb97b
Show file tree
Hide file tree
Showing 40 changed files with 205 additions and 189 deletions.
20 changes: 20 additions & 0 deletions Hashes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Hashes

2.2.2 cagebreak

* sha 256: 98e0dfe870a7242fdf7c6fb1a5c520cfe7d1154b3f139560da6cb86b2430b2a0
* sha 512: c335f8f6e226203e797e232caead74db9b1e7f24d5edf80dd99a0c00c5f4e81351a5ddcad4f601a12618ebed5c62be547462c4f06ae4ccb6a622a869ee8741ec

2.2.2 cagebreak.1

* sha 256: c655fff018377b5ee541854ee428559ba4c5080d44f87247fe608f18651b0764
* sha 512: 7cbef17cbe3c59cde21466d6c76e1a34ffce748d2d9011a77bd7703f605b737e344cabaad1e3a599316321481524cb860b2533ab6bef2e7714c00b2641fe962c

2.2.2 cagebreak-config.5

* sha 256: b799e0252d7224befc92bdd143d00dc3f42a38e39f510f3ace575b03f293a788
* sha 512: 3778db9ff07429efb74b4b07476193844698e07ea91a742aac078391ba38fb07987dc61ba312c30b6eb04ad2d847ee552826e7a09be8dc572be5626c27059df3

2.2.2 cagebreak-socket.7

* sha 256: dd10359fd1840909bb817858668e67bdd433f367b0ed199328e4b29c99529322
* sha 512: 67f8c39864472c9b2396946a943ce249297b1b9fc5e452a4051f0512fd61b4a22906e1a16aee1c2bf6cacb3b9cd7a11da19c5d760c192020402008eab379eee1

2.2.1 cagebreak

* sha 256: 96469a78eeaddf9476c82e0ab8a0e35a95b3119bf83633a54feb8f3f5780df2f
Expand Down
51 changes: 21 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cagebreak: A Wayland Tiling Compositor

[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.2.1)](https://repology.org/project/cagebreak/versions)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.2.2)](https://repology.org/project/cagebreak/versions)

## Quick Introduction

Expand All @@ -9,25 +9,21 @@ based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](htt

### Purpose

The goal of this project is to provide a successor to ratpoison for Wayland.
This project provides a successor to ratpoison for Wayland.
However, this is no reimplementation of ratpoison.

#### New Features, Bugs and Contact Information

Should you want to know if a feature will be implemented, file a bug or
get in touch, [open an issue](https://github.com/project-repo/cagebreak/issues/new)
You can [open an issue](https://github.com/project-repo/cagebreak/issues/new)
or write an e-mail (See [SECURITY.md](SECURITY.md) for details.).

The Roadmap section outlines what is planned for the future.
The Roadmap section outlines our plans.

#### Compatibility & Development Distribution

Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries
(and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman)
at the time of release. Any other use is out of scope.

Most other setups probably work with a bit of luck. We
make no guarantees.
and versions from extra and core at the time of release.
Most other setups work with a bit of luck.

### Quick Installation

Expand All @@ -42,27 +38,22 @@ details on getting started and the documentation for everything else.

### Documentation

* the rest of this file
* the man pages:
* [cagebreak](man/cagebreak.1.md)
* [configuration](man/cagebreak-config.5.md)
* [socket](man/cagebreak-socket.7.md)
* the [FAQ](FAQ.md)
* [SECURITY.md](SECURITY.md)
* the man pages: [cagebreak](man/cagebreak.1.md), [configuration](man/cagebreak-config.5.md) & [socket](man/cagebreak-socket.7.md)
* the [README](README.md), [FAQ](FAQ.md) & [SECURITY.md](SECURITY.md)

#### What's new?

See the [Changelog](Changelog.md).
Check the [Changelog](Changelog.md).

### Uninstallation

`pacman -R cagebreak` should be sufficient.

### Contributing

* Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your idea.
We will consider the proposal and get back to you.
* Don't open a pull request. We might not accept your code and
* [Open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your idea.
We will get back to you.
* Ask before you open a pull request. We might not accept your code and
it would be sad to waste the effort.
* Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never
had to intervene - Keep it that way!)
Expand Down Expand Up @@ -208,29 +199,29 @@ as a source of inspiration and explanations for certain particularities.
## Contributing

* Read this document.
* Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request.
We will consider the proposal and get back to you.
* Don't open a pull request without asking first. We might not accept your
* [Open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request.
We will get back to you.
* Ask before opening a pull request. We might not accept your
code and it would be sad to waste the effort.
* Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never
had to intervene - Please keep it that way!)

### Good First Contributions

* Reviewing the project is always welcome.
* Reviews are always welcome.
* Read the code.
* Read the documentation.
* Test whether the documentation matches the code.
* Test Cagebreak in more esoteric setups (many monitors, for instance).
* Compile the code.
* Ideas on improving the testing and quality assurance are particularly
welcome.
* If you want, you can share your cagebreak scripts and we might include them
in the repository provided you agree to release them under MIT and we agree
with the use case and coding style.
* Iff you are happy with Cagebreak and use Arch Linux, you may vote for
* You can share your cagebreak scripts and we might include them with Cagebreak
provided you agree to release them under MIT and we agree with the
use case and coding style.
* If you are happy with Cagebreak under Arch Linux, you may vote for
[Cagebreak in the AUR](https://aur.archlinux.org/packages/cagebreak).
* The points above still apply.
* The points from the Contributing section above still apply.

### Philosophy

Expand Down
33 changes: 15 additions & 18 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,50 +51,47 @@ public key or provide the fingerprint and directions to obtain the key.

## Threat Model

Cagebreak is a wayland compositor run by the user of the system
and thus has access to whichever resources this user has access to.
Cagebreak can restrict other programs in no way, because this would hamper
usability (consider a web browser unable to write a downloaded file to disk
for instance).
Cagebreak is a wayland compositor run by a user and has access to
the resources the user has access to.
Cagebreak cannot restrict other programs (consider a web browser
unable to write a downloaded file for instance).

There is no transmission of information by cagebreak other than to the
screens, ipc and potentially other documented local channels.

### STRIDE Threat List

This is not a thorough analysis, just an overview of the ways in which cagebreak
has (no) attack surface. Please reference the man pages for details but especially
the -e and --bs options.
has (no) attack surface. Please reference the man pages (especially options -e and --bs ).

#### Spoofing

Not applicable - Using Cagebreak already requires a login as a user.
Not applicable - Cagebreak is executed after user login.

#### Tampering

Not applicable - Cagebreak must allow system manipulation for user software.
Not applicable - Cagebreak allows system manipulation for user software.

#### Repudiation

Not applicable - There are no prohibited operations (See Tampering above.).
While cagebreak does send events over documented channels there is no logging
activated by default, though, of course, this can be changed by the user
by logging socket output (if enabled) for example.
Cagebreak sends events over documented channels. There is no logging
activated by default - this can be changed by logging the socket (if enabled) for example.

#### Information Disclosure

Not applicable - Information disclosure over documented channels is a feature
and any software run by the user may exfiltrate any data the user has access to.
Not applicable - Information disclosure over documented channels is a feature.
Any user software may exfiltrate any data the user has access to.

#### Denial of Service

Not applicable - Cagebreak offers functionality to terminate itself, which is
available to all user software over the socket if the socket is enabled.
Not applicable - Cagebreak offers functionality to terminate itself. This is
available to user software over the socket (if enabled).

#### Elevation of Privilege

Software may gain arbitrary code execution rights if it has access to the
Cagebreak socket. Privilege escalation to root is unlikely since privileges
Software may gain arbitrary code execution if it has access to the
socket (if enabled). Privilege escalation to root is unlikely since privileges
are dropped before any user input is accepted.

## GPG Keys of the Cagebreak Repository
Expand Down
28 changes: 12 additions & 16 deletions cagebreak.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/types/wlr_primary_selection_v1.h>
Expand Down Expand Up @@ -368,7 +368,7 @@ main(int argc, char *argv[]) {
wl_event_loop_add_signal(event_loop, SIGPIPE, handle_signal, &server);
server.event_loop = event_loop;

backend = wlr_backend_autocreate(server.wl_display);
backend = wlr_backend_autocreate(server.wl_display, &server.session);
if(!backend) {
wlr_log(WLR_ERROR, "Unable to create the wlroots backend");
ret = 1;
Expand Down Expand Up @@ -428,9 +428,10 @@ main(int argc, char *argv[]) {
ret = 1;
goto end;
}
wlr_scene_attach_output_layout(server.scene, server.output_layout);
server.scene_output_layout =
wlr_scene_attach_output_layout(server.scene, server.output_layout);

compositor = wlr_compositor_create(server.wl_display, server.renderer);
compositor = wlr_compositor_create(server.wl_display, 6, server.renderer);
if(!compositor) {
wlr_log(WLR_ERROR, "Unable to create the wlroots compositor");
ret = 1;
Expand Down Expand Up @@ -474,14 +475,8 @@ main(int argc, char *argv[]) {
goto end;
}

server.idle = wlr_idle_create(server.wl_display);
if(!server.idle) {
wlr_log(WLR_ERROR, "Unable to create the idle tracker");
ret = 1;
goto end;
}

server.idle_inhibit_v1 = wlr_idle_inhibit_v1_create(server.wl_display);
server.idle = wlr_idle_notifier_v1_create(server.wl_display);
if(!server.idle_inhibit_v1) {
wlr_log(WLR_ERROR, "Cannot create the idle inhibitor");
ret = 1;
Expand Down Expand Up @@ -687,6 +682,12 @@ main(int argc, char *argv[]) {

wl_display_run(server.wl_display);

#if CG_HAS_XWAYLAND
if(server.xwayland != NULL) {
wlr_xwayland_destroy(server.xwayland);
}
#endif

wl_display_destroy_clients(server.wl_display);

end:
Expand Down Expand Up @@ -734,11 +735,6 @@ main(int argc, char *argv[]) {
if(server.seat != NULL) {
seat_destroy(server.seat);
}
#if CG_HAS_XWAYLAND
if(server.xwayland != NULL) {
wlr_xwayland_destroy(server.xwayland);
}
#endif

if(sigint_source != NULL) {
wl_event_source_remove(sigint_source);
Expand Down
10 changes: 5 additions & 5 deletions fuzz/fuzz-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include <wlr/types/wlr_keyboard_group.h>
#include <wlr/types/wlr_output_damage.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/types/wlr_primary_selection_v1.h>
Expand Down Expand Up @@ -271,9 +270,10 @@ LLVMFuzzerInitialize(int *argc, char ***argv) {
ret = 1;
goto end;
}
wlr_scene_attach_output_layout(server.scene, server.output_layout);
server.scene_output_layout =
wlr_scene_attach_output_layout(server.scene, server.output_layout);

compositor = wlr_compositor_create(server.wl_display, server.renderer);
compositor = wlr_compositor_create(server.wl_display, 5, server.renderer);
if(!compositor) {
wlr_log(WLR_ERROR, "Unable to create the wlroots compositor");
ret = 1;
Expand Down Expand Up @@ -310,7 +310,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) {
goto end;
}

server.idle = wlr_idle_create(server.wl_display);
server.idle = wlr_idle_notifier_v1_create(server.wl_display);
if(!server.idle) {
wlr_log(WLR_ERROR, "Unable to create the idle tracker");
ret = 1;
Expand Down
4 changes: 2 additions & 2 deletions idle_inhibit_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: MIT

#include <wayland-server-core.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>

#include "idle_inhibit_v1.h"
#include "server.h"
Expand All @@ -24,7 +24,7 @@ idle_inhibit_v1_check_active(struct cg_server *server) {
/* As of right now, this does not check whether the inhibitor
* is visible or not.*/
bool inhibited = !wl_list_empty(&server->inhibitors);
wlr_idle_set_enabled(server->idle, NULL, !inhibited);
wlr_idle_notifier_v1_set_inhibited(server->idle, inhibited);
}
#if CG_HAS_FANALYZE
#pragma GCC diagnostic pop
Expand Down
24 changes: 11 additions & 13 deletions keybinding.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <wlr/backend/session.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_keyboard_group.h>
#include <wlr/types/wlr_output_damage.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_xcursor_manager.h>
Expand Down Expand Up @@ -506,11 +505,10 @@ keybinding_workspace_fullscreen(struct cg_server *server) {

// Switch to a differerent virtual terminal
static int
keybinding_switch_vt(struct wlr_backend *backend, unsigned int vt) {
if(wlr_backend_is_multi(backend)) {
struct wlr_session *session = wlr_backend_get_session(backend);
if(session) {
wlr_session_change_vt(session, vt);
keybinding_switch_vt(struct cg_server *server, unsigned int vt) {
if(wlr_backend_is_multi(server->backend)) {
if(server->session) {
wlr_session_change_vt(server->session, vt);
}
return 0;
}
Expand Down Expand Up @@ -1627,11 +1625,11 @@ void
set_cursor(bool enabled, struct cg_seat *seat) {
if(enabled == true) {
seat->enable_cursor = true;
wlr_xcursor_manager_set_cursor_image(seat->xcursor_manager,
DEFAULT_XCURSOR, seat->cursor);
wlr_cursor_set_xcursor(seat->cursor, seat->xcursor_manager,
DEFAULT_XCURSOR);
} else {
seat->enable_cursor = false;
wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0);
wlr_cursor_unset_image(seat->cursor);
}
}

Expand All @@ -1645,7 +1643,7 @@ run_action(enum keybinding_action action, struct cg_server *server,
server->running = false;
break;
case KEYBINDING_CHANGE_TTY:
return keybinding_switch_vt(server->backend, data.u);
return keybinding_switch_vt(server, data.u);
case KEYBINDING_CURSOR:
set_cursor(data.i, server->seat);
break;
Expand Down Expand Up @@ -1688,9 +1686,9 @@ run_action(enum keybinding_action action, struct cg_server *server,
if(data.u != server->seat->default_mode) {
wlr_seat_pointer_notify_clear_focus(server->seat->seat);
if(server->seat->enable_cursor == true) {
wlr_xcursor_manager_set_cursor_image(
server->seat->xcursor_manager, "dot_box_mask",
server->seat->cursor);
wlr_cursor_set_xcursor(server->seat->cursor,
server->seat->xcursor_manager,
"dot_box_mask");
}
}
server->seat->mode = data.u;
Expand Down
2 changes: 1 addition & 1 deletion man/cagebreak-config.5.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cagebreak-config(5) "Version 2.2.1" "Cagebreak Manual"
cagebreak-config(5) "Version 2.2.2" "Cagebreak Manual"

# NAME

Expand Down
Loading

0 comments on commit 61fb97b

Please sign in to comment.