From 2da91699cab7bbfd0e7b808f4447b4310ad56587 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 18:13:42 +0100 Subject: [PATCH] Release 1.6.0 - Add support for non-build dependencies - Add default build without pandoc dependency - Fix Issue 24 - Fix Issue 25 --- Bugs.md | 26 ++++++++++- README.md | 22 ++++++++- keybinding.c | 19 ++++++-- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 94 +++++++++++++++++++++----------------- meson_options.txt | 1 + output.c | 2 +- signatures/1.5.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 10 files changed, 118 insertions(+), 50 deletions(-) create mode 100644 signatures/1.5.1.sig diff --git a/Bugs.md b/Bugs.md index 580f458..8072b7e 100644 --- a/Bugs.md +++ b/Bugs.md @@ -76,7 +76,7 @@ workspace 2. Therefore, this change would simplify the code base, while at the same time increasing the feature set. PS: As a side effect, this would allow quirky statements such as -`bind dbind r hsplit` which would bind the d key to binding the r key to +`bind d bind r hsplit` which would bind the d key to binding the r key to split the output... ``` @@ -297,3 +297,27 @@ Cagebreak up to and including release 1.4.4 had a potential use-after-free bug. Cagebreak up to and including release 1.4.4 could have focussed views without tiles. +### Issue 24 + + * github issue number: N/A + * Fixed: 1.6.0 + +Cagebreak up to and including release 1.5.1 had an error, where the code +incremented a variable and not a pointer. This resulted in a bug in a +surface counting iterator. + +### Issue 25 + + * github issue number: N/A + * Fixed: 1.6.0 + +Cagebreak, beginning with release 1.5.0, when a keybinding containing an output +configuration is removed from the list of active keybindings, the output +configuration contained in this keybinding is destroyed in order to +prevent memory leaks. However, after an output configuration was applied, +it was inserted into the list of active output configurations and if it +was later destroyed, this led to a use-after-free memory corruption. +Starting from release 1.6.0, output configurations are copied before +being inserted into the list of active output configurations and +therefore remain valid even if the original is freed. + diff --git a/README.md b/README.md index e22c300..87ae370 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,11 @@ option. Then, add `-Dxwayland=true` to the `meson` command above. Note that you'll need to have the XWayland binary installed on your system for this to work. +#### Man Pages + +Cagebreak has man pages. To use them, make sure that you have `pandoc` +installed. Then, add `-Dman-pages=true to the `meson` command. + ### Running Cagebreak You can start Cagebreak by running `./build/cagebreak`. If you run it from @@ -171,7 +176,7 @@ There are reproducibility issues up to and including release `1.2.0`. See All hashes and signatures are provided for the following build instructions. ``` -meson build -Dxwayland=true --buildtype=release +meson build -Dxwayland=true -Dman-pages=true --buildtype=release ninja -C build ``` @@ -179,6 +184,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.6.0 + + * sha 256: aef473eae73454429afb158d66a7bd9aec75ef915845b7508de5448820357aa8 + * sha 512: 17889bc1af9f343598a5ee599b25e702987dd0bd905a9566874e8a0094c57168e413938624949fa214e6e382cbcf89d7342292b44012cd8e692947f6c01a960a + 1.5.1 * sha 256: 9c6df4b94c180f5657cb424383aa2bf3aca063c8e7b40af0497be1ef7bdb858a @@ -399,6 +409,16 @@ Adds close command for windows as described in the man pages. Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. +### Release 1.6.0 + +Adds support for non-build dependencies and an option for builds without pandoc. + +## Contributors + + * Aisha Tammy + * [make man pages optional](https://github.com/project-repo/cagebreak/pull/4), released + in 1.6.0 with slight modifications + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) diff --git a/keybinding.c b/keybinding.c index 8f70ffd..29739a4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -832,25 +832,36 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { void keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) { + struct cg_output_config *config; + config = malloc(sizeof(struct cg_output_config)); + if(config == NULL) { + wlr_log(WLR_ERROR, + "Could not allocate memory for server configuration."); + return; + } + + *config = *cfg; + config->output_name = strdup(cfg->output_name); + struct cg_output_config *it, *tmp; wl_list_for_each_safe(it, tmp, &server->output_config, link) { - if(strcmp(cfg->output_name, it->output_name) == 0) { + if(strcmp(config->output_name, it->output_name) == 0) { wl_list_remove(&it->link); free(it->output_name); free(it); } } - wl_list_insert(&server->output_config, &cfg->link); + wl_list_insert(&server->output_config, &config->link); struct cg_output *output, *tmp_output; wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { - if(strcmp(cfg->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); return; } } wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { - if(strcmp(cfg->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); return; } diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index f879352..693215d 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.5.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.6.0 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 5832a7c..6b6e381 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.5.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.6.0 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 80e7035..e61eedc 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.5.1', + version: '1.6.0', license: 'MIT', default_options: [ 'c_std=c11', @@ -175,47 +175,57 @@ endforeach foreach header : cagebreak_header_strings cagebreak_headers += files(header) endforeach +# Dependencies marked with "true" are required to have +# the version specified below in order for the build +# to be reproducible. cagebreak_dependencies_dict = { - 'server_protos': server_protos, - 'wayland_server': wayland_server, - 'wayland_client': wayland_client, - 'wayland_cursor': wayland_cursor, - 'wlroots': wlroots, - 'xkbcommon': xkbcommon, - 'fontconfig': fontconfig, - 'pixman': pixman, - 'pango': pango, - 'cairo': cairo, - 'pangocairo': pangocairo, - 'math': math + 'server_protos': [server_protos,true], + 'wayland_server': [wayland_server,false], + 'wayland_client': [wayland_client,true], + 'wayland_cursor': [wayland_cursor,true], + 'wlroots': [wlroots,true], + 'xkbcommon': [xkbcommon,true], + 'fontconfig': [fontconfig,true], + 'pixman': [pixman,true], + 'pango': [pango,true], + 'cairo': [cairo,true], + 'pangocairo': [pangocairo,true], + 'math': [math,true], } reproducible_build_versions = { 'server_protos': '-1', - 'wayland_server': '1.18.0', - 'wayland_client': '1.18.0', - 'wayland_cursor': '1.18.0', + 'wayland_server': '1.19.0', + 'wayland_client': '1.19.0', + 'wayland_cursor': '1.19.0', 'wlroots': '0.12.0', - 'xkbcommon': '1.0.3', + 'xkbcommon': '1.1.0', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.48.1', + 'pango': '1.48.2', 'cairo': '1.17.4', - 'pangocairo': '1.48.1', + 'pangocairo': '1.48.2', 'math': '-1' } cagebreak_dependencies = [] foreach name, dep : cagebreak_dependencies_dict - cagebreak_dependencies += dep + cagebreak_dependencies += dep[0] endforeach foreach name, dep : cagebreak_dependencies_dict - if reproducible_build_versions[name] != '-1' and reproducible_build_versions[name] != dep.version() - warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' - ) - break + if reproducible_build_versions[name] != '-1' + if dep[1] == false + if dep[0].version() < reproducible_build_versions[name] + warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') is older than the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). It is recommended to use an up-to-date version for compiling cagebreak.' + ) + endif + elif reproducible_build_versions[name] != dep[0].version() + warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' + ) + break + endif endif endforeach @@ -237,25 +247,27 @@ executable( c_args: fuzz_compile_args, ) -pandoc = find_program('pandoc') -mandir1 = join_paths(get_option('mandir'), 'man1') -mandir5 = join_paths(get_option('mandir'), 'man5') +if get_option('man-pages') + pandoc = find_program('pandoc') + mandir1 = join_paths(get_option('mandir'), 'man1') + mandir5 = join_paths(get_option('mandir'), 'man5') -cagebreak_man = custom_target('cagebreak_man', - output : 'cagebreak.1', - input : 'man/cagebreak.1.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], - install: true, - install_dir: mandir1 - ) + cagebreak_man = custom_target('cagebreak_man', + output : 'cagebreak.1', + input : 'man/cagebreak.1.md', + command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + install: true, + install_dir: mandir1 + ) -cagebreak_man = custom_target('cagebreak_config_man', - output : 'cagebreak-config.5', - input : 'man/cagebreak-config.5.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], - install: true, - install_dir: mandir5 - ) + cagebreak_man = custom_target('cagebreak_config_man', + output : 'cagebreak-config.5', + input : 'man/cagebreak-config.5.md', + command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + install: true, + install_dir: mandir5 + ) +endif if get_option('fuzz') subdir('fuzz') diff --git a/meson_options.txt b/meson_options.txt index bb96c4f..b6dcb79 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') +option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages (requires pandoc)') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') diff --git a/output.c b/output.c index 42ed10e..6ec3c11 100644 --- a/output.c +++ b/output.c @@ -207,7 +207,7 @@ static void count_surface_iterator(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *_box, void *data) { size_t *n = data; - n++; + (*n)++; } static bool diff --git a/signatures/1.5.1.sig b/signatures/1.5.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..0afd9eabddb0f83c8a85296736cfc8f0eaef3e0b GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$>e_M*s>55XjaY zi`4o&Mr@o9|6k4`z-t|msi>5D)%KJ8V+2hhVWgz$wBer3gf$EQOo&8U->tJQcrdWj z4_MKMt23mz7;v~${lZnGa5<)SJ^^s87>Je1MUC$NP0|39GQZYwX&vh`LlxuQll} z@wK4$OoE!I&Q*;gzO5iyqUZE?->LTidE_FQ&eNwQrTP@x;q!2zTJHVsW7bwZMjGG|+7ftd zy+S0j$BZW3jL$YH^IPwZvSn>YfgMEA`6lhJc5}-}X7r&&RVPKJnf-ggnMPGt*D3*0p(`HXEwvI?-C&_%jsJ9c6=v zr0mEE4*xmV{HmGky5~C{YiS?1#qyR@Vt3nCZMANG=^96fVt<@ceBao9#@pi+zq!3W zfo^VfAJh=nOe{xB^chU+z9)Gun}&`^uF)CdEgtH*lj)YBl6n*k#H_VpA^9N1CiYUU z$@$R$%~yfvI=b9|Aluy3*MTPKkZ?#j0QD}mw$a;Ma7`&r|Ps2a| zMFmUq?`b?#VP)9Z9MF0s*rrE%vJ_z4o5p!nSC%MK(zt#H(THNX0*PBtSGRewb>xlt zNl{Z2&Y`DGf{)-0yVP7rM8`KW2)&8N`G%NMs0_@wG0z&t^r5i|1^3h7W(mRpY?OS73Bp>HXR%QZaxF@-gPaVI+`j} gb0?mn8W#?tx9>e2a={N5951sZ=^Lx#C{SLKhIM5GeE55XjaYi`4o&Mr@o9|6k4`z-t|msi>5D)%KJ8V+2hh zVWgz$wBer3gf$EQOo&8U->tJQcrdWj4_MKMt23mz7;v~${lZnGa5<)SJ^^s87>Je1 zMUC$NP0|39GQt!1% z{%A#h)ykU-osN-NPAD}%oU}%}Wu!y=;POmlTFY&dv((&=vhEIfp!ZJ$X0QBRK7}Y#0s606D z!g8|JP!7z51b@MpE{P55j_KM5G^0Ohaq-J`v*2}+wOgE)pL;>&GL*>(tR1F^67Cq)8qtFb?I14W*b`68sHJy5_oLALL{@tj3(WT&o(LZTknptWo<`+9YoRj gChf0wa~I1