branch: elpa/systemd
commit 5cb70eb68420c6bda58a6c356aaeaf2942b31d0a
Author: Mark Oteiza <[email protected]>
Commit: Mark Oteiza <[email protected]>
change dropin filename restrictions
* do not match in .d/ subdirectories
* there are no restrictions on dropin config file base names
---
systemd.el | 3 +--
tests/systemd-tests.el | 7 ++++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/systemd.el b/systemd.el
index 42c9c9e..aa67670 100644
--- a/systemd.el
+++ b/systemd.el
@@ -220,8 +220,7 @@
;;;###autoload
(defconst systemd-dropin-autoload-regexp
(eval-when-compile
- (rx "/systemd/" (+? anything) ".d/"
- (+? (any "a-zA-Z0-9-_.@\\")) ".conf" string-end))
+ (rx "/systemd/" (+? anything) ".d/" (+? (not (any ?/))) ".conf"
string-end))
"Regexp for dropin config file buffers in which to autoload `systemd-mode'.")
(defun systemd-get-value (start)
diff --git a/tests/systemd-tests.el b/tests/systemd-tests.el
index 65089ab..8207eba 100644
--- a/tests/systemd-tests.el
+++ b/tests/systemd-tests.el
@@ -73,7 +73,12 @@ only if in an appropriately named parent directory."
(should (string-match-p re "/systemd/dog.socket.d/woof.conf"))
(should-not (string-match-p re "foobar.conf"))
(should-not (string-match-p re "/etc/modprobe.d/bonding.conf"))
- (should-not (string-match-p re "/etc/systemd/system.conf"))))
+ (should-not (string-match-p re "/etc/systemd/system.conf"))
+ ;; No restrictions on the base name
+ (should (string-match-p re ".config/systemd/user/foo.timer.d/კულტის.conf"))
+ (should (string-match-p re "/etc/systemd/user/c.service.d/a\nb.conf"))
+ ;; Do not match inside a subdirectory of foobar.d/
+ (should-not (string-match-p re
".config/systemd/user/foo.timer.d/a/b.conf"))))
(provide 'systemd-tests)