aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2022-07-18 14:22:33 +0200
committerStefan Kangas2022-07-18 14:23:59 +0200
commitfec4bb89f9d7da9df3a23a031abf6fe532a66dbb (patch)
treeeede269b143e7dc940ebbf5be67c2f05ff2bf59e
parentf5218385c064aa959650bfe49ca32795270851eb (diff)
downloademacs-fec4bb89f9d7da9df3a23a031abf6fe532a66dbb.tar.gz
emacs-fec4bb89f9d7da9df3a23a031abf6fe532a66dbb.zip
; Fix typos (Bug#56550)
-rw-r--r--lisp/net/tramp-crypt.el81
-rw-r--r--lisp/net/tramp.el4
2 files changed, 42 insertions, 43 deletions
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 5028e489328..609f6404649 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -23,49 +23,48 @@
23 23
24;;; Commentary: 24;;; Commentary:
25 25
26;; Access functions for crypted remote files. It uses encfs to 26;; Access functions for encrypted remote files. It uses encfs to
27;; encrypt / decrypt the files on a remote directory. A remote 27;; encrypt / decrypt the files on a remote directory. A remote
28;; directory, which shall include crypted files, must be declared in 28;; directory, which shall include encrypted files, must be declared in
29;; `tramp-crypt-directories' via command `tramp-crypt-add-directory'. 29;; `tramp-crypt-directories' via command `tramp-crypt-add-directory'.
30;; All files in that directory, including all subdirectories, are 30;; All files in that directory, including all subdirectories, are
31;; stored there encrypted. This includes file names and directory 31;; stored there encrypted. This includes file names and directory
32;; names. 32;; names.
33 33
34;; This package is just responsible for the encryption part. Copying 34;; This package is just responsible for the encryption part. Copying
35;; of the crypted files is still the responsibility of the remote file 35;; of the encrypted files is still the responsibility of the remote
36;; name handlers. 36;; file name handlers.
37 37
38;; A password protected encfs configuration file is created the very 38;; A password protected encfs configuration file is created the very
39;; first time you access a crypted remote directory. It is kept in 39;; first time you access a encrypted remote directory. It is kept in
40;; your user directory "~/.emacs.d/" with the url-encoded directory 40;; your user directory "~/.emacs.d/" with the url-encoded directory
41;; name as part of the basename, and ".encfs6.xml" as suffix. Do not 41;; name as part of the basename, and ".encfs6.xml" as suffix. Do not
42;; lose this file and the corresponding password; otherwise there is 42;; lose this file and the corresponding password; otherwise there is
43;; no way to decrypt your crypted files. 43;; no way to decrypt your encrypted files.
44 44
45;; If the user option `tramp-crypt-save-encfs-config-remote' is 45;; If the user option `tramp-crypt-save-encfs-config-remote' is non-nil (the
46;; non-nil (the default), the encfs configuration file ".encfs6.xml" 46;; default), the encfs configuration file ".encfs6.xml" is also kept
47;; is also kept in the crypted remote directory. It depends on you, 47;; in the encrypted remote directory. It depends on you, whether you
48;; whether you regard the password protection of this file as 48;; regard the password protection of this file as sufficient.
49;; sufficient.
50 49
51;; If you use a remote file name with a quoted localname part, this 50;; If you use a remote file name with a quoted localname part, this
52;; localname and the corresponding file will not be encrypted/ 51;; localname and the corresponding file will not be encrypted/
53;; decrypted. For example, if you have a crypted remote directory 52;; decrypted. For example, if you have a encrypted remote directory
54;; "/nextcloud:user@host:/crypted_dir", the command 53;; "/nextcloud:user@host:/encrypted_dir", the command
55;; 54;;
56;; C-x d /nextcloud:user@host:/crypted_dir 55;; C-x d /nextcloud:user@host:/encrypted_dir
57;; 56;;
58;; will show the directory listing with the plain file names, and the 57;; will show the directory listing with the plain file names, and the
59;; command 58;; command
60;; 59;;
61;; C-x d /nextcloud:user@host:/:/crypted_dir 60;; C-x d /nextcloud:user@host:/:/encrypted_dir
62;; 61;;
63;; will show the directory with the encrypted file names, and visiting 62;; will show the directory with the encrypted file names, and visiting
64;; a file will show its crypted contents. However, it is highly 63;; a file will show its encrypted contents. However, it is highly
65;; discouraged to mix crypted and not crypted files in the same 64;; discouraged to mix encrypted and not encrypted files in the same
66;; directory. 65;; directory.
67 66
68;; If a remote directory shall not include crypted files anymore, it 67;; If a remote directory shall not include encrypted files anymore, it
69;; must be indicated by the command `tramp-crypt-remove-directory'. 68;; must be indicated by the command `tramp-crypt-remove-directory'.
70 69
71;;; Code: 70;;; Code:
@@ -78,7 +77,7 @@
78(autoload 'text-property-search-forward "text-property-search") 77(autoload 'text-property-search-forward "text-property-search")
79 78
80(defconst tramp-crypt-method "crypt" 79(defconst tramp-crypt-method "crypt"
81 "Method name for crypted remote directories.") 80 "Method name for encrypted remote directories.")
82 81
83(defcustom tramp-crypt-encfs-program "encfs" 82(defcustom tramp-crypt-encfs-program "encfs"
84 "Name of the encfs program." 83 "Name of the encfs program."
@@ -96,7 +95,7 @@
96 "Configuration option for encfs. 95 "Configuration option for encfs.
97This could be either \"--standard\" or \"--paranoia\". The file 96This could be either \"--standard\" or \"--paranoia\". The file
98name IV chaining mode mode will always be disabled when 97name IV chaining mode mode will always be disabled when
99initializing a new crypted remote directory." 98initializing a new encrypted remote directory."
100 :group 'tramp 99 :group 'tramp
101 :version "28.1" 100 :version "28.1"
102 :type '(choice (const "--standard") 101 :type '(choice (const "--standard")
@@ -120,7 +119,7 @@ initializing a new crypted remote directory."
120They are completed by \"M-x TAB\" only when encryption support is enabled." 119They are completed by \"M-x TAB\" only when encryption support is enabled."
121 (and tramp-crypt-enabled 120 (and tramp-crypt-enabled
122 ;; `tramp-crypt-remove-directory' needs to be completed only in 121 ;; `tramp-crypt-remove-directory' needs to be completed only in
123 ;; case we have already crypted directories. 122 ;; case we have already encrypted directories.
124 (or (not (eq symbol #'tramp-crypt-remove-directory)) 123 (or (not (eq symbol #'tramp-crypt-remove-directory))
125 tramp-crypt-directories))) 124 tramp-crypt-directories)))
126 125
@@ -129,21 +128,21 @@ They are completed by \"M-x TAB\" only when encryption support is enabled."
129 "Encfs configuration file name.") 128 "Encfs configuration file name.")
130 129
131(defcustom tramp-crypt-save-encfs-config-remote t 130(defcustom tramp-crypt-save-encfs-config-remote t
132 "Whether to keep the encfs configuration file in the crypted remote directory." 131 "Whether to keep the encfs configuration file in the encrypted remote directory."
133 :group 'tramp 132 :group 'tramp
134 :version "28.1" 133 :version "28.1"
135 :type 'boolean) 134 :type 'boolean)
136 135
137;;;###tramp-autoload 136;;;###tramp-autoload
138(defvar tramp-crypt-directories nil 137(defvar tramp-crypt-directories nil
139 "List of crypted remote directories.") 138 "List of encrypted remote directories.")
140 139
141;; It must be a `defsubst' in order to push the whole code into 140;; It must be a `defsubst' in order to push the whole code into
142;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. 141;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading.
143;;;###tramp-autoload 142;;;###tramp-autoload
144(defsubst tramp-crypt-file-name-p (name) 143(defsubst tramp-crypt-file-name-p (name)
145 "Return the crypted remote directory NAME belongs to. 144 "Return the encrypted remote directory NAME belongs to.
146If NAME doesn't belong to a crypted remote directory, retun nil." 145If NAME doesn't belong to a encrypted remote directory, retun nil."
147 (catch 'crypt-file-name-p 146 (catch 'crypt-file-name-p
148 (and tramp-crypt-enabled (stringp name) 147 (and tramp-crypt-enabled (stringp name)
149 (not (tramp-compat-file-name-quoted-p name)) 148 (not (tramp-compat-file-name-quoted-p name))
@@ -240,7 +239,7 @@ If NAME doesn't belong to a crypted remote directory, retun nil."
240Operations not mentioned here will be handled by the default Emacs primitives.") 239Operations not mentioned here will be handled by the default Emacs primitives.")
241 240
242(defsubst tramp-crypt-file-name-for-operation (operation &rest args) 241(defsubst tramp-crypt-file-name-for-operation (operation &rest args)
243 "Like `tramp-file-name-for-operation', but for crypted remote files." 242 "Like `tramp-file-name-for-operation', but for encrypted remote files."
244 (let ((tfnfo (apply #'tramp-file-name-for-operation operation args))) 243 (let ((tfnfo (apply #'tramp-file-name-for-operation operation args)))
245 ;; `tramp-file-name-for-operation' returns already the first argument 244 ;; `tramp-file-name-for-operation' returns already the first argument
246 ;; if it is remote. So we check a possible second argument. 245 ;; if it is remote. So we check a possible second argument.
@@ -264,7 +263,7 @@ arguments to pass to the OPERATION."
264 263
265;;;###tramp-autoload 264;;;###tramp-autoload
266(defun tramp-crypt-file-name-handler (operation &rest args) 265(defun tramp-crypt-file-name-handler (operation &rest args)
267 "Invoke the crypted remote file related OPERATION. 266 "Invoke the encrypted remote file related OPERATION.
268First arg specifies the OPERATION, second arg is a list of 267First arg specifies the OPERATION, second arg is a list of
269arguments to pass to the OPERATION." 268arguments to pass to the OPERATION."
270 (if-let ((filename 269 (if-let ((filename
@@ -409,7 +408,7 @@ ARGS are the arguments. It returns t if ran successful, and nil otherwise."
409 t)))) 408 t))))
410 409
411(defun tramp-crypt-do-encrypt-or-decrypt-file-name (op name) 410(defun tramp-crypt-do-encrypt-or-decrypt-file-name (op name)
412 "Return encrypted / decrypted NAME if NAME belongs to a crypted directory. 411 "Return encrypted / decrypted NAME if NAME belongs to an encrypted directory.
413OP must be `encrypt' or `decrypt'. Raise an error if this fails. 412OP must be `encrypt' or `decrypt'. Raise an error if this fails.
414Otherwise, return NAME." 413Otherwise, return NAME."
415 (if-let ((tramp-crypt-enabled t) 414 (if-let ((tramp-crypt-enabled t)
@@ -438,17 +437,17 @@ Otherwise, return NAME."
438 name)) 437 name))
439 438
440(defsubst tramp-crypt-encrypt-file-name (name) 439(defsubst tramp-crypt-encrypt-file-name (name)
441 "Return encrypted NAME if NAME belongs to a crypted directory. 440 "Return encrypted NAME if NAME belongs to an encrypted directory.
442Otherwise, return NAME." 441Otherwise, return NAME."
443 (tramp-crypt-do-encrypt-or-decrypt-file-name 'encrypt name)) 442 (tramp-crypt-do-encrypt-or-decrypt-file-name 'encrypt name))
444 443
445(defsubst tramp-crypt-decrypt-file-name (name) 444(defsubst tramp-crypt-decrypt-file-name (name)
446 "Return decrypted NAME if NAME belongs to a crypted directory. 445 "Return decrypted NAME if NAME belongs to an encrypted directory.
447Otherwise, return NAME." 446Otherwise, return NAME."
448 (tramp-crypt-do-encrypt-or-decrypt-file-name 'decrypt name)) 447 (tramp-crypt-do-encrypt-or-decrypt-file-name 'decrypt name))
449 448
450(defun tramp-crypt-do-encrypt-or-decrypt-file (op root infile outfile) 449(defun tramp-crypt-do-encrypt-or-decrypt-file (op root infile outfile)
451 "Encrypt / decrypt file INFILE to OUTFILE according to crypted directory ROOT. 450 "Encrypt / decrypt file INFILE to OUTFILE according to encrypted directory ROOT.
452Both files must be local files. OP must be `encrypt' or `decrypt'. 451Both files must be local files. OP must be `encrypt' or `decrypt'.
453If OP ist `decrypt', the basename of INFILE must be an encrypted file name. 452If OP ist `decrypt', the basename of INFILE must be an encrypted file name.
454Raise an error if this fails." 453Raise an error if this fails."
@@ -470,12 +469,12 @@ Raise an error if this fails."
470 (write-region nil nil outfile))))) 469 (write-region nil nil outfile)))))
471 470
472(defsubst tramp-crypt-encrypt-file (root infile outfile) 471(defsubst tramp-crypt-encrypt-file (root infile outfile)
473 "Encrypt file INFILE to OUTFILE according to crypted directory ROOT. 472 "Encrypt file INFILE to OUTFILE according to encrypted directory ROOT.
474See `tramp-crypt-do-encrypt-or-decrypt-file'." 473See `tramp-crypt-do-encrypt-or-decrypt-file'."
475 (tramp-crypt-do-encrypt-or-decrypt-file 'encrypt root infile outfile)) 474 (tramp-crypt-do-encrypt-or-decrypt-file 'encrypt root infile outfile))
476 475
477(defsubst tramp-crypt-decrypt-file (root infile outfile) 476(defsubst tramp-crypt-decrypt-file (root infile outfile)
478 "Decrypt file INFILE to OUTFILE according to crypted directory ROOT. 477 "Decrypt file INFILE to OUTFILE according to encrypted directory ROOT.
479See `tramp-crypt-do-encrypt-or-decrypt-file'." 478See `tramp-crypt-do-encrypt-or-decrypt-file'."
480 (tramp-crypt-do-encrypt-or-decrypt-file 'decrypt root infile outfile)) 479 (tramp-crypt-do-encrypt-or-decrypt-file 'decrypt root infile outfile))
481 480
@@ -537,10 +536,10 @@ localname."
537 (make-tramp-file-name 536 (make-tramp-file-name
538 :method tramp-crypt-method :user (user-login-name) 537 :method tramp-crypt-method :user (user-login-name)
539 :host (url-hexify-string dir)) 538 :host (url-hexify-string dir))
540 (tramp-user-error nil "Not a crypted remote directory: \"%s\"" name)))) 539 (tramp-user-error nil "Not an encrypted remote directory: \"%s\"" name))))
541 540
542(defun tramp-crypt-get-remote-dir (vec) 541(defun tramp-crypt-get-remote-dir (vec)
543 "Return the name of the crypted remote directory to be used for encfs." 542 "Return the name of the encrypted remote directory to be used for encfs."
544 (url-unhex-string (tramp-file-name-host vec))) 543 (url-unhex-string (tramp-file-name-host vec)))
545 544
546 545
@@ -606,7 +605,7 @@ absolute file names."
606 (with-tramp-progress-reporter 605 (with-tramp-progress-reporter
607 v 0 (format "%s %s to %s" msg-operation filename newname) 606 v 0 (format "%s %s to %s" msg-operation filename newname)
608 (if (and t1 t2 (string-equal t1 t2)) 607 (if (and t1 t2 (string-equal t1 t2))
609 ;; Both files are on the same crypted remote directory. 608 ;; Both files are on the same encrypted remote directory.
610 (let (tramp-crypt-enabled) 609 (let (tramp-crypt-enabled)
611 (if (eq op 'copy) 610 (if (eq op 'copy)
612 (copy-file 611 (copy-file
@@ -624,7 +623,7 @@ absolute file names."
624 (file-name-nondirectory encrypt-newname) tmpdir)) 623 (file-name-nondirectory encrypt-newname) tmpdir))
625 tramp-crypt-enabled) 624 tramp-crypt-enabled)
626 (cond 625 (cond
627 ;; Source and target file are on a crypted remote directory. 626 ;; Source and target file are on a encrypted remote directory.
628 ((and t1 t2) 627 ((and t1 t2)
629 (if (eq op 'copy) 628 (if (eq op 'copy)
630 (copy-file 629 (copy-file
@@ -632,7 +631,7 @@ absolute file names."
632 keep-date preserve-uid-gid preserve-extended-attributes) 631 keep-date preserve-uid-gid preserve-extended-attributes)
633 (rename-file 632 (rename-file
634 encrypt-filename encrypt-newname ok-if-already-exists))) 633 encrypt-filename encrypt-newname ok-if-already-exists)))
635 ;; Source file is on a crypted remote directory. 634 ;; Source file is on a encrypted remote directory.
636 (t1 635 (t1
637 (if (eq op 'copy) 636 (if (eq op 'copy)
638 (copy-file 637 (copy-file
@@ -641,7 +640,7 @@ absolute file names."
641 (rename-file encrypt-filename tmpfile1 t)) 640 (rename-file encrypt-filename tmpfile1 t))
642 (tramp-crypt-decrypt-file t1 tmpfile1 tmpfile2) 641 (tramp-crypt-decrypt-file t1 tmpfile1 tmpfile2)
643 (rename-file tmpfile2 newname ok-if-already-exists)) 642 (rename-file tmpfile2 newname ok-if-already-exists))
644 ;; Target file is on a crypted remote directory. 643 ;; Target file is on a encrypted remote directory.
645 (t2 644 (t2
646 (if (eq op 'copy) 645 (if (eq op 'copy)
647 (copy-file 646 (copy-file
@@ -677,7 +676,7 @@ absolute file names."
677 (list filename newname ok-if-already-exists keep-date 676 (list filename newname ok-if-already-exists keep-date
678 preserve-uid-gid preserve-extended-attributes)))) 677 preserve-uid-gid preserve-extended-attributes))))
679 678
680;; Crypted files won't be trashed. 679;; Encrypted files won't be trashed.
681(defun tramp-crypt-handle-delete-directory 680(defun tramp-crypt-handle-delete-directory
682 (directory &optional recursive _trash) 681 (directory &optional recursive _trash)
683 "Like `delete-directory' for Tramp files." 682 "Like `delete-directory' for Tramp files."
@@ -686,7 +685,7 @@ absolute file names."
686 (let (tramp-crypt-enabled) 685 (let (tramp-crypt-enabled)
687 (delete-directory (tramp-crypt-encrypt-file-name directory) recursive)))) 686 (delete-directory (tramp-crypt-encrypt-file-name directory) recursive))))
688 687
689;; Crypted files won't be trashed. 688;; Encrypted files won't be trashed.
690(defun tramp-crypt-handle-delete-file (filename &optional _trash) 689(defun tramp-crypt-handle-delete-file (filename &optional _trash)
691 "Like `delete-file' for Tramp files." 690 "Like `delete-file' for Tramp files."
692 (with-parsed-tramp-file-name (expand-file-name filename) nil 691 (with-parsed-tramp-file-name (expand-file-name filename) nil
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b224435b3d6..cd021968d93 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3818,7 +3818,7 @@ Let-bind it when necessary.")
3818 3818
3819 ;; When we shall insert only a part of the file, we 3819 ;; When we shall insert only a part of the file, we
3820 ;; copy this part. This works only for the shell file 3820 ;; copy this part. This works only for the shell file
3821 ;; name handlers. It doesn't work for crypted files. 3821 ;; name handlers. It doesn't work for encrypted files.
3822 (when (and (or beg end) 3822 (when (and (or beg end)
3823 (tramp-sh-file-name-handler-p v) 3823 (tramp-sh-file-name-handler-p v)
3824 (null tramp-crypt-enabled)) 3824 (null tramp-crypt-enabled))
@@ -5439,7 +5439,7 @@ This handles also chrooted environments, which are not regarded as local."
5439 ;; handlers. `tramp-local-host-p' is also called for "smb" and 5439 ;; handlers. `tramp-local-host-p' is also called for "smb" and
5440 ;; alike, where it must fail. 5440 ;; alike, where it must fail.
5441 (tramp-sh-file-name-handler-p vec) 5441 (tramp-sh-file-name-handler-p vec)
5442 ;; Direct actions aren't possible for crypted directories. 5442 ;; Direct actions aren't possible for encrypted directories.
5443 (null tramp-crypt-enabled) 5443 (null tramp-crypt-enabled)
5444 ;; The local temp directory must be writable for the other user. 5444 ;; The local temp directory must be writable for the other user.
5445 (file-writable-p 5445 (file-writable-p