diff options
| author | Dariqq <dariqq@posteo.net> | 2026-05-17 19:23:21 +0000 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-08-09 14:44:26 +0200 |
| commit | fed5ef4baf2ef34751333f575c05964f572a2a55 (patch) | |
| tree | 27c097c4ef6a76677c0f7eb0a295bf617ea4b126 /gnu/services | |
| parent | 5a0f38ebcc468408e9a9c6a704ed8686d7ecb9da (diff) | |
services: opensmtpd: Add setuid lockspool to privileged programs.
* gnu/services/mail.scm (opensmtpd-set-gids): Rename to...
(opensmtpd-privileged-programs): ...this and add setuid root lockspool.
(opensmtpd-service-type): Use new variable name.
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/mail.scm | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 70825dd1a9d..d31cad5645d 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm | |||
| @@ -1785,24 +1785,29 @@ match from local for any action outbound | |||
| 1785 | (define %opensmtpd-pam-services | 1785 | (define %opensmtpd-pam-services |
| 1786 | (list (unix-pam-service "smtpd"))) | 1786 | (list (unix-pam-service "smtpd"))) |
| 1787 | 1787 | ||
| 1788 | (define (opensmtpd-set-gids config) | 1788 | (define (opensmtpd-privileged-programs config) |
| 1789 | (match-record config <opensmtpd-configuration> (package config-file setgid-commands?) | 1789 | (match-record config <opensmtpd-configuration> (package config-file setgid-commands?) |
| 1790 | (if setgid-commands? | 1790 | (append |
| 1791 | (map (lambda (command) | 1791 | (list |
| 1792 | (privileged-program | 1792 | (privileged-program |
| 1793 | (program (file-append package "/" command)) | 1793 | (program (file-append package "/libexec/opensmtpd/lockspool")) |
| 1794 | (setgid? #t) | 1794 | (setuid? #t))) |
| 1795 | (group "smtpq"))) | 1795 | (if setgid-commands? |
| 1796 | (list "sbin/smtpctl" | 1796 | (map (lambda (command) |
| 1797 | 1797 | (privileged-program | |
| 1798 | ;; Also privilege the compatibility symlinks created by | 1798 | (program (file-append package "/" command)) |
| 1799 | ;; the Guix opensmtpd package; all synonyms for smtpctl. | 1799 | (setgid? #t) |
| 1800 | "sbin/mailq" | 1800 | (group "smtpq"))) |
| 1801 | "sbin/makemap" | 1801 | (list "sbin/smtpctl" |
| 1802 | "sbin/newaliases" | 1802 | |
| 1803 | "sbin/sendmail" | 1803 | ;; Also privilege the compatibility symlinks created by |
| 1804 | "sbin/send-mail")) | 1804 | ;; the Guix opensmtpd package; all synonyms for smtpctl. |
| 1805 | '()))) | 1805 | "sbin/mailq" |
| 1806 | "sbin/makemap" | ||
| 1807 | "sbin/newaliases" | ||
| 1808 | "sbin/sendmail" | ||
| 1809 | "sbin/send-mail")) | ||
| 1810 | '())))) | ||
| 1806 | 1811 | ||
| 1807 | (define opensmtpd-service-type | 1812 | (define opensmtpd-service-type |
| 1808 | (service-type | 1813 | (service-type |
| @@ -1819,7 +1824,7 @@ match from local for any action outbound | |||
| 1819 | (service-extension shepherd-root-service-type | 1824 | (service-extension shepherd-root-service-type |
| 1820 | opensmtpd-shepherd-service) | 1825 | opensmtpd-shepherd-service) |
| 1821 | (service-extension privileged-program-service-type | 1826 | (service-extension privileged-program-service-type |
| 1822 | opensmtpd-set-gids))) | 1827 | opensmtpd-privileged-programs))) |
| 1823 | (description "Run the OpenSMTPD, a lightweight @acronym{SMTP, Simple Mail | 1828 | (description "Run the OpenSMTPD, a lightweight @acronym{SMTP, Simple Mail |
| 1824 | Transfer Protocol} server."))) | 1829 | Transfer Protocol} server."))) |
| 1825 | 1830 | ||
