Commit Graph

5803 Commits

Author SHA1 Message Date
Michael Stapelberg afdf67924a Merge pull request #2864 from stapelberg/fixconfig
Improve error messages for incorrect config lines starting with “set”
2017-08-20 13:16:53 +02:00
Michael Stapelberg 1e349ae3e1 t/201-config-parser: update expected token list 2017-08-20 13:12:06 +02:00
Michael Stapelberg c04b8592fd parser: only skip set[\s], not set.*
fixes #2564
2017-08-20 12:59:07 +02:00
Michael Stapelberg bb0aac6e39 start nagbar when encountering invalid set statements
related to #2564
2017-08-20 12:59:07 +02:00
Michael Stapelberg 8cc11dcb08 Skip lines consisting only of “set” 2017-08-20 12:59:03 +02:00
Michael Stapelberg dd019f59fa (Re-)initialize optional fields to empty strings 2017-08-20 12:55:55 +02:00
Michael Stapelberg c25bee0ffc Bugfix: check bounds before accessing memory
This fixes the following issue when having an error early in the config file:

==1562==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6220000180ff at pc 0x55c837edb1d3 bp 0x7ffee7534650 sp 0x7ffee7534648
READ of size 1 at 0x6220000180ff thread T0
    #0 0x55c837edb1d2 in start_of_line ../../i3/src/config_parser.c:238
    #1 0x55c837edc96f in parse_config ../../i3/src/config_parser.c:493
    #2 0x55c837edf527 in parse_file ../../i3/src/config_parser.c:1091
    #3 0x55c837ecf14b in parse_configuration ../../i3/src/config.c:65
    #4 0x55c837ed1ef4 in load_configuration ../../i3/src/config.c:230
    #5 0x55c837f0a8d0 in main ../../i3/src/main.c:539
    #6 0x7fb63ae042b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
    #7 0x55c837e95eb9 in _start (/home/michael/i3/build/i3+0x4beb9)

0x6220000180ff is located 1 bytes to the left of 5165-byte region [0x622000018100,0x62200001952d)
allocated by thread T0 here:
    #0 0x7fb63e590cf8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1cf8)
    #1 0x55c837f59aa6 in smalloc ../../i3/libi3/safewrappers.c:24
    #2 0x55c837edef45 in parse_file ../../i3/src/config_parser.c:1029
    #3 0x55c837ecf14b in parse_configuration ../../i3/src/config.c:65
    #4 0x55c837ed1ef4 in load_configuration ../../i3/src/config.c:230
    #5 0x55c837f0a8d0 in main ../../i3/src/main.c:539
    #6 0x7fb63ae042b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
