From 0cfaac072df2bc0ca6693c6262ec5753076e3fe9 Mon Sep 17 00:00:00 2001 From: valoq Date: Tue, 15 Feb 2022 17:59:40 +0100 Subject: [PATCH 01/29] add rseq syscall --- zathura/seccomp-filters.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index d5ef257..04d77d3 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -203,6 +203,7 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(recvfrom); ALLOW_RULE(recvmsg); ALLOW_RULE(restart_syscall); + ALLOW_RULE(rseq); ALLOW_RULE(rt_sigaction); ALLOW_RULE(rt_sigprocmask); ALLOW_RULE(sendmsg); From b951d024a5ebf7a64d36ee57f73f059ca6d78798 Mon Sep 17 00:00:00 2001 From: valoq Date: Sun, 3 Apr 2022 20:59:32 +0200 Subject: [PATCH 02/29] clean process shutdown by sandbox --- zathura/seccomp-filters.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 04d77d3..7c44995 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -132,7 +132,10 @@ seccomp_enable_strict_filter(void) } /* initialize the filter */ - scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_KILL); + /* ENOSYS tells the calling process that the syscall is not implemented, + * allowing for a potential fallback function to execute + * scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_ERRNO(ENOSYS));*/ + scmp_filter_ctx ctx = seccomp_init(SCMP_ACT_KILL_PROCESS); if (ctx == NULL){ girara_error("seccomp_init failed"); return -1; From 99c831ab826b56e29339d68fdc4dc11b432ec37f Mon Sep 17 00:00:00 2001 From: valoq Date: Fri, 8 Apr 2022 22:59:47 +0200 Subject: [PATCH 03/29] improve seccomp filter --- zathura/seccomp-filters.c | 124 +++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 61 deletions(-) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 7c44995..2dc4b54 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -11,6 +11,9 @@ #include #include #include +#include /* for clone filter */ + + #define ADD_RULE(str_action, action, call, ...) \ do { \ @@ -100,8 +103,12 @@ seccomp_enable_basic_filter(void) DENY_RULE(uselib); DENY_RULE(vmsplice); - /* TODO: check for additional syscalls to blacklist */ - /* DENY_RULE (execve); */ + /*TODO + * + * In case this basic filter is actually triggered, print a clear error message to report this + * The syscalls here should never be executed by an unprivileged process + * + * */ /* applying filter... */ if (seccomp_load(ctx) >= 0) { @@ -142,13 +149,11 @@ seccomp_enable_strict_filter(void) } ALLOW_RULE(access); - /* ALLOW_RULE (arch_prctl); */ ALLOW_RULE(bind); ALLOW_RULE(brk); ALLOW_RULE(clock_getres); - ALLOW_RULE(clone); /* TODO: investigate */ + /* ALLOW_RULE(clone); specified below */ ALLOW_RULE(close); - /* ALLOW_RULE (connect); */ ALLOW_RULE(eventfd2); ALLOW_RULE(exit); ALLOW_RULE(exit_group); @@ -170,23 +175,19 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(getpid); ALLOW_RULE(getppid); ALLOW_RULE(gettid); - /* ALLOW_RULE (getpeername); */ ALLOW_RULE(getrandom); ALLOW_RULE(getresgid); ALLOW_RULE(getresuid); ALLOW_RULE(getrlimit); ALLOW_RULE(getpeername); - /* ALLOW_RULE (getsockname); */ - /* ALLOW_RULE (getsockopt); needed for access to x11 socket in network namespace (without abstract sockets) */ ALLOW_RULE(inotify_add_watch); ALLOW_RULE(inotify_init1); ALLOW_RULE(inotify_rm_watch); - /* ALLOW_RULE (ioctl); specified below */ + /* ALLOW_RULE (ioctl); specified below */ ALLOW_RULE(lseek); ALLOW_RULE(lstat); ALLOW_RULE(madvise); ALLOW_RULE(memfd_create); - ALLOW_RULE(mkdir); /* needed for first run only */ ALLOW_RULE(mmap); ALLOW_RULE(mprotect); ALLOW_RULE(mremap); @@ -197,9 +198,8 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(pipe); ALLOW_RULE(pipe2); ALLOW_RULE(poll); - ALLOW_RULE(pwrite64); /* TODO: build detailed filter */ + ALLOW_RULE(pwrite64); ALLOW_RULE(pread64); - /* ALLOW_RULE (prlimit64); */ /* ALLOW_RULE (prctl); specified below */ ALLOW_RULE(read); ALLOW_RULE(readlink); @@ -209,12 +209,12 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(rseq); ALLOW_RULE(rt_sigaction); ALLOW_RULE(rt_sigprocmask); + ALLOW_RULE(sched_setattr); + ALLOW_RULE(sched_getattr); ALLOW_RULE(sendmsg); ALLOW_RULE(sendto); ALLOW_RULE(select); ALLOW_RULE(set_robust_list); - /* ALLOW_RULE (set_tid_address); */ - /* ALLOW_RULE (setsockopt); */ ALLOW_RULE(shmat); ALLOW_RULE(shmctl); ALLOW_RULE(shmdt); @@ -223,30 +223,51 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(stat); ALLOW_RULE(statx); ALLOW_RULE(statfs); - /* ALLOW_RULE (socket); */ ALLOW_RULE(sysinfo); ALLOW_RULE(uname); ALLOW_RULE(unlink); - ALLOW_RULE(write); /* specified below (zathura needs to write files)*/ + ALLOW_RULE(write); ALLOW_RULE(writev); - ALLOW_RULE(wait4); /* trying to open links should not crash the app */ + ALLOW_RULE(wait4); - /* ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), sched_setattr, 0); */ - /* ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), sched_getattr, 0); */ - - /* required by glib */ - ALLOW_RULE(sched_setattr); - ALLOW_RULE(sched_getattr); /* required by some X11 setups */ - ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), umask, 0); - ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), socket, 0); + /* X11 no longer supported in strict sandbox mode */ + /* ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), umask, 0); */ + /* ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), socket, 0); */ /* required for testing only */ ALLOW_RULE(timer_create); ALLOW_RULE(timer_delete); + + /* filter clone arguments */ + ADD_RULE("allow", SCMP_ACT_ALLOW, clone, 1, SCMP_CMP(0, SCMP_CMP_EQ, \ + CLONE_VM | \ + CLONE_FS | \ + CLONE_FILES | \ + CLONE_SIGHAND | \ + CLONE_THREAD | \ + CLONE_SYSVSEM | \ + CLONE_SETTLS | \ + CLONE_PARENT_SETTID | \ + CLONE_CHILD_CLEARTID)); + + + + /* fcntl filter - not yet working */ + /*ADD_RULE("allow", SCMP_ACT_ALLOW, fcntl, 1, SCMP_CMP(0, SCMP_CMP_EQ, \ + F_GETFL | \ + F_SETFL | \ + F_ADD_SEALS | \ + F_SEAL_SEAL | \ + F_SEAL_SHRINK | \ + F_DUPFD_CLOEXEC | \ + F_SETFD | \ + FD_CLOEXEC )); */ + + /* Special requirements for ioctl, allowed on stdout/stderr */ ADD_RULE("allow", SCMP_ACT_ALLOW, ioctl, 1, SCMP_CMP(0, SCMP_CMP_EQ, 1)); ADD_RULE("allow", SCMP_ACT_ALLOW, ioctl, 1, SCMP_CMP(0, SCMP_CMP_EQ, 2)); @@ -256,53 +277,34 @@ seccomp_enable_strict_filter(void) ADD_RULE("allow", SCMP_ACT_ALLOW, prctl, 1, SCMP_CMP(0, SCMP_CMP_EQ, PR_SET_PDEATHSIG)); /* special restrictions for open, prevent opening files for writing */ - ADD_RULE("allow", SCMP_ACT_ALLOW, open, 1, SCMP_CMP(1, SCMP_CMP_MASKED_EQ, O_WRONLY | O_RDWR, 0)); + ADD_RULE("allow", SCMP_ACT_ALLOW, open, 1, SCMP_CMP(1, SCMP_CMP_MASKED_EQ, O_WRONLY | O_RDWR, 0)); ADD_RULE("errno", SCMP_ACT_ERRNO(EACCES), open, 1, SCMP_CMP(1, SCMP_CMP_MASKED_EQ, O_WRONLY, O_WRONLY)); ADD_RULE("errno", SCMP_ACT_ERRNO(EACCES), open, 1, SCMP_CMP(1, SCMP_CMP_MASKED_EQ, O_RDWR, O_RDWR)); /* special restrictions for openat, prevent opening files for writing */ - ADD_RULE("allow", SCMP_ACT_ALLOW, openat, 1, SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_WRONLY | O_RDWR, 0)); + ADD_RULE("allow", SCMP_ACT_ALLOW, openat, 1, SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_WRONLY | O_RDWR, 0)); ADD_RULE("errno", SCMP_ACT_ERRNO(EACCES), openat, 1, SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_WRONLY, O_WRONLY)); ADD_RULE("errno", SCMP_ACT_ERRNO(EACCES), openat, 1, SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_RDWR, O_RDWR)); - /* allowed for debugging: */ - - /* ALLOW_RULE (prctl); */ - /* ALLOW_RULE (ioctl); */ - - /* TODO: test fcntl rules */ - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, F_GETFL)) < 0) */ - /* goto out; */ - - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, F_SETFL)) < 0) */ - /* goto out; */ - - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, F_SETFD)) < 0) */ - /* goto out; */ - - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, F_GETFD)) < 0) */ - /* goto out; */ - - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(fcntl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, F_SETLK)) < 0) */ - /* goto out; */ - /* TODO: build detailed filter for prctl */ - /* needed by gtk??? (does not load content without) */ - /* /\* special restrictions for prctl, only allow PR_SET_NAME/PR_SET_PDEATHSIG *\/ */ - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(prctl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, PR_SET_NAME)) < 0) */ - /* goto out; */ + /* Sandbox Status Notes: + * + * write: no actual files on the filesystem are opened with write permissions + * exception is /run/user/UID/dconf/user (file descriptor not available during runtime) + * + * + * mkdir: needed for first run only to create /run/user/UID/dconf (before seccomp init) + * wait4: required to attempt opening links (which is then blocked) + * + * X11 environments require umask and socket syscalls after sandbox setup + * no longer supported since X11 cannot be easily secured anyway + * + * TODO: prevent dbus socket connection before sandbox init - by checking the sandbox settings in zathurarc + * + */ - /* if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, SCMP_SYS(prctl), 1, */ - /* SCMP_CMP(0, SCMP_CMP_EQ, PR_SET_PDEATHSIG)) < 0) */ - /* goto out; */ /* when zathura is run on wayland, with X11 server available but blocked, unset the DISPLAY variable */ /* otherwise it will try to connect to X11 using inet socket protocol */ From b25637a8be5cc90f7bb93aa3cbeb4f229c3826ff Mon Sep 17 00:00:00 2001 From: valoq Date: Wed, 13 Apr 2022 10:22:59 +0200 Subject: [PATCH 04/29] Allow restricted socket syscall for X11 support --- zathura/seccomp-filters.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 2dc4b54..02e29bd 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -224,23 +224,21 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(statx); ALLOW_RULE(statfs); ALLOW_RULE(sysinfo); + ALLOW_RULE(umask); /* required by X11 */ ALLOW_RULE(uname); ALLOW_RULE(unlink); ALLOW_RULE(write); ALLOW_RULE(writev); ALLOW_RULE(wait4); - - /* required by some X11 setups */ - /* X11 no longer supported in strict sandbox mode */ - /* ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), umask, 0); */ - /* ADD_RULE("errno", SCMP_ACT_ERRNO(EPERM), socket, 0); */ - - /* required for testing only */ ALLOW_RULE(timer_create); ALLOW_RULE(timer_delete); + + /* permit the socket syscall for local UNIX domain sockets (required by X11) */ + ADD_RULE("allow", SCMP_ACT_ALLOW, socket, 1, SCMP_CMP(0, SCMP_CMP_EQ, AF_UNIX)); + /* filter clone arguments */ ADD_RULE("allow", SCMP_ACT_ALLOW, clone, 1, SCMP_CMP(0, SCMP_CMP_EQ, \ @@ -255,7 +253,6 @@ seccomp_enable_strict_filter(void) CLONE_CHILD_CLEARTID)); - /* fcntl filter - not yet working */ /*ADD_RULE("allow", SCMP_ACT_ALLOW, fcntl, 1, SCMP_CMP(0, SCMP_CMP_EQ, \ F_GETFL | \ @@ -303,6 +300,7 @@ seccomp_enable_strict_filter(void) * * TODO: prevent dbus socket connection before sandbox init - by checking the sandbox settings in zathurarc * + * TODO: check requirement of pipe/pipe2 syscalls when dbus is disabled */ From de0d881f9c536c8afa18f5ab93f000812c23acef Mon Sep 17 00:00:00 2001 From: valoq Date: Sun, 17 Apr 2022 18:28:34 +0200 Subject: [PATCH 05/29] Permit some syscalls on X11 only --- zathura/seccomp-filters.c | 26 +++++++++++++++++++++++--- zathura/seccomp-filters.h | 4 +++- zathura/zathura.c | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 02e29bd..6ac2a0e 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -13,6 +13,9 @@ #include #include /* for clone filter */ +#ifdef GDK_WINDOWING_X11 +#include +#endif #define ADD_RULE(str_action, action, call, ...) \ @@ -124,7 +127,7 @@ out: } int -seccomp_enable_strict_filter(void) +seccomp_enable_strict_filter(zathura_t* zathura) { /* prevent child processes from getting more priv e.g. via setuid, capabilities, ... */ if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) { @@ -235,9 +238,26 @@ seccomp_enable_strict_filter(void) ALLOW_RULE(timer_create); ALLOW_RULE(timer_delete); + +/* Permit X11 specific syscalls */ +#ifdef GDK_WINDOWING_X11 + GdkDisplay* display = gtk_widget_get_display(zathura->ui.session->gtk.view); + + if (GDK_IS_X11_DISPLAY (display)) { - /* permit the socket syscall for local UNIX domain sockets (required by X11) */ - ADD_RULE("allow", SCMP_ACT_ALLOW, socket, 1, SCMP_CMP(0, SCMP_CMP_EQ, AF_UNIX)); + girara_debug("On X11, supporting X11 syscalls"); + + /* permit the socket syscall for local UNIX domain sockets (required by X11) */ + ADD_RULE("allow", SCMP_ACT_ALLOW, socket, 1, SCMP_CMP(0, SCMP_CMP_EQ, AF_UNIX)); + + ALLOW_RULE(mkdir); + ALLOW_RULE(setsockopt); + ALLOW_RULE(connect); + } + else { + girara_debug("On Wayland, blocking X11 syscalls"); + } +#endif /* filter clone arguments */ diff --git a/zathura/seccomp-filters.h b/zathura/seccomp-filters.h index 57bfbb1..b934da5 100644 --- a/zathura/seccomp-filters.h +++ b/zathura/seccomp-filters.h @@ -3,6 +3,8 @@ #ifndef ZATHURA_SECCOMP_FILTERS_H #define ZATHURA_SECCOMP_FILTERS_H +#include "zathura.h" + /* basic filter */ /* this mode allows normal use */ /* only dangerous syscalls are blacklisted */ @@ -10,6 +12,6 @@ int seccomp_enable_basic_filter(void); /* strict filter before document parsing */ /* this filter is to be enabled after most of the initialisation of zathura has finished */ -int seccomp_enable_strict_filter(void); +int seccomp_enable_strict_filter(zathura_t* zathura); #endif diff --git a/zathura/zathura.c b/zathura/zathura.c index b3222ce..b2ccc4b 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -451,7 +451,7 @@ zathura_init(zathura_t* zathura) break; case ZATHURA_SANDBOX_STRICT: girara_debug("Strict sandbox preventing write and network access."); - if (seccomp_enable_strict_filter() != 0) { + if (seccomp_enable_strict_filter(zathura) != 0) { girara_error("Failed to initialize strict seccomp filter."); goto error_free; } From 2f0cdb95ec9022026b90a127007cc5642b44471d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 7 May 2022 20:55:00 +0200 Subject: [PATCH 06/29] Render synctex rectangles after sending the dbus reply If rendering of the rectangle takes too long, the connection on the message bus times out. --- zathura/dbus-interface.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/zathura/dbus-interface.c b/zathura/dbus-interface.c index c99adb5..0c718b0 100644 --- a/zathura/dbus-interface.c +++ b/zathura/dbus-interface.c @@ -260,6 +260,40 @@ handle_goto_page(zathura_t* zathura, GVariant* parameters, g_dbus_method_invocation_return_value(invocation, result); } +typedef struct { + zathura_t* zathura; + girara_list_t** rectangles; + unsigned int page; + unsigned int number_of_pages; +} highlights_rect_data_t; + +static gboolean +synctex_highlight_rects_impl(gpointer ptr) +{ + highlights_rect_data_t* data = ptr; + + synctex_highlight_rects(data->zathura, data->page, data->rectangles); + + for (unsigned int i = 0; i != data->number_of_pages; ++i) { + girara_list_free(data->rectangles[i]); + } + g_free(data->rectangles); + return false; +} + +static void +synctex_highlight_rects_idle(zathura_t* zathura, girara_list_t** rectangles, + unsigned int page, unsigned number_of_pages) +{ + highlights_rect_data_t* data = g_try_malloc0(sizeof(highlights_rect_data_t)); + data->zathura = zathura; + data->rectangles = rectangles; + data->page = page; + data->number_of_pages = number_of_pages; + + gdk_threads_add_idle(synctex_highlight_rects_impl, data); +} + static void handle_highlight_rects(zathura_t* zathura, GVariant* parameters, GDBusMethodInvocation* invocation) @@ -357,8 +391,8 @@ handle_highlight_rects(zathura_t* zathura, GVariant* parameters, } g_variant_iter_free(secondary_iter); - synctex_highlight_rects(zathura, page, rectangles); - g_free(rectangles); + /* run synctex_highlight_rects in main thread when idle */ + synctex_highlight_rects_idle(zathura, rectangles, page, number_of_pages); GVariant* result = g_variant_new("(b)", true); g_dbus_method_invocation_return_value(invocation, result); From b92388c31a150e7cb486c74706edfff9bb6f54d1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 7 May 2022 23:06:55 +0200 Subject: [PATCH 07/29] Add clang-format configuration --- .clang-format | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..ed79b5e --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +--- +Language: Cpp +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: true +AlignOperands: true +AllowShortBlocksOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: All +BreakBeforeBraces: Linux +ContinuationIndentWidth: 2 +ColumnLimit: 120 +ForEachMacros: ['GIRARA_LIST_FOREACH'] +IndentWidth: 2 +PointerAlignment: Left +TabWidth: 2 +IndentCaseLabels: true +... + From cadb6f2029bd37fbefb0d04984e8726b1d2ab654 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 7 May 2022 23:56:26 +0200 Subject: [PATCH 08/29] Update translations --- po/ar.po | 4 ++-- po/ca.po | 4 ++-- po/cs.po | 4 ++-- po/de.po | 4 ++-- po/el.po | 4 ++-- po/eo.po | 6 +++--- po/es.po | 25 +++++++++++++------------ po/es_CL.po | 4 ++-- po/et.po | 4 ++-- po/fr.po | 4 ++-- po/he.po | 4 ++-- po/hr.po | 8 ++++---- po/id_ID.po | 4 ++-- po/it.po | 19 ++++++++++--------- po/lt.po | 4 ++-- po/nl.po | 6 +++--- po/no.po | 4 ++-- po/pl.po | 10 +++++----- po/pt_BR.po | 4 ++-- po/ru.po | 10 +++++----- po/sv.po | 4 ++-- po/ta_IN.po | 4 ++-- po/tr.po | 4 ++-- po/uk_UA.po | 4 ++-- 24 files changed, 77 insertions(+), 75 deletions(-) diff --git a/po/ar.po b/po/ar.po index 7d9934a..02da813 100644 --- a/po/ar.po +++ b/po/ar.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" "Last-Translator: abouzakaria kov \n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Language-Team: Arabic (http://www.transifex.com/pwmt/zathura/language/ar/)\n" "Language: ar\n" "MIME-Version: 1.0\n" diff --git a/po/ca.po b/po/ca.po index 65f4e26..2731014 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Catalan (http://www.transifex.com/pwmt/zathura/language/ca/)\n" "Language: ca\n" diff --git a/po/cs.po b/po/cs.po index 36d5460..ce5e245 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Czech (http://www.transifex.com/pwmt/zathura/language/cs/)\n" "Language: cs\n" diff --git a/po/de.po b/po/de.po index d46d4bb..5848578 100644 --- a/po/de.po +++ b/po/de.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-02-13 19:17+0100\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: German (http://www.transifex.com/pwmt/zathura/language/de/)\n" "Language: de\n" diff --git a/po/el.po b/po/el.po index 465a46a..2e771df 100644 --- a/po/el.po +++ b/po/el.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Greek (http://www.transifex.com/pwmt/zathura/language/el/)\n" "Language: el\n" diff --git a/po/eo.po b/po/eo.po index 377eb75..5e3e38c 100644 --- a/po/eo.po +++ b/po/eo.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" -"Last-Translator: Sebastian Ramacher \n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" +"Last-Translator: norbux , 2012\n" "Language-Team: Esperanto (http://www.transifex.com/pwmt/zathura/language/" "eo/)\n" "Language: eo\n" diff --git a/po/es.po b/po/es.po index d27a79a..497e487 100644 --- a/po/es.po +++ b/po/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Spanish (http://www.transifex.com/pwmt/zathura/language/es/)\n" "Language: es\n" @@ -32,9 +32,9 @@ msgid "" "completely view and navigate through documents without using a mouse." msgstr "" "Zathura es un visor de documentos altamente personalizable y funcional. " -"Proporciona una interfaz ligera y minimalista, fácil de usar, pensada para ser" -" utilizada con teclado. Zathura posibilita ver y navegar por documentos sin " -"necesidad de utilizar el ratón." +"Proporciona una interfaz ligera y minimalista, fácil de usar, pensada para " +"ser utilizada con teclado. Zathura posibilita ver y navegar por documentos " +"sin necesidad de utilizar el ratón." #: data/org.pwmt.zathura.appdata.xml.in:17 msgid "" @@ -447,8 +447,8 @@ msgstr "Mostrar el nombre del archivo en el título de la ventana" #: zathura/config.c:277 msgid "Use ~ instead of $HOME in the filename in the window title" -msgstr "Mostrar ~ en lugar de $HOME en el nombre de archivo del título de la " -"ventana" +msgstr "" +"Mostrar ~ en lugar de $HOME en el nombre de archivo del título de la ventana" #: zathura/config.c:279 msgid "Display the page number in the window title" @@ -464,8 +464,8 @@ msgstr "Mostrar el nombre corto del archivo en la barra de estado" #: zathura/config.c:285 msgid "Use ~ instead of $HOME in the filename in the statusbar" -msgstr "Mostrar ~ en lugar de $HOME en el nombre de archivo de la barra de " -"estado" +msgstr "" +"Mostrar ~ en lugar de $HOME en el nombre de archivo de la barra de estado" #: zathura/config.c:287 msgid "Display (current page / total pages) as a percent in the statusbar" @@ -591,7 +591,8 @@ msgstr "Error al tratar de ejecutar xdg-open" #: zathura/links.c:247 msgid "Opening external applications in strict sandbox mode is not permitted" -msgstr "La apertura de aplicaciones externas en modo sandbox estricto no está " +msgstr "" +"La apertura de aplicaciones externas en modo sandbox estricto no está " "permitida" #: zathura/links.c:280 @@ -725,8 +726,8 @@ msgstr "[Sin nombre]" #: zathura/zathura.c:837 msgid "Could not read file from stdin and write it to a temporary file." -msgstr "No se pudo leer el archivo desde stdin y escribirlo en un archivo " -"temporal." +msgstr "" +"No se pudo leer el archivo desde stdin y escribirlo en un archivo temporal." #: zathura/zathura.c:857 msgid "Could not read file from GIO and copy it to a temporary file." diff --git a/po/es_CL.po b/po/es_CL.po index eb24799..b7b9de1 100644 --- a/po/es_CL.po +++ b/po/es_CL.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Spanish (Chile) (http://www.transifex.com/pwmt/zathura/" "language/es_CL/)\n" diff --git a/po/et.po b/po/et.po index 6109930..bc0255c 100644 --- a/po/et.po +++ b/po/et.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Estonian (http://www.transifex.com/pwmt/zathura/language/" "et/)\n" diff --git a/po/fr.po b/po/fr.po index 747dda8..24ef251 100644 --- a/po/fr.po +++ b/po/fr.po @@ -12,8 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Benjamin Betti \n" "Language-Team: French (http://www.transifex.com/pwmt/zathura/language/fr/)\n" "Language: fr\n" diff --git a/po/he.po b/po/he.po index 09f2753..5db7ae0 100644 --- a/po/he.po +++ b/po/he.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Hebrew (http://www.transifex.com/pwmt/zathura/language/he/)\n" "Language: he\n" diff --git a/po/hr.po b/po/hr.po index bd7f3fa..56f229d 100644 --- a/po/hr.po +++ b/po/hr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Croatian (http://www.transifex.com/pwmt/zathura/language/" "hr/)\n" @@ -15,8 +15,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #: data/org.pwmt.zathura.appdata.xml.in:7 data/org.pwmt.zathura.desktop.in:5 msgid "Zathura" diff --git a/po/id_ID.po b/po/id_ID.po index 48b6e69..fb96a93 100644 --- a/po/id_ID.po +++ b/po/id_ID.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Indonesian (Indonesia) (http://www.transifex.com/pwmt/zathura/" "language/id_ID/)\n" diff --git a/po/it.po b/po/it.po index d08681e..3576989 100644 --- a/po/it.po +++ b/po/it.po @@ -11,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Simone Dotto \n" "Language-Team: Italian (http://www.transifex.com/pwmt/zathura/language/it/)\n" "Language: it\n" @@ -331,7 +331,7 @@ msgstr "Colore per evidenziare" #: zathura/config.c:218 msgid "Foreground color for highlighting" -msgstr "" +msgstr "Colore di primo piano per l'evidenziazione" #: zathura/config.c:220 msgid "Color for highlighting (active)" @@ -474,6 +474,7 @@ msgstr "Usa ~ al posto di $HOME nel nome del file nella barra di stato" #: zathura/config.c:287 msgid "Display (current page / total pages) as a percent in the statusbar" msgstr "" +"Mostra (pagina attuale / pagine totali) in percentuale nella barra di stato" #: zathura/config.c:289 msgid "Enable synctex support" @@ -489,7 +490,7 @@ msgstr "Abilita il servizio D-Bus" #: zathura/config.c:293 msgid "Raise window on certain D-Bus commands" -msgstr "" +msgstr "Solleva la finestra in corrispondenza di certi comandi di D-Bus" #: zathura/config.c:295 msgid "Save history at each page change" @@ -587,7 +588,7 @@ msgstr "Mostra informazioni sulla versione" #: zathura/config.c:516 msgid "Source config file" -msgstr "" +msgstr "File di configurazione sorgente" #: zathura/links.c:233 msgid "Failed to run xdg-open." @@ -616,12 +617,12 @@ msgstr "Link: non valido" #: zathura/links.c:305 #, c-format msgid "Copied page number: %d" -msgstr "" +msgstr "Copiata pagina numero: %d" #: zathura/links.c:314 #, c-format msgid "Copied link: %s" -msgstr "" +msgstr "Copiato il link: %s" #: zathura/main.c:151 msgid "Reparents to window specified by xid (X11)" @@ -681,7 +682,7 @@ msgstr "Avvia in una modalità non standard" #: zathura/main.c:165 msgid "Bookmark to go to" -msgstr "" +msgstr "Segnalibro a cui andare" #: zathura/main.c:166 msgid "Search for the given phrase and display results" @@ -753,7 +754,7 @@ msgstr "Il documento non contiene alcuna pagina" #: zathura/zathura.c:1371 #, c-format msgid "File already exists: %s. Use :write! to overwrite it." -msgstr "" +msgstr "Il file esiste già: %s. Usa :write! per sovrascriverlo." #: zathura/zathura.c:1380 msgid "Failed to save document." diff --git a/po/lt.po b/po/lt.po index 87606ee..457dd36 100644 --- a/po/lt.po +++ b/po/lt.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Lithuanian (http://www.transifex.com/pwmt/zathura/language/" "lt/)\n" diff --git a/po/nl.po b/po/nl.po index 0d13ab8..a591c10 100644 --- a/po/nl.po +++ b/po/nl.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 19:20+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: Dutch (http://www.transifex.com/pwmt/zathura/language/nl/)\n" "Language: nl\n" @@ -469,7 +469,7 @@ msgstr "~ gebruiken i.p.v. $HOME in de bestandsnaam in de statusbalk" #: zathura/config.c:287 msgid "Display (current page / total pages) as a percent in the statusbar" -msgstr "" +msgstr "Huidige pagina/Totaalaantal in procenten tonen op statusbalk" #: zathura/config.c:289 msgid "Enable synctex support" diff --git a/po/no.po b/po/no.po index 871c25d..98106ee 100644 --- a/po/no.po +++ b/po/no.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Norwegian (http://www.transifex.com/pwmt/zathura/language/" "no/)\n" diff --git a/po/pl.po b/po/pl.po index 43296f0..56b0744 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,17 +8,17 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Polish (http://www.transifex.com/pwmt/zathura/language/pl/)\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" -"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" -"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && " +"(n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && " +"n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" #: data/org.pwmt.zathura.appdata.xml.in:7 data/org.pwmt.zathura.desktop.in:5 msgid "Zathura" diff --git a/po/pt_BR.po b/po/pt_BR.po index 4d2b1a6..aa71123 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Fernando Henrique \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/pwmt/zathura/" "language/pt_BR/)\n" diff --git a/po/ru.po b/po/ru.po index 9631c26..dd2465e 100644 --- a/po/ru.po +++ b/po/ru.po @@ -12,17 +12,17 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: AlexanderFilev \n" "Language-Team: Russian (http://www.transifex.com/pwmt/zathura/language/ru/)\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" -"%100>=11 && n%100<=14)? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || " +"(n%100>=11 && n%100<=14)? 2 : 3);\n" #: data/org.pwmt.zathura.appdata.xml.in:7 data/org.pwmt.zathura.desktop.in:5 msgid "Zathura" diff --git a/po/sv.po b/po/sv.po index d498994..f474385 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Rasmussen \n" "Language-Team: Swedish (http://www.transifex.com/pwmt/zathura/language/sv/)\n" "Language: sv\n" diff --git a/po/ta_IN.po b/po/ta_IN.po index 23a3485..99bb7d4 100644 --- a/po/ta_IN.po +++ b/po/ta_IN.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Tamil (India) (http://www.transifex.com/pwmt/zathura/language/" "ta_IN/)\n" diff --git a/po/tr.po b/po/tr.po index 43cf0ed..67cd9d6 100644 --- a/po/tr.po +++ b/po/tr.po @@ -12,8 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-08 05:07+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Bunyamin Can Sahan\n" "Language-Team: Turkish (http://www.transifex.com/pwmt/zathura/language/tr/)\n" "Language: tr\n" diff --git a/po/uk_UA.po b/po/uk_UA.po index 0f5c2c4..d80fb91 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-12 12:54+0100\n" -"PO-Revision-Date: 2022-01-06 14:12+0000\n" +"POT-Creation-Date: 2022-05-07 23:53+0200\n" +"PO-Revision-Date: 2012-03-26 16:47+0000\n" "Last-Translator: Юрій Яновський \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/pwmt/zathura/" "language/uk_UA/)\n" From 6b0461be2338cf70a497088b61ac97849db26723 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 10:36:08 +0200 Subject: [PATCH 09/29] Hide an internal type types.h is for types accessible to plugins. --- zathura/content-type.c | 1 + zathura/content-type.h | 7 ++++--- zathura/zathura.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/zathura/content-type.c b/zathura/content-type.c index 842b74f..9b82983 100644 --- a/zathura/content-type.c +++ b/zathura/content-type.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: Zlib */ #include "content-type.h" +#include "macros.h" #include #ifdef WITH_MAGIC diff --git a/zathura/content-type.h b/zathura/content-type.h index 47f0ad1..36ca062 100644 --- a/zathura/content-type.h +++ b/zathura/content-type.h @@ -3,7 +3,9 @@ #ifndef ZATHURA_CONTENT_TYPE_H #define ZATHURA_CONTENT_TYPE_H -#include "types.h" +#include + +typedef struct zathura_content_type_context_s zathura_content_type_context_t; /** * Create new context for content type detection. @@ -26,8 +28,7 @@ void zathura_content_type_free(zathura_content_type_context_t* context); * @param path file name * @return content type of path, needs to freeed with g_free. */ -char* zathura_content_type_guess(zathura_content_type_context_t* context, - const char* path, +char* zathura_content_type_guess(zathura_content_type_context_t* context, const char* path, const girara_list_t* supported_content_types); #endif diff --git a/zathura/zathura.h b/zathura/zathura.h index ea0f038..4423741 100644 --- a/zathura/zathura.h +++ b/zathura/zathura.h @@ -90,6 +90,8 @@ typedef enum { /* forward declaration for types from database.h */ typedef struct _ZathuraDatabase zathura_database_t; +/* forward declaration for types from content-type.h */ +typedef struct zathura_content_type_context_s zathura_content_type_context_t; struct zathura_s { From 076cec96b508ff2c0abda7e825d68691d1c534d8 Mon Sep 17 00:00:00 2001 From: valoq Date: Sun, 8 May 2022 13:43:56 +0200 Subject: [PATCH 10/29] sandbox improvements --- zathura/seccomp-filters.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 6ac2a0e..503e807 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -227,7 +227,7 @@ seccomp_enable_strict_filter(zathura_t* zathura) ALLOW_RULE(statx); ALLOW_RULE(statfs); ALLOW_RULE(sysinfo); - ALLOW_RULE(umask); /* required by X11 */ + /* ALLOW_RULE(umask); allowed for X11 only below */ ALLOW_RULE(uname); ALLOW_RULE(unlink); ALLOW_RULE(write); @@ -253,6 +253,7 @@ seccomp_enable_strict_filter(zathura_t* zathura) ALLOW_RULE(mkdir); ALLOW_RULE(setsockopt); ALLOW_RULE(connect); + ALLOW_RULE(umask); } else { girara_debug("On Wayland, blocking X11 syscalls"); @@ -315,8 +316,6 @@ seccomp_enable_strict_filter(zathura_t* zathura) * mkdir: needed for first run only to create /run/user/UID/dconf (before seccomp init) * wait4: required to attempt opening links (which is then blocked) * - * X11 environments require umask and socket syscalls after sandbox setup - * no longer supported since X11 cannot be easily secured anyway * * TODO: prevent dbus socket connection before sandbox init - by checking the sandbox settings in zathurarc * From 47c67b53bdd3ace137fb430526fdc9c6bd634c0f Mon Sep 17 00:00:00 2001 From: valoq Date: Sun, 8 May 2022 14:29:06 +0200 Subject: [PATCH 11/29] update documentation --- doc/man/zathurarc.5.rst | 3 +++ zathura/seccomp-filters.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/man/zathurarc.5.rst b/doc/man/zathurarc.5.rst index 1ee368f..3d7f84a 100644 --- a/doc/man/zathurarc.5.rst +++ b/doc/man/zathurarc.5.rst @@ -967,6 +967,9 @@ zathura * printing * bookmarks and history + The strict sandbox mode is still experimental with some libc implementations. + Currently supported and tested libc implementations: glibc + No feature regressions are expected when using normal sandbox mode. When running under WSL, the default is "none" since seccomp is not supported in diff --git a/zathura/seccomp-filters.c b/zathura/seccomp-filters.c index 503e807..1f2b173 100644 --- a/zathura/seccomp-filters.c +++ b/zathura/seccomp-filters.c @@ -106,13 +106,16 @@ seccomp_enable_basic_filter(void) DENY_RULE(uselib); DENY_RULE(vmsplice); - /*TODO + /* * * In case this basic filter is actually triggered, print a clear error message to report this * The syscalls here should never be executed by an unprivileged process * * */ + girara_debug("Using a basic seccomp filter to blacklist privileged system calls! \ + Errors reporting 'bad system call' may be an indicator of compromise"); + /* applying filter... */ if (seccomp_load(ctx) >= 0) { /* free ctx after the filter has been loaded into the kernel */ From 7c455dfd932320910f389bf7342982f9c370b321 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 14:50:48 +0200 Subject: [PATCH 12/29] CI: buster -> bullseye, add bookworm, bionic -> focal, eoan -> jammy --- .gitlab-ci.yml | 71 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 35f409f..1b66767 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,12 +44,12 @@ test:archlinux: except: - tags -# Debian 10 (Buster) -build:debian-buster: +# Debian 11 (bullseye) +build:debian-bullseye: tags: - pwmt stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:buster + image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bullseye script: - meson subprojects update - mkdir -p build && cd build @@ -64,11 +64,11 @@ build:debian-buster: except: - tags -test:debian-buster: +test:debian-bullseye: tags: - pwmt stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:buster + image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bullseye script: - cd build - ninja test @@ -76,16 +76,52 @@ test:debian-buster: <<: *girara_cache policy: pull dependencies: - - build:debian-buster + - build:debian-bullseye except: - tags -# Ubuntu 18.04 LTS (Bionic Beaver) +# Debian 12 (bookworm) +build:debian-bookworm: + tags: + - pwmt + stage: build + image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bookworm + script: + - meson subprojects update + - mkdir -p build && cd build + - meson --force-fallback-for=girara .. + - ninja + cache: + <<: *girara_cache + artifacts: + expire_in: 1 day + paths: + - build + except: + - tags + +test:debian-bookworm: + tags: + - pwmt + stage: test + image: registry.pwmt.org/pwmt/gitlab-runner-images/debian:bookworm + script: + - cd build + - ninja test + cache: + <<: *girara_cache + policy: pull + dependencies: + - build:debian-bookworm + except: + - tags + +# Ubuntu 20.04 LTS (Focal) build:ubuntu-bionic: tags: - pwmt stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:bionic + image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:focal script: - meson subprojects update - mkdir -p build && cd build @@ -100,11 +136,11 @@ build:ubuntu-bionic: except: - tags -test:ubuntu-bionic: +test:ubuntu-focal: tags: - pwmt stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:bionic + image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:focal script: - cd build - ninja test @@ -112,16 +148,16 @@ test:ubuntu-bionic: <<: *girara_cache policy: pull dependencies: - - build:ubuntu-bionic + - build:ubuntu-focal except: - tags -# Ubuntu 19.10 (Eoan Ermine) -build:ubuntu-eoan: +# Ubuntu 22.04 LTS (jammy) +build:ubuntu-bionic: tags: - pwmt stage: build - image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:eoan + image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:jammy script: - meson subprojects update - mkdir -p build && cd build @@ -136,11 +172,11 @@ build:ubuntu-eoan: except: - tags -test:ubuntu-eoan: +test:ubuntu-jammy: tags: - pwmt stage: test - image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:eoan + image: registry.pwmt.org/pwmt/gitlab-runner-images/ubuntu:jammy script: - cd build - ninja test @@ -148,6 +184,7 @@ test:ubuntu-eoan: <<: *girara_cache policy: pull dependencies: - - build:ubuntu-eoan + - build:ubuntu-jammy except: - tags + From f0831f54260595a9d10eeb8d83c1e33d003a71e4 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 14:51:43 +0200 Subject: [PATCH 13/29] CI: fix target name --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b66767..017da0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,7 +117,7 @@ test:debian-bookworm: - tags # Ubuntu 20.04 LTS (Focal) -build:ubuntu-bionic: +build:ubuntu-focal: tags: - pwmt stage: build From 53503f610dae066dd5c371c2e75f903d43ac76e0 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 14:52:16 +0200 Subject: [PATCH 14/29] CI: fix target name --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 017da0f..663678a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,7 +153,7 @@ test:ubuntu-focal: - tags # Ubuntu 22.04 LTS (jammy) -build:ubuntu-bionic: +build:ubuntu-jammy: tags: - pwmt stage: build From 2af36e27fccaf0d7b383c49b5ca9aec4423af7e5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 15:23:35 +0200 Subject: [PATCH 15/29] GH: add funding links --- .github/FUNDING.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b582226 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: [sebastinas] +custom: ["https://pwmt.org/help/donate/"] \ No newline at end of file From 57f0d79e25e323e06591f1ae55155082b59efb4f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 15:43:16 +0200 Subject: [PATCH 16/29] Make magic a required dependency --- README.md | 2 +- meson.build | 9 +--- meson_options.txt | 5 -- zathura/content-type.c | 117 +++++++---------------------------------- 4 files changed, 22 insertions(+), 111 deletions(-) diff --git a/README.md b/README.md index d8ff807..f7323c5 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ The following dependencies are required: * `gtk3` (>= 3.22) * `glib` (>= 2.50) * `girara` (>= 0.3.7) +* `libmagic` from file(1): for mime-type detection The following dependencies are optional: * `sqlite3` (>= 3.6.23): splite3 database backend -* `libmagic` from file(1): for mime-type detection * `libsynctex` from TeXLive (>= 1.19): SyncTeX support * `libseccomp`: sandbox support diff --git a/meson.build b/meson.build index 2475bea..f4cbc99 100644 --- a/meson.build +++ b/meson.build @@ -44,8 +44,9 @@ gthread = dependency('gthread-2.0', version: '>=2.50') gmodule = dependency('gmodule-no-export-2.0', version: '>=2.50') gtk3 = dependency('gtk+-3.0', version: '>=3.22') cairo = dependency('cairo') +magic = cc.find_library('magic', required: true) -build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo] +build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo, magic] if host_machine.system() == 'darwin' gtk_mac_integration = dependency('gtk-mac-integration-gtk3') @@ -77,7 +78,6 @@ flags = cc.get_supported_arguments(flags) additional_sources = [] sqlite = dependency('sqlite3', version: '>=3.6.23', required: get_option('sqlite')) synctex = dependency('synctex', version: '>=1.19', required: get_option('synctex')) -magic = cc.find_library('magic', required: get_option('magic')) seccomp = dependency('libseccomp', required: get_option('seccomp')) if sqlite.found() @@ -94,11 +94,6 @@ if synctex.found() endif endif -if magic.found() - build_dependencies += magic - defines += '-DWITH_MAGIC' -endif - if seccomp.found() build_dependencies += seccomp defines += '-DWITH_SECCOMP' diff --git a/meson_options.txt b/meson_options.txt index 0c5bcc9..db53870 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,11 +8,6 @@ option('synctex', value: 'auto', description: 'SyncTeX integration' ) -option('magic', - type: 'feature', - value: 'auto', - description: 'magic-based MIME type detection' -) option('seccomp', type: 'feature', value: 'auto', diff --git a/zathura/content-type.c b/zathura/content-type.c index 9b82983..04bf962 100644 --- a/zathura/content-type.c +++ b/zathura/content-type.c @@ -3,45 +3,27 @@ #include "content-type.h" #include "macros.h" -#include -#ifdef WITH_MAGIC -#include -#else -#include -#include -#endif -#include -#include #include +#include +#include +#include +#include -struct zathura_content_type_context_s -{ -#ifdef WITH_MAGIC +struct zathura_content_type_context_s { magic_t magic; -#else - void* magic; -#endif }; zathura_content_type_context_t* zathura_content_type_new(void) { - zathura_content_type_context_t* context = - g_try_malloc0(sizeof(zathura_content_type_context_t)); + zathura_content_type_context_t* context = g_try_malloc0(sizeof(zathura_content_type_context_t)); if (context == NULL) { return NULL; } -#ifdef WITH_MAGIC /* creat magic cookie */ - static const int flags = - MAGIC_ERROR | - MAGIC_MIME_TYPE | - MAGIC_SYMLINK | - MAGIC_NO_CHECK_APPTYPE | - MAGIC_NO_CHECK_CDF | - MAGIC_NO_CHECK_ELF | - MAGIC_NO_CHECK_ENCODING; + static const int flags = MAGIC_ERROR | MAGIC_MIME_TYPE | MAGIC_SYMLINK | MAGIC_NO_CHECK_APPTYPE | MAGIC_NO_CHECK_CDF | + MAGIC_NO_CHECK_ELF | MAGIC_NO_CHECK_ENCODING; magic_t magic = magic_open(flags); if (magic == NULL) { girara_debug("failed creating the magic cookie"); @@ -56,32 +38,22 @@ zathura_content_type_new(void) } context->magic = magic; -#endif - return context; } void zathura_content_type_free(zathura_content_type_context_t* context) { - if (context == NULL) { - return; - } - -#ifdef WITH_MAGIC - if (context->magic != NULL) { + if (context != NULL && context->magic != NULL) { magic_close(context->magic); } -#endif g_free(context); } - /** Read a most GT_MAX_READ bytes before falling back to file. */ static const size_t GT_MAX_READ = 1 << 16; -#ifdef WITH_MAGIC static char* guess_type_magic(zathura_content_type_context_t* context, const char* path) { @@ -114,62 +86,12 @@ guess_type_file(const char* UNUSED(path)) { return NULL; } -#else -static char* -guess_type_magic(zathura_content_type_context_t* UNUSED(context), - const char* UNUSED(path)) -{ - return NULL; -} - -static char* -guess_type_file(const char* path) -{ - /* g_spawn_async expects char** */ - static char cmd_file[] = "file"; - static char opt_b[] = "-b"; - static char opt_mime_type[] = "--mime-type"; - char* argv[] = { cmd_file, opt_b, opt_mime_type, g_strdup(path), NULL }; - - GError* error = NULL; - char* out = NULL; - int ret = 0; - const bool r = g_spawn_sync(NULL, argv, NULL, - G_SPAWN_SEARCH_PATH | G_SPAWN_STDERR_TO_DEV_NULL, - NULL, NULL, &out, NULL, &ret, &error); - g_free(argv[3]); - if (r == false) { - girara_warning("failed to execute command: %s", error->message); - g_error_free(error); - g_free(out); - return NULL; - } - if (g_spawn_check_exit_status(ret, &error) == false) { - girara_warning("file failed: %s", error->message); - g_error_free(error); - g_free(out); - return NULL; - } - - g_strdelimit(out, "\n\r", '\0'); - girara_debug("file detected filetype: %s", out); - - char* content_type = g_content_type_from_mime_type(out); - if (content_type == NULL) { - girara_warning("failed to convert mime type to content type: %s", out); - return out; - } - - g_free(out); - return content_type; -} -#endif static char* guess_type_glib(const char* path) { - gboolean uncertain = FALSE; - char* content_type = g_content_type_guess(path, NULL, 0, &uncertain); + gboolean uncertain = FALSE; + char* content_type = g_content_type_guess(path, NULL, 0, &uncertain); if (content_type == NULL) { girara_debug("g_content_type failed\n"); } else { @@ -186,7 +108,7 @@ guess_type_glib(const char* path) } guchar* content = NULL; - size_t length = 0; + size_t length = 0; while (uncertain == TRUE && length < GT_MAX_READ) { g_free(content_type); content_type = NULL; @@ -217,21 +139,21 @@ guess_type_glib(const char* path) return NULL; } -static int compare_content_types(const void* lhs, const void* rhs) { +static int +compare_content_types(const void* lhs, const void* rhs) +{ return g_strcmp0(lhs, rhs); } char* -zathura_content_type_guess(zathura_content_type_context_t* context, - const char* path, +zathura_content_type_guess(zathura_content_type_context_t* context, const char* path, const girara_list_t* supported_content_types) { /* try libmagic first */ - char *content_type = guess_type_magic(context, path); + char* content_type = guess_type_magic(context, path); if (content_type != NULL) { if (supported_content_types == NULL || - girara_list_find(supported_content_types, compare_content_types, - content_type) != NULL) { + girara_list_find(supported_content_types, compare_content_types, content_type) != NULL) { return content_type; } girara_debug("content type '%s' not supported, trying again", content_type); @@ -241,8 +163,7 @@ zathura_content_type_guess(zathura_content_type_context_t* context, content_type = guess_type_glib(path); if (content_type != NULL) { if (supported_content_types == NULL || - girara_list_find(supported_content_types, compare_content_types, - content_type) != NULL) { + girara_list_find(supported_content_types, compare_content_types, content_type) != NULL) { return content_type; } girara_debug("content type '%s' not supported, trying again", content_type); From fbfbefe18bffeace1d1edc7974bb4a71eac33459 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 16:43:07 +0200 Subject: [PATCH 17/29] Remove unused code --- zathura/content-type.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/zathura/content-type.c b/zathura/content-type.c index 04bf962..68f087f 100644 --- a/zathura/content-type.c +++ b/zathura/content-type.c @@ -81,12 +81,6 @@ guess_type_magic(zathura_content_type_context_t* context, const char* path) return content_type; } -static char* -guess_type_file(const char* UNUSED(path)) -{ - return NULL; -} - static char* guess_type_glib(const char* path) { @@ -166,9 +160,8 @@ zathura_content_type_guess(zathura_content_type_context_t* context, const char* girara_list_find(supported_content_types, compare_content_types, content_type) != NULL) { return content_type; } - girara_debug("content type '%s' not supported, trying again", content_type); + girara_debug("content type '%s' not supported", content_type); g_free(content_type); } - /* and if libmagic is not available, try file as last resort */ - return guess_type_file(path); + return NULL; } From 395ecfab682198b95d9130571ebbd6c0f58ce83f Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 8 May 2022 16:44:37 +0200 Subject: [PATCH 18/29] Print better error message if no plugins are available (fixes #284) --- zathura/plugin.c | 5 +++-- zathura/plugin.h | 3 ++- zathura/zathura.c | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/zathura/plugin.c b/zathura/plugin.c index 0ccbac5..2c758d2 100644 --- a/zathura/plugin.c +++ b/zathura/plugin.c @@ -195,15 +195,16 @@ load_dir(void* data, void* userdata) } } -void +bool zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager) { if (plugin_manager == NULL || plugin_manager->path == NULL) { - return; + return false; } /* read all files in the plugin directory */ girara_list_foreach(plugin_manager->path, load_dir, plugin_manager); + return girara_list_size(plugin_manager->plugins) > 0; } zathura_plugin_t* diff --git a/zathura/plugin.h b/zathura/plugin.h index d7b0b70..85a5816 100644 --- a/zathura/plugin.h +++ b/zathura/plugin.h @@ -37,8 +37,9 @@ void zathura_plugin_manager_add_dir(zathura_plugin_manager_t* plugin_manager, co * Loads all plugins available in the previously given directories * * @param plugin_manager The plugin manager + * @return Success if some plugins have been loaded, false otherwise */ -void zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager); +bool zathura_plugin_manager_load(zathura_plugin_manager_t* plugin_manager); /** * Returns the (if available) associated plugin diff --git a/zathura/zathura.c b/zathura/zathura.c index b2ccc4b..e1ed652 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -430,7 +430,9 @@ zathura_init(zathura_t* zathura) g_set_prgname("org.pwmt.zathura"); /* load plugins */ - zathura_plugin_manager_load(zathura->plugins.manager); + if (zathura_plugin_manager_load(zathura->plugins.manager) == false) { + girara_error("Found no plugins. Please install at least one plugin."); + } /* configuration */ config_load_default(zathura); From 7b78b66c33fd5d346a70e2810d83bc09f80d12c8 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 11 May 2022 08:39:53 +0200 Subject: [PATCH 19/29] Revert "GH: add funding links" This reverts commit 2af36e27fccaf0d7b383c49b5ca9aec4423af7e5. --- .github/FUNDING.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index b582226..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: [sebastinas] -custom: ["https://pwmt.org/help/donate/"] \ No newline at end of file From 2ef85e73295d47c6bd9ce6032ab720d4de2c6e7e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 11 May 2022 17:17:20 +0200 Subject: [PATCH 20/29] Also delay the execution of synctex_view (fixes #288) Send the dbus response first, and then start parsing and rendering of the synctex forward search. --- zathura/dbus-interface.c | 43 +++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/zathura/dbus-interface.c b/zathura/dbus-interface.c index 0c718b0..79a3457 100644 --- a/zathura/dbus-interface.c +++ b/zathura/dbus-interface.c @@ -398,19 +398,48 @@ handle_highlight_rects(zathura_t* zathura, GVariant* parameters, g_dbus_method_invocation_return_value(invocation, result); } +typedef struct { + zathura_t* zathura; + gchar* input_file; + unsigned int line; + unsigned int column; +} view_data_t; + +static gboolean +synctex_view_impl(gpointer ptr) +{ + view_data_t* data = ptr; + + synctex_view(data->zathura, data->input_file, data->line, data->column); + + g_free(data->input_file); + g_free(data); + return false; +} + static void -handle_synctex_view(zathura_t* zathura, GVariant* parameters, - GDBusMethodInvocation* invocation) +synctex_view_idle(zathura_t* zathura, gchar* input_file, unsigned int line, unsigned int column) +{ + view_data_t* data = g_try_malloc0(sizeof(view_data_t)); + data->zathura = zathura; + data->input_file = input_file; + data->line = line; + data->column = column; + + gdk_threads_add_idle(synctex_view_impl, data); +} + +static void +handle_synctex_view(zathura_t* zathura, GVariant* parameters, GDBusMethodInvocation* invocation) { gchar* input_file = NULL; - guint line = 0; - guint column = 0; + guint line = 0; + guint column = 0; g_variant_get(parameters, "(suu)", &input_file, &line, &column); - const bool ret = synctex_view(zathura, input_file, line, column); - g_free(input_file); + synctex_view_idle(zathura, input_file, line, column); - GVariant* result = g_variant_new("(b)", ret); + GVariant* result = g_variant_new("(b)", true); g_dbus_method_invocation_return_value(invocation, result); } From c26949ff054699b5221744f8e19901d4032a50a1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 13 May 2022 00:05:27 +0200 Subject: [PATCH 21/29] Fix return value --- zathura/dbus-interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zathura/dbus-interface.c b/zathura/dbus-interface.c index 79a3457..dc32680 100644 --- a/zathura/dbus-interface.c +++ b/zathura/dbus-interface.c @@ -649,11 +649,10 @@ iterate_instances_call_synctex_view(const char* filename, } int -zathura_dbus_synctex_position(const char* filename, const char* input_file, - int line, int column, pid_t hint) +zathura_dbus_synctex_position(const char* filename, const char* input_file, int line, int column, pid_t hint) { if (filename == NULL || input_file == NULL || line < 0 || column < 0) { - return false; + return -1; } return iterate_instances_call_synctex_view(filename, input_file, line, column, hint); From f5300ce2fa690019921c825f4d78b25398cd8604 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 13 May 2022 00:19:11 +0200 Subject: [PATCH 22/29] Avoid a function pointer cast --- zathura/types.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/zathura/types.c b/zathura/types.c index b3937b8..bf594c3 100644 --- a/zathura/types.c +++ b/zathura/types.c @@ -45,13 +45,11 @@ zathura_image_buffer_create(unsigned int width, unsigned int height) g_return_val_if_fail(height != 0, NULL); unsigned int size = 0; - if (checked_umul(width, height, &size) == true || - checked_umul(size, 3, &size) == true) { + if (checked_umul(width, height, &size) == true || checked_umul(size, 3, &size) == true) { return NULL; } zathura_image_buffer_t* image_buffer = malloc(sizeof(zathura_image_buffer_t)); - if (image_buffer == NULL) { return NULL; } @@ -81,25 +79,27 @@ zathura_image_buffer_free(zathura_image_buffer_t* image_buffer) free(image_buffer); } +static void +document_information_entry_free(void* data) +{ + zathura_document_information_entry_t* entry = data; + zathura_document_information_entry_free(entry); +} + girara_list_t* zathura_document_information_entry_list_new(void) { - girara_list_t* list = girara_list_new2((girara_free_function_t) - zathura_document_information_entry_free); - - return list; + return girara_list_new2(document_information_entry_free); } zathura_document_information_entry_t* -zathura_document_information_entry_new(zathura_document_information_type_t type, - const char* value) +zathura_document_information_entry_new(zathura_document_information_type_t type, const char* value) { if (value == NULL) { return NULL; } - zathura_document_information_entry_t* entry = - g_try_malloc0(sizeof(zathura_document_information_entry_t)); + zathura_document_information_entry_t* entry = g_try_malloc0(sizeof(zathura_document_information_entry_t)); if (entry == NULL) { return NULL; } @@ -117,9 +117,6 @@ zathura_document_information_entry_free(zathura_document_information_entry_t* en return; } - if (entry->value != NULL) { - g_free(entry->value); - } - + g_free(entry->value); g_free(entry); } From 36065d3bf3cb13cda2051b1a5aa7ff925e4f3ff9 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 14 May 2022 00:13:03 +0200 Subject: [PATCH 23/29] Do not store unused signal handle --- zathura/file-monitor.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/zathura/file-monitor.c b/zathura/file-monitor.c index e9c37fb..aaf3e25 100644 --- a/zathura/file-monitor.c +++ b/zathura/file-monitor.c @@ -21,13 +21,6 @@ enum { PROP_FILE_PATH }; -enum { - RELOAD_FILE, - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - static void finalize(GObject* object) { @@ -94,9 +87,8 @@ zathura_filemonitor_class_init(ZathuraFileMonitorClass* class) G_PARAM_STATIC_STRINGS)); /* add signals */ - signals[RELOAD_FILE] = - g_signal_new("reload-file", ZATHURA_TYPE_FILEMONITOR, G_SIGNAL_RUN_LAST, 0, - NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 0); + g_signal_new("reload-file", ZATHURA_TYPE_FILEMONITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, + G_TYPE_NONE, 0); } static void From 72f3ce1d628cf272fe82fa8f78d5352fbe0b9ff4 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 14 May 2022 00:20:44 +0200 Subject: [PATCH 24/29] Rename private to priv Avoid to name variables after a C++ keyword. --- zathura/file-monitor.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/zathura/file-monitor.c b/zathura/file-monitor.c index aaf3e25..8dd0006 100644 --- a/zathura/file-monitor.c +++ b/zathura/file-monitor.c @@ -10,7 +10,7 @@ #include -typedef struct private_s { +typedef struct { char* file_path; } ZathuraFileMonitorPrivate; @@ -24,11 +24,11 @@ enum { static void finalize(GObject* object) { - ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object); - ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor); + ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object); + ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor); - if (private->file_path != NULL) { - g_free(private->file_path); + if (priv->file_path != NULL) { + g_free(priv->file_path); } G_OBJECT_CLASS(zathura_filemonitor_parent_class)->finalize(object); @@ -37,15 +37,15 @@ finalize(GObject* object) static void set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { - ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object); - ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor); + ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object); + ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor); switch (prop_id) { case PROP_FILE_PATH: - if (private->file_path != NULL) { - g_free(private->file_path); + if (priv->file_path != NULL) { + g_free(priv->file_path); } - private->file_path = g_value_dup_string(value); + priv->file_path = g_value_dup_string(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -55,12 +55,12 @@ set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* ps static void get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { - ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object); - ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor); + ZathuraFileMonitor* file_monitor = ZATHURA_FILEMONITOR(object); + ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor); switch (prop_id) { case PROP_FILE_PATH: - g_value_set_string(value, private->file_path); + g_value_set_string(value, priv->file_path); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -94,14 +94,14 @@ zathura_filemonitor_class_init(ZathuraFileMonitorClass* class) static void zathura_filemonitor_init(ZathuraFileMonitor* file_monitor) { - ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor); - private->file_path = NULL; + ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor); + priv->file_path = NULL; } const char* zathura_filemonitor_get_filepath(ZathuraFileMonitor* file_monitor) { - ZathuraFileMonitorPrivate* private = zathura_filemonitor_get_instance_private(file_monitor); - return private->file_path; + ZathuraFileMonitorPrivate* priv = zathura_filemonitor_get_instance_private(file_monitor); + return priv->file_path; } void zathura_filemonitor_start(ZathuraFileMonitor* file_monitor) From 832d9e1bed83a69324180a6e45b02586b9bdfcd2 Mon Sep 17 00:00:00 2001 From: toluschr Date: Tue, 24 May 2022 11:09:58 +0200 Subject: [PATCH 25/29] Fix zathura not rendering on hidpi displays Related to https://gitlab.gnome.org/GNOME/gtk/-/issues/3115. Ideally, GNOME could fix their library to return 0 instead of 1. --- zathura/zathura.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index e1ed652..244169f 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -173,10 +173,12 @@ zathura_update_view_ppi(zathura_t* zathura) GdkRectangle monitor_geom; gdk_monitor_get_geometry(monitor, &monitor_geom); - /* calculate ppi, knowing that 1 inch = 25.4 mm */ - if (width_mm == 0) { + /* Due to a bug in Gtk, width is sometimes incorrectly reported to be 1mm + * see https://gitlab.gnome.org/GNOME/gtk/issues/3115 for details */ + if (width_mm <= 1) { girara_debug("cannot calculate PPI: monitor has zero width"); } else { + /* calculate ppi, knowing that 1 inch = 25.4 mm */ ppi = monitor_geom.width * 25.4 / width_mm; } From 41e504a7be9790d5bf1e1375ead5589103e4ba9c Mon Sep 17 00:00:00 2001 From: Pekka Ristola Date: Sat, 20 Aug 2022 14:38:37 +0300 Subject: [PATCH 26/29] Fix use of uninitialized value Contents of string `content` are unitialized before copying of `dummy_content`. Using `g_strlcat` appends `dummy_content` to the uninitialized junk, and by changing that to `strcpy` the uninitialized values aren't used. Relevant Valgrind error when running zathura with no arguments: ``` ==15845== Conditional jump or move depends on uninitialised value(s) ==15845== at 0x566EB2D: UnknownInlinedFun (gstrfuncs.c:1534) ==15845== by 0x566EB2D: g_strlcat (gstrfuncs.c:1521) ==15845== by 0x12B16D: zathura_db_read_key_file_from_file (database-plain.c:171) ==15845== by 0x12D39D: UnknownInlinedFun (database-plain.c:295) ==15845== by 0x12D39D: plain_set_property (database-plain.c:371) ==15845== by 0x55C17AD: object_set_property (gobject.c:1607) ==15845== by 0x55C1C1C: g_object_new_internal (gobject.c:2047) ==15845== by 0x55C3307: g_object_new_valist (gobject.c:2355) ==15845== by 0x55C383D: g_object_new (gobject.c:1824) ==15845== by 0x117944: UnknownInlinedFun (database-plain.c:226) ==15845== by 0x117944: init_database (zathura.c:373) ==15845== by 0x11B8EA: zathura_init (zathura.c:473) ==15845== by 0x114B99: UnknownInlinedFun (main.c:111) ==15845== by 0x114B99: main (main.c:282) ``` --- zathura/database-plain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zathura/database-plain.c b/zathura/database-plain.c index 7af68c1..e5ae751 100644 --- a/zathura/database-plain.c +++ b/zathura/database-plain.c @@ -168,7 +168,7 @@ zathura_db_read_key_file_from_file(const char* path) g_key_file_free(key_file); return NULL; } - g_strlcat(content, dummy_content, dummy_len + 1); + strcpy(content, dummy_content); contentlen = dummy_len; } From 806fa70a7cb0d810c9c0937c38fb9ed3f4e0f4bd Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 23 Aug 2022 00:07:51 +0200 Subject: [PATCH 27/29] Replace deprecated get_pkgconfig_variable with get_variable --- data/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/meson.build b/data/meson.build index 464ff3a..51a1bc3 100644 --- a/data/meson.build +++ b/data/meson.build @@ -72,14 +72,14 @@ fish_completion = configure_file( bash_comp = dependency('bash-completion', required: false) if bash_comp.found() - bash_compdir = bash_comp.get_pkgconfig_variable('completionsdir') + bash_compdir = bash_comp.get_variable(pkgconfig: 'completionsdir') else bash_compdir = join_paths(datadir, 'bash-completion', 'completions') endif fish_comp = dependency('fish', required: false) if fish_comp.found() - fish_compdir = fish_comp.get_pkgconfig_variable('completionsdir') + fish_compdir = fish_comp.get_variable(pkgconfig: 'completionsdir') else fish_compdir = join_paths(datadir, 'fish', 'vendor_completions.d') endif From 5a5316ca6167601edbf35b0f419bcfddfe8fd153 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 2 Sep 2022 13:21:11 +0200 Subject: [PATCH 28/29] Set database version on initialization --- zathura/database-sqlite.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zathura/database-sqlite.c b/zathura/database-sqlite.c index 411ffec..0be14f8 100644 --- a/zathura/database-sqlite.c +++ b/zathura/database-sqlite.c @@ -265,8 +265,11 @@ sqlite_db_check_layout(sqlite3* session, const int database_version, const bool return; } } - if (new_db == true) + if (new_db == true) { + /* set version if initializing a new database */ + sqlite3_exec(session, "PRAGMA user_version = " G_STRINGIFY(DATABASE_VERSION) ";", NULL, 0, NULL); return; + } #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS if (sqlite3_compileoption_used("SQLITE_OMIT_ALTERTABLE") == 1) { From 0e82d492e877811a0f349b523507269aab592b3b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 8 Sep 2022 23:56:54 +0200 Subject: [PATCH 29/29] Version 0.5.0 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f4cbc99..2075f6d 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('zathura', 'c', - version: '0.4.9', + version: '0.5.0', meson_version: '>=0.56', default_options: ['c_std=c11', 'warning_level=3'], )