commit c580081578edf8663e80cd86a1b4de377be58dc1 (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Tue Jan 22 10:38:49 2019 +0100 Respect setgid bit of the upper directory in Tramp * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.2-pre". * lisp/net/tramp.el: Bump version to 2.4.2-pre. (tramp-set-file-uid-gid): Respect setgid bit of the upper directory. (tramp-default-file-modes, tramp-handle-insert-file-contents) (tramp-mode-string-to-int, tramp-make-tramp-temp-file): * lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy) (tramp-adb-handle-write-region): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly) (tramp-sh-handle-write-region): Use octal constants. diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index f5cc2bae17..5b1408a497 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -7,7 +7,7 @@ @c In the Tramp GIT, the version number is auto-frobbed from tramp.el, @c and the bug report address is auto-frobbed from configure.ac. -@set trampver 2.4.1 +@set trampver 2.4.2-pre @set tramp-bug-report-address tramp-devel@@gnu.org @c Other flags from configuration. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 73774dbc44..c900d3c9a2 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -609,9 +609,7 @@ Emacs dired can't find files." (ignore-errors (delete-file tmpfile)) (tramp-error v 'file-error "Cannot make local copy of file `%s'" filename)) - (set-file-modes - tmpfile - (logior (or (file-modes filename) 0) (string-to-number "0400" 8)))) + (set-file-modes tmpfile (logior (or (file-modes filename) 0) #o0400))) tmpfile))) (defun tramp-adb-handle-file-writable-p (filename) @@ -657,9 +655,7 @@ But handle the case, if the \"test\" command is not available." (tmpfile (tramp-compat-make-temp-file filename))) (when (and append (file-exists-p filename)) (copy-file filename tmpfile 'ok) - (set-file-modes - tmpfile - (logior (or (file-modes tmpfile) 0) (string-to-number "0600" 8)))) + (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600))) (tramp-run-real-handler 'write-region (list start end tmpfile append 'no-message lockname)) (with-tramp-progress-reporter diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index dfb4b84517..d0e7357f8f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2184,8 +2184,7 @@ the uid and gid from FILENAME." (or (eq op 'copy) (zerop (logand - (file-modes (file-name-directory localname1)) - (string-to-number "1000" 8)))) + (file-modes (file-name-directory localname1)) #o1000))) (file-writable-p (file-name-directory localname2)) (or (file-directory-p localname2) (file-writable-p localname2)))) @@ -2229,8 +2228,7 @@ the uid and gid from FILENAME." ;; We must change the ownership as remote user. ;; Since this does not work reliable, we also ;; give read permissions. - (set-file-modes - (concat prefix tmpfile) (string-to-number "0777" 8)) + (set-file-modes (concat prefix tmpfile) #o0777) (tramp-set-file-uid-gid (concat prefix tmpfile) (tramp-get-local-uid 'integer) @@ -2244,7 +2242,7 @@ the uid and gid from FILENAME." ;; We must change the ownership as local user. ;; Since this does not work reliable, we also ;; give read permissions. - (set-file-modes tmpfile (string-to-number "0777" 8)) + (set-file-modes tmpfile #o0777) (tramp-set-file-uid-gid tmpfile (tramp-get-remote-uid v 'integer) @@ -3267,9 +3265,7 @@ the result will be a local, non-Tramp, file name." ;; handles permissions. ;; Ensure that it is still readable. (when modes - (set-file-modes - tmpfile - (logior (or modes 0) (string-to-number "0400" 8)))) + (set-file-modes tmpfile (logior (or modes 0) #o0400))) ;; This is a bit lengthy due to the different methods ;; possible for file transfer. First, we check whether the diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a65094f811..6428e18331 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.4.1 +;; Version: 2.4.2-pre ;; Package-Requires: ((emacs "24.1")) ;; This file is part of GNU Emacs. @@ -2148,7 +2148,7 @@ been set up by `rfn-eshadow-setup-minibuffer'." If the file modes of FILENAME cannot be determined, return the value of `default-file-modes', without execute permissions." (or (file-modes filename) - (logand (default-file-modes) (string-to-number "0666" 8)))) + (logand (default-file-modes) #o0666))) (defun tramp-replace-environment-variables (filename) "Replace environment variables in FILENAME. @@ -3539,7 +3539,7 @@ User is always nil." ;; When the file is not readable for the owner, it ;; cannot be inserted, even if it is readable for the ;; group or for everybody. - (set-file-modes local-copy (string-to-number "0600" 8)) + (set-file-modes local-copy #o0600) (when (and (null remote-copy) (tramp-get-method-parameter @@ -4254,47 +4254,47 @@ would yield t. On the other hand, the following check results in nil: (other-execute-or-sticky (aref mode-chars 9))) (logior (cond - ((char-equal owner-read ?r) (string-to-number "00400" 8)) + ((char-equal owner-read ?r) #o0400) ((char-equal owner-read ?-) 0) (t (error "Second char `%c' must be one of `r-'" owner-read))) (cond - ((char-equal owner-write ?w) (string-to-number "00200" 8)) + ((char-equal owner-write ?w) #o0200) ((char-equal owner-write ?-) 0) (t (error "Third char `%c' must be one of `w-'" owner-write))) (cond - ((char-equal owner-execute-or-setid ?x) (string-to-number "00100" 8)) - ((char-equal owner-execute-or-setid ?S) (string-to-number "04000" 8)) - ((char-equal owner-execute-or-setid ?s) (string-to-number "04100" 8)) + ((char-equal owner-execute-or-setid ?x) #o0100) + ((char-equal owner-execute-or-setid ?S) #o4000) + ((char-equal owner-execute-or-setid ?s) #o4100) ((char-equal owner-execute-or-setid ?-) 0) (t (error "Fourth char `%c' must be one of `xsS-'" owner-execute-or-setid))) (cond - ((char-equal group-read ?r) (string-to-number "00040" 8)) + ((char-equal group-read ?r) #o0040) ((char-equal group-read ?-) 0) (t (error "Fifth char `%c' must be one of `r-'" group-read))) (cond - ((char-equal group-write ?w) (string-to-number "00020" 8)) + ((char-equal group-write ?w) #o0020) ((char-equal group-write ?-) 0) (t (error "Sixth char `%c' must be one of `w-'" group-write))) (cond - ((char-equal group-execute-or-setid ?x) (string-to-number "00010" 8)) - ((char-equal group-execute-or-setid ?S) (string-to-number "02000" 8)) - ((char-equal group-execute-or-setid ?s) (string-to-number "02010" 8)) + ((char-equal group-execute-or-setid ?x) #o0010) + ((char-equal group-execute-or-setid ?S) #o2000) + ((char-equal group-execute-or-setid ?s) #o2010) ((char-equal group-execute-or-setid ?-) 0) (t (error "Seventh char `%c' must be one of `xsS-'" group-execute-or-setid))) (cond - ((char-equal other-read ?r) (string-to-number "00004" 8)) + ((char-equal other-read ?r) #o0004) ((char-equal other-read ?-) 0) (t (error "Eighth char `%c' must be one of `r-'" other-read))) (cond - ((char-equal other-write ?w) (string-to-number "00002" 8)) + ((char-equal other-write ?w) #o0002) ((char-equal other-write ?-) 0) (t (error "Ninth char `%c' must be one of `w-'" other-write))) (cond - ((char-equal other-execute-or-sticky ?x) (string-to-number "00001" 8)) - ((char-equal other-execute-or-sticky ?T) (string-to-number "01000" 8)) - ((char-equal other-execute-or-sticky ?t) (string-to-number "01001" 8)) + ((char-equal other-execute-or-sticky ?x) #o0001) + ((char-equal other-execute-or-sticky ?T) #o1000) + ((char-equal other-execute-or-sticky ?t) #o1001) ((char-equal other-execute-or-sticky ?-) 0) (t (error "Tenth char `%c' must be one of `xtT-'" other-execute-or-sticky)))))) @@ -4353,7 +4353,11 @@ If UID and GID are provided, these values are used; otherwise uid and gid of the corresponding remote or local user is taken, depending whether FILENAME is remote or local. Both parameters must be non-negative integers. +The setgid bit of the upper directory is respected. If FILENAME is remote, a file name handler is called." + (unless (zerop (logand #o2000 (file-modes (file-name-directory filename)))) + (setq gid (tramp-compat-file-attribute-group-id + (file-attributes (file-name-directory filename) 'integer)))) (let ((handler (find-file-name-handler filename 'tramp-set-file-uid-gid))) (if handler (funcall handler 'tramp-set-file-uid-gid filename uid gid) @@ -4521,7 +4525,7 @@ Return the local name of the temporary file." (setq result nil) ;; This creates the file by side effect. (set-file-times result) - (set-file-modes result (string-to-number "0700" 8)))) + (set-file-modes result #o0700))) ;; Return the local part. (with-parsed-tramp-file-name result nil localname))) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index ccc7de12cb..83d34c0222 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -31,7 +31,7 @@ ;; aclocal.m4; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.4.1" +(defconst tramp-version "2.4.2-pre" "This version of Tramp.") ;;;###tramp-autoload @@ -65,7 +65,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-lessp emacs-version "24.1")) "ok" - (format "Tramp 2.4.1 is not fit for %s" + (format "Tramp 2.4.2-pre is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) commit 5259fdf96073febd18e83785960c443bdf02a310 Author: Stefan Monnier Date: Mon Jan 21 17:20:00 2019 -0500 * lisp/international/titdic-cnv.el: Use lexical-binding (tit-process-body): Remove unused vars 'template' and 'second'. (tsang-quick-converter): Remove unused args 'name' and 'title'. Remove unused var 'slot'. (tsang-b5-converter, quick-b5-converter, tsang-cns-converter) (quick-cns-converter, py-converter, ziranma-converter) (ctlau-converter, ctlau-gb-converter, ctlau-b5-converter): Remove unused args 'name' and 'title'. (miscdic-convert): Remove unused var 'dicbuf'. Don't pass 'name' and 'title' to the conversion function. diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index f1a81018cb..2ce2c527b9 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -1,4 +1,4 @@ -;;; titdic-cnv.el --- convert cxterm dictionary (TIT format) to Quail package -*- coding:utf-8-emacs -*- +;;; titdic-cnv.el --- convert cxterm dictionary (TIT format) to Quail package -*- coding: utf-8-emacs; lexical-binding:t -*- ;; Copyright (C) 1997-1998, 2000-2019 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -417,9 +417,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲, ;; function call. (defun tit-process-body () (message "Formatting translation rules...") - (let* ((template (list nil nil)) - (second (cdr template)) - (prev-key "") + (let* ((prev-key "") ch key translations pos) (princ "(quail-define-rules\n") (while (null (eobp)) @@ -735,7 +733,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." ;; input method is for inputting Big5 characters. Otherwise the input ;; method is for inputting CNS characters. -(defun tsang-quick-converter (dicbuf name title tsang-p big5-p) +(defun tsang-quick-converter (dicbuf tsang-p big5-p) (let ((fulltitle (if tsang-p (if big5-p "倉頡" "倉頡") (if big5-p "簡易" "簡易"))) dic) @@ -780,7 +778,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." (while (not (eobp)) (forward-char 5) (let ((trans (char-to-string (following-char))) - key slot) + key) (re-search-forward "\\([A-Z]+\\)\r*$" nil t) (setq key (downcase (if (or tsang-p @@ -831,23 +829,23 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"." (if big5-p (nth 1 elt) (nth 2 elt)))))) (insert ")\n"))) -(defun tsang-b5-converter (dicbuf name title) - (tsang-quick-converter dicbuf name title t t)) +(defun tsang-b5-converter (dicbuf) + (tsang-quick-converter dicbuf t t)) -(defun quick-b5-converter (dicbuf name title) - (tsang-quick-converter dicbuf name title nil t)) +(defun quick-b5-converter (dicbuf) + (tsang-quick-converter dicbuf nil t)) -(defun tsang-cns-converter (dicbuf name title) - (tsang-quick-converter dicbuf name title t nil)) +(defun tsang-cns-converter (dicbuf) + (tsang-quick-converter dicbuf t nil)) -(defun quick-cns-converter (dicbuf name title) - (tsang-quick-converter dicbuf name title nil nil)) +(defun quick-cns-converter (dicbuf) + (tsang-quick-converter dicbuf nil nil)) ;; Generate a code of a Quail package in the current buffer from ;; Pinyin dictionary in the buffer DICBUF. The input method name of ;; the Quail package is NAME, and the title string is TITLE. -(defun py-converter (dicbuf name title) +(defun py-converter (dicbuf) (goto-char (point-max)) (insert (format "%S\n" "汉字输入∷拼音∷ @@ -922,14 +920,14 @@ method `chinese-tonepy' with which you must specify tones by digits ;; Ziranma dictionary in the buffer DICBUF. The input method name of ;; the Quail package is NAME, and the title string is TITLE. -(defun ziranma-converter (dicbuf name title) +(defun ziranma-converter (dicbuf) (let (dic) (with-current-buffer dicbuf (goto-char (point-min)) (search-forward "\n%keyname end") (forward-line 1) (let ((table (make-hash-table :test 'equal)) - elt pos key trans val) + pos key trans val) (while (not (eobp)) (setq pos (point)) (skip-chars-forward "^ \t") @@ -1031,7 +1029,7 @@ To input symbols and punctuation, type `/' followed by one of `a' to ;; method name of the Quail package is NAME, and the title string is ;; TITLE. DESCRIPTION is the string shown by describe-input-method. -(defun ctlau-converter (dicbuf name title description) +(defun ctlau-converter (dicbuf description) (goto-char (point-max)) (insert (format "%S\n" description)) (insert " '((\"\C-?\" . quail-delete-last-char) @@ -1041,7 +1039,7 @@ To input symbols and punctuation, type `/' followed by one of `a' to (\"<\" . quail-prev-translation)) nil nil nil nil)\n\n") (insert "(quail-define-rules\n") - (let (dicbuf-start dicbuf-end key-start key (pos (point))) + (let (dicbuf-start dicbuf-end key-start (pos (point))) ;; Find the dictionary, which starts below a horizontal rule and ;; ends at the second to last line in the HTML file. (with-current-buffer dicbuf @@ -1080,8 +1078,8 @@ To input symbols and punctuation, type `/' followed by one of `a' to (forward-line 1))) (insert ")\n")) -(defun ctlau-gb-converter (dicbuf name title) - (ctlau-converter dicbuf name title +(defun ctlau-gb-converter (dicbuf) + (ctlau-converter dicbuf "汉字输入∷刘锡祥式粤音∷ 刘锡祥式粤语注音方案 @@ -1094,8 +1092,8 @@ To input symbols and punctuation, type `/' followed by one of `a' to Some infrequent GB characters are accessed by typing \\, followed by the Cantonese romanization of the respective radical (部首).")) -(defun ctlau-b5-converter (dicbuf name title) - (ctlau-converter dicbuf name title +(defun ctlau-b5-converter (dicbuf) + (ctlau-converter dicbuf "漢字輸入:劉錫祥式粵音: 劉錫祥式粵語注音方案 @@ -1120,8 +1118,7 @@ the generated Quail package is saved." (let ((tail quail-misc-package-ext-info) coding-system-for-write slot - name title dicfile coding quailfile converter copyright - dicbuf) + name title dicfile coding quailfile converter copyright) (while tail (setq slot (car tail) dicfile (nth 2 slot) @@ -1171,7 +1168,7 @@ the generated Quail package is saved." (insert-file-contents filename) (let ((dicbuf (current-buffer))) (with-current-buffer dstbuf - (funcall converter dicbuf name title))))) + (funcall converter dicbuf))))) (insert ";; Local Variables:\n" ";; version-control: never\n" ";; no-update-autoloads: t\n" commit be73ed4338b37973eb67e8fd91aaa9e1166c665c Author: Paul Eggert Date: Mon Jan 21 12:48:42 2019 -0800 Simplify pdumper-load via timespectod Suggested by Eli Zaretskii in: https://lists.gnu.org/r/emacs-devel/2019-01/msg00458.html * src/pdumper.c (pdumper_load): Simplify. diff --git a/src/pdumper.c b/src/pdumper.c index e57aa8f2a0..6be26dc816 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -5545,10 +5545,7 @@ pdumper_load (const char *dump_filename) struct timespec load_timespec = timespec_sub (current_timespec (), start_time); - ALLOW_IMPLICIT_CONVERSION; - double s = load_timespec.tv_sec, ns = load_timespec.tv_nsec; - DISALLOW_IMPLICIT_CONVERSION; - dump_private.load_time = (s * 1e9 + ns) / 1e9; + dump_private.load_time = timespectod (load_timespec); dump_private.dump_filename = dump_filename_copy; dump_filename_copy = NULL; commit 657f6fe5008b1090b5670111b53624ecb2cacca0 Author: Stefan Monnier Date: Mon Jan 21 15:03:28 2019 -0500 * src/pdumper.c (dump_string) [CHECK_STRUCTS]: Fix copy&paste error diff --git a/src/pdumper.c b/src/pdumper.c index 4bbeabb828..e57aa8f2a0 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2111,7 +2111,7 @@ dump_interval_tree (struct dump_context *ctx, static dump_off dump_string (struct dump_context *ctx, const struct Lisp_String *string) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Symbol_60EA1E748E) +#if CHECK_STRUCTS && !defined (HASH_Lisp_String_86FEA6EC7C) # error "Lisp_String changed. See CHECK_STRUCTS comment." #endif /* If we have text properties, write them _after_ the string so that commit 6896604babb4e9ac775751f9d012a95785948aae Author: Stefan Monnier Date: Mon Jan 21 14:30:29 2019 -0500 * lisp/electric.el: Fix typo in last change. diff --git a/lisp/electric.el b/lisp/electric.el index 9610b4be22..ed968d7c65 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -198,8 +198,8 @@ relative order must be maintained within it." (setq-default post-self-insert-hook (sort (default-value 'post-self-insert-hook) #'(lambda (fn1 fn2) - (< (or (if (symbol fn1) (get fn1 'priority)) 0) - (or (if (symbol fn2) (get fn2 'priority)) 0)))))) + (< (or (if (symbolp fn1) (get fn1 'priority)) 0) + (or (if (symbolp fn2) (get fn2 'priority)) 0)))))) ;;; Electric indentation. commit d1ea675d2cfccfb043c8e853c410427ca62dd921 Author: Stefan Monnier Date: Mon Jan 21 13:52:51 2019 -0500 (electric--sort-post-self-insertion-hook): Accept non-symbol functions * lisp/electric.el (electric--sort-post-self-insertion-hook): Don't burp on non-symbol functions. diff --git a/lisp/electric.el b/lisp/electric.el index f2061c2f52..9610b4be22 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -198,8 +198,8 @@ relative order must be maintained within it." (setq-default post-self-insert-hook (sort (default-value 'post-self-insert-hook) #'(lambda (fn1 fn2) - (< (or (get fn1 'priority) 0) - (or (get fn2 'priority) 0)))))) + (< (or (if (symbol fn1) (get fn1 'priority)) 0) + (or (if (symbol fn2) (get fn2 'priority)) 0)))))) ;;; Electric indentation. commit 6e5ac1d1ff38ae52321758f53fd513959d360e0b Author: Alan Third Date: Mon Jan 21 16:50:12 2019 +0000 Fix occasional pdumper/bootstrap error * src/Makefile.in (emacs$(EXEEXT)): Copy the new executable over bootstrap-emacs. diff --git a/src/Makefile.in b/src/Makefile.in index 1d6faf9c53..e0b7e3d1ef 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -565,6 +565,7 @@ ifeq ($(DUMPING),unexec) cp -f $@ bootstrap-emacs$(EXEEXT) else rm -f $@ && cp -f temacs$(EXEEXT) $@ + cp -f $@ bootstrap-emacs$(EXEEXT) endif ifeq ($(DUMPING),pdumper) commit 7fcdabdcb03a47ec028a5821f6c3fc054d00b40d Author: Michael Albinus Date: Mon Jan 21 11:34:32 2019 +0100 * lisp/net/tramp-sh.el (tramp-set-remote-path): Fix usage of tmpfile. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 4fa8b3fa3f..dfb4b84517 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3973,9 +3973,11 @@ variable PATH." (if (< (length command) pipe-buf) (tramp-send-command vec command) ;; Use a temporary file. - (setq tmpfile (tramp-make-tramp-temp-file vec)) + (setq tmpfile + (tramp-make-tramp-file-name vec (tramp-make-tramp-temp-file vec))) (write-region command nil tmpfile) - (tramp-send-command vec (format ". %s" tmpfile)) + (tramp-send-command + vec (format ". %s" (tramp-compat-file-local-name tmpfile))) (delete-file tmpfile)))) ;; ------------------------------------------------------------