diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-04-12 10:30:23 +0900 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-04-14 10:34:51 +0900 |
commit | 57768a7566e86cad5766cf45bc82dc0151742405 (patch) | |
tree | 138e2a264e270ee420a50e592e4d4422babe5d2f | |
parent | 2c80648f8a2a74d5fe808be63094cd019cf49d53 (diff) | |
download | guix-57768a7566e86cad5766cf45bc82dc0151742405.tar.gz guix-57768a7566e86cad5766cf45bc82dc0151742405.zip |
gnu: pounce: Add patch improving diagnostics.
* gnu/packages/patches/pounce-readable-checks.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/messaging.scm (pounce): Use it.
Change-Id: Ibfe10d4a6c99f86a0c925ad1bed2bcc14fb4c95c
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/messaging.scm | 3 | ||||
-rw-r--r-- | gnu/packages/patches/pounce-readable-checks.patch | 48 |
3 files changed, 51 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 2f3c200ff4..639dffaefc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1998,6 +1998,7 @@ dist_patch_DATA = \ %D%/packages/patches/plasp-include-iostream.patch \ %D%/packages/patches/pocketfft-cpp-prefer-preprocessor-if.patch \ %D%/packages/patches/pokerth-boost.patch \ + %D%/packages/patches/pounce-readable-checks.patch \ %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ %D%/packages/patches/procps-strtod-test.patch \ %D%/packages/patches/prusa-slicer-fix-tests.patch \ diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index d48b6e96e7..5d3ff289ca 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -3461,7 +3461,8 @@ notifications.") (uri (string-append "https://git.causal.agency/pounce/snapshot/pounce-" version ".tar.gz")) (sha256 - (base32 "0kk0jrfiwfaybr0i5xih3b0yd4i6v3bz866a7xal1j8wddalbwlp")))) + (base32 "0kk0jrfiwfaybr0i5xih3b0yd4i6v3bz866a7xal1j8wddalbwlp")) + (patches (search-patches "pounce-readable-checks.patch")))) (outputs '("out" "debug")) (build-system gnu-build-system) (arguments diff --git a/gnu/packages/patches/pounce-readable-checks.patch b/gnu/packages/patches/pounce-readable-checks.patch new file mode 100644 index 0000000000..3b47b00120 --- /dev/null +++ b/gnu/packages/patches/pounce-readable-checks.patch @@ -0,0 +1,48 @@ +Print a warning when a configuration file cannot not be opened due to read +access. + +Upstream-status: Forwarded to the author of Pounce via email. + +diff --git a/local.c b/local.c +index fcd670a..d4603c4 100644 +--- a/local.c ++++ b/local.c +@@ -43,6 +43,15 @@ + + static struct tls *server; + ++void checkReadable(const char* file) { ++ FILE* f = fopen(file, "r"); ++ if (f == NULL) { ++ if (errno == EACCES) warnx("failed to read file '%s'", file); ++ } else { ++ fclose(f); ++ } ++} ++ + int localConfig( + const char *cert, const char *priv, const char *ca, bool require + ) { +@@ -55,12 +64,14 @@ int localConfig( + int error; + char buf[PATH_MAX]; + for (int i = 0; configPath(buf, sizeof(buf), cert, i); ++i) { ++ checkReadable(buf); + error = tls_config_set_cert_file(config, buf); + if (!error) break; + } + if (error) goto fail; + + for (int i = 0; configPath(buf, sizeof(buf), priv, i); ++i) { ++ checkReadable(buf); + error = tls_config_set_key_file(config, buf); + if (!error) break; + } +@@ -68,6 +79,7 @@ int localConfig( + + if (ca) { + for (int i = 0; configPath(buf, sizeof(buf), ca, i); ++i) { ++ checkReadable(buf); + error = tls_config_set_ca_file(config, buf); + if (!error) break; + } |