aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-07-21 12:29:06 +0200
committerMichael Albinus2018-07-21 12:29:06 +0200
commite0f33ea394c636ab1aa2412b4f35b7dfc1ca768a (patch)
tree1a97f9cac5cb99889bb38256fdf2753d5c76afd4
parent7308fa0e2b8d929a4e0f7f54ac46228f93674672 (diff)
downloademacs-e0f33ea394c636ab1aa2412b4f35b7dfc1ca768a.tar.gz
emacs-e0f33ea394c636ab1aa2412b4f35b7dfc1ca768a.zip
Fix Bug#32226
* lisp/shadowfile.el (shadow-site-name, shadow-name-site): Use "[-.[:word:]]+" as hostname regexp. (Bug#32226) * test/lisp/shadowfile-tests.el (shadow-test06-literal-groups) (shadow-test07-regexp-groups, shadow-test08-shadow-todo) (shadow-test09-shadow-copy-files): Skip if needed.
-rw-r--r--lisp/shadowfile.el4
-rw-r--r--test/lisp/shadowfile-tests.el8
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index e1a9b8e1d98..27d934d9fce 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -231,12 +231,12 @@ information defining the cluster. For interactive use, call
231 231
232(defun shadow-site-name (site) 232(defun shadow-site-name (site)
233 "Return name if SITE has the form \"/name:\", otherwise SITE." 233 "Return name if SITE has the form \"/name:\", otherwise SITE."
234 (if (string-match "\\`/\\(\\w+\\):\\'" site) 234 (if (string-match "\\`/\\([-.[:word:]]+\\):\\'" site)
235 (match-string 1 site) site)) 235 (match-string 1 site) site))
236 236
237(defun shadow-name-site (name) 237(defun shadow-name-site (name)
238 "Return \"/name:\" if NAME has word syntax, otherwise NAME." 238 "Return \"/name:\" if NAME has word syntax, otherwise NAME."
239 (if (string-match "\\`\\w+\\'" name) 239 (if (string-match "\\`[-.[:word:]]+\\'" name)
240 (format "/%s:"name) name)) 240 (format "/%s:"name) name))
241 241
242(defun shadow-site-primary (site) 242(defun shadow-site-primary (site)
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 5ded94480ec..200fb4c58c6 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -556,6 +556,8 @@ guaranteed by the originator of a cluster definition."
556 556
557(ert-deftest shadow-test06-literal-groups () 557(ert-deftest shadow-test06-literal-groups ()
558 "Check literal group definitions." 558 "Check literal group definitions."
559 (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
560
559 (let ((shadow-info-file shadow-test-info-file) 561 (let ((shadow-info-file shadow-test-info-file)
560 (shadow-todo-file shadow-test-todo-file) 562 (shadow-todo-file shadow-test-todo-file)
561 shadow-clusters shadow-literal-groups 563 shadow-clusters shadow-literal-groups
@@ -618,6 +620,8 @@ guaranteed by the originator of a cluster definition."
618 620
619(ert-deftest shadow-test07-regexp-groups () 621(ert-deftest shadow-test07-regexp-groups ()
620 "Check regexp group definitions." 622 "Check regexp group definitions."
623 (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
624
621 (let ((shadow-info-file shadow-test-info-file) 625 (let ((shadow-info-file shadow-test-info-file)
622 (shadow-todo-file shadow-test-todo-file) 626 (shadow-todo-file shadow-test-todo-file)
623 shadow-clusters shadow-regexp-groups 627 shadow-clusters shadow-regexp-groups
@@ -682,6 +686,8 @@ guaranteed by the originator of a cluster definition."
682 686
683(ert-deftest shadow-test08-shadow-todo () 687(ert-deftest shadow-test08-shadow-todo ()
684 "Check that needed shadows are added to todo." 688 "Check that needed shadows are added to todo."
689 (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
690
685 (let ((backup-inhibited t) 691 (let ((backup-inhibited t)
686 (shadow-info-file shadow-test-info-file) 692 (shadow-info-file shadow-test-info-file)
687 (shadow-todo-file shadow-test-todo-file) 693 (shadow-todo-file shadow-test-todo-file)
@@ -780,6 +786,8 @@ guaranteed by the originator of a cluster definition."
780 786
781(ert-deftest shadow-test09-shadow-copy-files () 787(ert-deftest shadow-test09-shadow-copy-files ()
782 "Check that needed shadow files are copied." 788 "Check that needed shadow files are copied."
789 (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory))
790
783 (let ((backup-inhibited t) 791 (let ((backup-inhibited t)
784 (shadow-info-file shadow-test-info-file) 792 (shadow-info-file shadow-test-info-file)
785 (shadow-todo-file shadow-test-todo-file) 793 (shadow-todo-file shadow-test-todo-file)