Subject: bug#34225: closed (Re: bug#34225: 27.0.50; Add passwd backups to etc-passwd-generic-mode)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 28 Jan 2019 20:22:02 +0000

Your bug report

#34225: 27.0.50; Add passwd backups to etc-passwd-generic-mode

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
34225: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34225
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#34225: 27.0.50; Add passwd backups to etc-passwd-generic-mode
From: Juri Linkov <[email-masked]>
To: Glenn Morris <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, [email-masked]
Date: Mon, 28 Jan 2019 22:19:39 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

>>> I don't know why backups /etc/passwd- use the suffix '-' instead of '~'
>>
>> It does?  I seem to be unable to reproduce this:
>>
>>   (make-backup-file-name "/etc/passwd")
>>     => "/etc/passwd~"
>>
>> What am I missing?
>
> These are non-Emacs backups. See eg "man 5 shadow".
>
>     /etc/shadow-
>     Backup file for /etc/shadow.
>
>     Note that this file is used by the tools of the shadow toolsuite,
>     but not by all user and password management tools.

Yes, and "man 5 passwd" shows the same:

       /etc/passwd-
           Backup file for /etc/passwd.

So I installed the patch to master.

Subject: 27.0.50; Add passwd backups to etc-passwd-generic-mode
From: Juri Linkov <[email-masked]>
To: [email-masked]
Date: Sun, 27 Jan 2019 22:34:03 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

I don't know why backups /etc/passwd- use the suffix ‘-’ instead of ‘~’
but comparing these files with their backups I noticed the difference
in their font-lock highlighting, thus this patch:

diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 014379fba9..dd61402015 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -1490,7 +1490,7 @@ etc-passwd-generic-mode
      '("^\\([^:]+\\):\\([^:]*\\):\\([0-9]+\\):\\(.*\\)$"
        (1 font-lock-type-face)
        (4 font-lock-variable-name-face))))
-  '("/etc/passwd\\'" "/etc/group\\'")
+  '("/etc/passwd-?\\'" "/etc/group-?\\'" "/etc/shadow-?\\'")
   (list
    (function
     (lambda ()