2017-08-20 12:54:49 +02:00
Ingo Bürk ad8bb41686 Merge pull request #2863 from stapelberg/fixfreeze
i3bar: Bugfix: avoid freeze after VisibilityNotify
2017-08-20 12:25:06 +02:00
Michael Stapelberg 8106ae7923 i3bar: Bugfix: avoid freeze after VisibilityNotify
fixes #2790
2017-08-20 12:16:43 +02:00
Michael Stapelberg 4d93d26484 Bugfix: consider inactive monitors when querying (#2862)
fixes #2815
fixes #2594
2017-08-20 00:19:45 +02:00
Michael Stapelberg e6682f862b Merge pull request #2861 from stapelberg/ipcconfig
Introduce the GET_CONFIG IPC request
2017-08-19 19:23:02 +02:00
Michael Stapelberg d14c9bd6af Bump AnyEvent-I3 to 0.18 2017-08-19 19:08:53 +02:00
Michael Stapelberg a6d8ed9b1a Introduce the GET_CONFIG IPC request
This introduces memory usage by one copy of the config file, which is an
acceptable trade-off for being able to easily revert data loss.
The default config is 6KB, user configs will be in the same ballpark.

fixes #2856
2017-08-19 19:08:51 +02:00
Michael Stapelberg 6bb9c9e708 Makefile.am: fix anyevent-i3.stamp dependencies 2017-08-19 19:07:13 +02:00
Michael Stapelberg af24f07020 Merge pull request #2860 from stapelberg/anyevent-i3
Merge the AnyEvent-I3 repository into i3/AnyEvent-I3
2017-08-19 18:32:04 +02:00
Ingo Bürk 65dde35bbf Merge pull request #2859 from stapelberg/fixtests
Fix tests
2017-08-19 18:19:51 +02:00
Michael Stapelberg a91544b5b3 testcases: remove external AnyEvent::I3 dependency 2017-08-19 18:13:19 +02:00
Michael Stapelberg 062ecdb0b5 Move to AnyEvent-I3 2017-08-19 18:13:19 +02:00
Michael Stapelberg db35244ee7 tag 0.17 2017-08-19 18:13:19 +02:00
Michael Stapelberg f7645336cb use lib '.' for Perl 5.25.11+
see also https://rt.cpan.org/Ticket/Display.html?id=120943
2017-08-19 18:13:19 +02:00
Tony Crisci 0940f7b9d1 Add the shutdown event (#2)
The shutdown event is triggered when the ipc shuts down because of
either a restart or when i3 exits.
2017-08-19 18:13:19 +02:00
Michael Stapelberg 538c50c8ef support the barconfig_update and binding event, tag 0.16 2017-08-19 18:13:19 +02:00
Michael Stapelberg bd1c33588d support the window event, tag 0.15 2017-08-19 18:13:19 +02:00
Michael Stapelberg 85e98d8d7d fix doc error: missing opening brace (Thanks bitonic) 2017-08-19 18:13:19 +02:00
Michael Stapelberg b008d8b2e9 0.14: add support for the mode event 2017-08-19 18:13:19 +02:00
Michael Stapelberg 879266c40b update Changes file 2017-08-19 18:13:19 +02:00
Michael Stapelberg c3538c4cad bump version to 0.13 2017-08-19 18:13:19 +02:00
Michael Stapelberg 64fddbe41b Implement the GET_VERSION request (with a fallback to i3 --version) 2017-08-19 18:13:19 +02:00
Michael Stapelberg d8ad62c36f add a more involved example to the SYNOPSIS 2017-08-19 18:13:19 +02:00
Michael Stapelberg 3a7f5d7912 bump version to 0.12 2017-08-19 18:13:19 +02:00
Michael Stapelberg b4058790cc remove relative directories from $ENV{PATH} (for taint mode)
Otherwise, the module will die when you use it with PATH=$PATH:. (as is
the case on the OpenBSD cpan testers).
2017-08-19 18:13:19 +02:00
Michael Stapelberg af6f180c35 bump version to 0.11 2017-08-19 18:13:19 +02:00
Michael Stapelberg 4c97c94a0a taint mode fix for FreeBSD 2017-08-19 18:13:19 +02:00
Michael Stapelberg 2ec58b40f8 bump version to 0.10 2017-08-19 18:13:19 +02:00
Michael Stapelberg a6a0e11718 update copyright and URL/email 2017-08-19 18:13:19 +02:00
Michael Stapelberg 476e41ddc3 use i3 --get-socketpath by default for determining the socket path
This was introduced in i3 v4.1 (released 2011-11-11, so should be
widespread enough by now).
2017-08-19 18:13:19 +02:00
Michael Stapelberg 7021bb4315 Revert "implement the GET_LOG_MARKERS request" (no longer available)
This reverts commit 7e2ed06447af5e3b49af69dd24e2a5dec373ad9c.
2017-08-19 18:13:19 +02:00
Michael Stapelberg 3a9024de63 Bugfix: Also delete callbacks which are triggered due to an error 2017-08-19 18:13:19 +02:00
Michael Stapelberg ead1557468 implement the GET_LOG_MARKERS request
Requires i3 version 966c654112 or later.
2017-08-19 18:13:19 +02:00
Michael Stapelberg 23beaa83ea Bump version to 0.09 2017-08-19 18:13:19 +02:00
Michael Stapelberg 7a934b94dd Add TYPE_GET_MARKS and accompanying sugar method 2017-08-19 18:13:19 +02:00
Michael Stapelberg d7bd645863 Fix documentation for get_marks (s/tree/marks) 2017-08-19 18:13:19 +02:00
Michael Stapelberg 9054711650 Bump version to 0.08 2017-08-19 18:13:19 +02:00
Michael Stapelberg 1a272f96a5 Implement support for the TYPE_GET_MARKS request, add ->get_marks sugar method 2017-08-19 18:13:19 +02:00
Michael Stapelberg 6274959029 Bugfix: The synopsis mentioned ->workspaces, but it’s ->get_workspaces 2017-08-19 18:13:19 +02:00
Michael Stapelberg 7176a7074b introduce get_tree request (tree branch only) 2017-08-19 18:13:19 +02:00
Michael Stapelberg a3a42f30e1 Add check to Makefile to abort in a Windows environment (neither i3 nor unix sockets available)
Hopefully, this will stop CPAN Testers emails about failing tests on windows.
2017-08-19 18:13:19 +02:00
Michael Stapelberg da94674f8f bump version 2017-08-19 18:13:19 +02:00
Michael Stapelberg 192ef6a827 use getpwuid() to resolve ~ in socket paths instead of glob()
This fixes a warning about using a tainted variable (broke the
tests with newer perl versions).
2017-08-19 18:13:19 +02:00
Michael Stapelberg e656864838 use new default ipc-socket path, glob() path, bump version 2017-08-19 18:13:19 +02:00