]> granicus.if.org Git - vim/commitdiff
patch 8.2.3604: not all sudoers files are recognized v8.2.3604
authorBram Moolenaar <Bram@vim.org>
Tue, 16 Nov 2021 16:38:42 +0000 (16:38 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 16 Nov 2021 16:38:42 +0000 (16:38 +0000)
Problem:    Not all sudoers files are recognized.
Solution:   Add a file pattern. (Doug Kearns, closes #1192)

runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 875823c4829b1cb8ea68f2c46e6c406b3bf15e1e..2a75126e4d117169b9e3c26e8b3317bf1ef4dff2 100644 (file)
@@ -2307,6 +2307,9 @@ au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]alias
 au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
 au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
 
+" Sudoers
+au BufNewFile,BufRead */etc/sudoers.d/*                call s:StarSetf('sudoers')
+
 " tcsh scripts ending in a star
 au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh")
 
index 6376334f0fb5441cf8ac31f242ba7ae9a3079580..6134b328d974819360afe017f3da3732db0ffabd 100644 (file)
@@ -482,7 +482,7 @@ let s:filename_checks = {
     \ 'st': ['file.st'],
     \ 'stata': ['file.ado', 'file.do', 'file.imata', 'file.mata'],
     \ 'stp': ['file.stp'],
-    \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers'],
+    \ 'sudoers': ['any/etc/sudoers', 'sudoers.tmp', '/etc/sudoers', 'any/etc/sudoers.d/file'],
     \ 'svg': ['file.svg'],
     \ 'svn': ['svn-commitfile.tmp', 'svn-commit-file.tmp', 'svn-commit.tmp'],
     \ 'swift': ['file.swift'],
index 1c8c955b6d765522a1d123e24ce6874689348e5a..c96c2338e10ae6c628ffdce7696dc67020038f82 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3604,
 /**/
     3603,
 /**/