[bug#78090,v3] gnu: sshguard: Fix sshguard.
Commit Message
Patch sshguard to accept configuration file from an environment variable.
* gnu/packages/admin.scm (sshguard)[arguments]: Add phases.
Change-Id: Ifd1cee18787b2623e5c32801e20e5837ce94c88c
---
Hi Artyom,
Thanks for updating it to 2.5.1.
Running it atm yields:
=============================================================================
% /gnu/store/xna4knzy4a4qw0hfna292p89ybvzbrxy-sshguard-2.5.1/sbin/sshguard
sshguard: Could not read '/gnu/store/xna4knzy4a4qw0hfna292p89ybvzbrxy-sshguard-2.5.1/etc/sshguard.conf'
sshguard: Please configure SSHGuard.
=============================================================================
AFAICT, it's fairly useless as the check can not be bypassed. If you're running it in a different way, please share.
I've a patch that I'm using it while waiting for this patch to be committed. I've rebased it on top of your commit.
Thanks!
Ashish
gnu/packages/admin.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
base-commit: 5bf15734c869ecb9103832cae56198eb8a9adf89
@@ -72,7 +72,7 @@
;;; Copyright © 2024 nathan <nathan_mail@nborghese.com>
;;; Copyright © 2024 Nikita Domnitskii <nikita@domnitskii.me>
;;; Copyright © 2024 Roman Scherer <roman@burningswell.com>
-;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024, 2025 Ashish SHUKLA <ashish.is@lostca.se>
;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;; Copyright © 2025 Dariqq <dariqq@posteo.net>
;;; Copyright © 2024 nik gaffney <nik@fo.am>
@@ -6781,6 +6781,16 @@ (define-public sshguard
(build-system gnu-build-system)
(native-inputs
(list autoconf automake bison flex python-docutils))
+ (arguments
+ (list #:phases
+ #~(modify-phases %standard-phases
+ ;; patch sshguard to find configuration through
+ ;; environment variable
+ (add-after 'unpack 'patch-sshguard
+ (lambda _
+ (substitute* "src/sshguard.in"
+ (("^config=.*$")
+ "config=${SSHGUARD_CONFIG_FILE:-@sysconfdir@/sshguard.conf}\n")))))))
(home-page "https://sshguard.net/")
(synopsis "Daemon to blocks SSH brute-force attacks")
(description