annotate runtime/syntax/sudoers.vim @ 60:bd6c24f96e69

updated for version 7.0030
author vimboss
date Tue, 04 Jan 2005 21:14:57 +0000
parents 410fa1a31baf
children f14cbd913415
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
1 " Vim syntax file
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
2 " Language: sudoers(5) configuration files.
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
3 " Maintainer: Nikolai Weibull <source@pcppopper.org>
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
4 " URL: http://www.pcppopper.org/
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
5 " Latest Revision: 2004-12-17
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
6 " arch-tag: 02fc3bc8-4308-466f-b83e-718a7487b198
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
7
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
8 if version < 600
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
9 syntax clear
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
11 finish
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
12 endif
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
13
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
14 " TODO: instead of 'skipnl', we would like to match a specific group that would
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
15 " match \\$ and then continue with the nextgroup, actually, the skipnl doesn't
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
16 " work...
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
17 " TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!)
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
18
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
19 " User Specs
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
20 syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
21
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
22 syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
23
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
24 syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASSWD,@sudoersCmndInSpec
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
25
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
26 " Todo
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
27 syn keyword sudoersTodo contained TODO FIXME XXX NOTE
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
28
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
29 " Comments
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
30 syn region sudoersComment matchgroup=sudoersComment start='#' end='$' contains=sudoersTodo
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
31
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
32 " Aliases
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
33 syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
34 syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
35 syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
36
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
37 " Names
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
38 syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
39 syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
40 syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
41 syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
42 syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
43 syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
44
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
45 syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
46 syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
47 syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
48 syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
49 syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
50
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
51 syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
52 syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
53 syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
54 syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
55 syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
56
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
57 syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
58 syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
59 syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
60 syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
61 syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
62
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
63 syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
64 syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
65 syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
66 syn match sudoersNetworkInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
67 syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
68 syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
69
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
70 syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
71 syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
72 syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
73 syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
74 syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
75
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
76 syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
77 syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
78 syn match sudoersNetworkInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
79 syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
80 syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
81
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
82 syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
83 syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
84 syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
85
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
86 syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
87 syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
88
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
89 " Delimiters
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
90 syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
91 syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
92 syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
93 syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
94
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
95 syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
96 syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
97
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
98 syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
99 syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
100 syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersPASSWD,@sudoersCmndInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
101 syn cluster sudoersUserRunas contains=sudoersUserRunasComma,@sudoersUserInRunas,sudoersUserRunasEnd
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
102
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
103
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
104 syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
105 syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
106 syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
107 syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
108
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
109 syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
110 syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
111
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
112
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
113 syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
114 syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
115 syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
116 syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
117
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
118 syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
119 syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
120 syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
121
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
122 " Lists
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
123 syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
124 syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
125 syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
126
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
127 syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
128 syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
129
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
130 syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
131 syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
132 syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
133 syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
134
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
135 " Operators
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
136 syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
137 syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
138 syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
139
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
140 syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
141 syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
142
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
143 syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
144 syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
145 syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
146 syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
147
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
148 " Arguments
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
149 syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
150 syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
151
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
152 syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
153 syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
154
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
155 " Default Entries
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
156 syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
157 syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
158 syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
159 syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
160
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
161 " TODO: could also deal with special characters here
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
162 syn keyword sudoersBooleanParameter contained long_opt_prompt ignore_dot mail_always mail_badpass mail_no_user mail_no_perms tty_tickets lecture authenticate root_sudo log_host log_year shell_noargs set_home always_set_home path_info preserve_groups fqdn insults requiretty env_editor rootpw runaspw targetpw set_logname stay_setuid env_reset use_loginclass nextgroup=sudoersParameterListComma skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
163 syn keyword sudoersIntegerParameter contained passwd_tries loglinelen timestamp_timeout passwd_timeout umask nextgroup=sudoersIntegerParameterEquals skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
164 syn keyword sudoersStringParameter contained mailsub badpass_message timestampdir timestampowner passprompt runas_default syslog_goodpri syslog_badpri editor logfile syslog mailerpath mailerflags mailto exempt_group verifypw listpw nextgroup=sudoersStringParameterEquals skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
165 syn keyword sudoersListParameter contained env_check env_delete env_keep nextgroup=sudoersListParameterEquals skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
166
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
167 syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
168
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
169 syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameterEquals,sudoersStringParameter,sudoersListParameter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
170
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
171 syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
172 syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
173 syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
174
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
175 syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
176 syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
177 syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
178 syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
179 syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
180
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
181 " Special for specs
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
182 syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
183
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
184 " Define the default highlighting.
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
185 " For version 5.7 and earlier: only when not done already
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
186 " For version 5.8 and later: only when an item doesn't have highlighting yet
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
187 if version >= 508 || !exists("did_sudoers_syn_inits")
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
188 if version < 508
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
189 let did_sudoers_syn_inits = 1
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
190 command -nargs=+ HiLink hi link <args>
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
191 else
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
192 command -nargs=+ HiLink hi def link <args>
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
193 endif
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
194
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
195 HiLink sudoersSpecEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
196 HiLink sudoersTodo Todo
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
197 HiLink sudoersComment Comment
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
198 HiLink sudoersAlias Keyword
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
199 HiLink sudoersUserAlias Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
200 HiLink sudoersUserNameInList String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
201 HiLink sudoersUIDInList Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
202 HiLink sudoersGroupInList PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
203 HiLink sudoersUserNetgroupInList PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
204 HiLink sudoersUserAliasInList PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
205 HiLink sudoersUserName String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
206 HiLink sudoersUID Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
207 HiLink sudoersGroup PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
208 HiLink sudoersUserNetgroup PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
209 HiLink sudoersUserAliasRef PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
210 HiLink sudoersUserNameInSpec String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
211 HiLink sudoersUIDInSpec Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
212 HiLink sudoersGroupInSpec PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
213 HiLink sudoersUserNetgroupInSpec PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
214 HiLink sudoersUserAliasInSpec PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
215 HiLink sudoersUserNameInRunas String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
216 HiLink sudoersUIDInRunas Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
217 HiLink sudoersGroupInRunas PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
218 HiLink sudoersUserNetgroupInRunas PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
219 HiLink sudoersUserAliasInRunas PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
220 HiLink sudoersHostAlias Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
221 HiLink sudoersHostNameInList String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
222 HiLink sudoersIPAddrInList Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
223 HiLink sudoersNetworkInList Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
224 HiLink sudoersHostNetgroupInList PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
225 HiLink sudoersHostAliasInList PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
226 HiLink sudoersHostName String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
227 HiLink sudoersIPAddr Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
228 HiLink sudoersNetwork Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
229 HiLink sudoersHostNetgroup PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
230 HiLink sudoersHostAliasRef PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
231 HiLink sudoersHostNameInSpec String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
232 HiLink sudoersIPAddrInSpec Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
233 HiLink sudoersNetworkInSpec Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
234 HiLink sudoersHostNetgroupInSpec PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
235 HiLink sudoersHostAliasInSpec PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
236 HiLink sudoersCmndAlias Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
237 HiLink sudoersCmndNameInList String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
238 HiLink sudoersCmndAliasInList PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
239 HiLink sudoersCmndNameInSpec String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
240 HiLink sudoersCmndAliasInSpec PreProc
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
241 HiLink sudoersUserAliasEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
242 HiLink sudoersUserListComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
243 HiLink sudoersUserListColon Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
244 HiLink sudoersUserSpecComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
245 HiLink sudoersUserRunasBegin Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
246 HiLink sudoersUserRunasComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
247 HiLink sudoersUserRunasEnd Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
248 HiLink sudoersHostAliasEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
249 HiLink sudoersHostListComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
250 HiLink sudoersHostListColon Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
251 HiLink sudoersHostSpecComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
252 HiLink sudoersCmndAliasEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
253 HiLink sudoersCmndListComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
254 HiLink sudoersCmndListColon Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
255 HiLink sudoersCmndSpecComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
256 HiLink sudoersCmndSpecColon Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
257 HiLink sudoersUserNegationInList Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
258 HiLink sudoersHostNegationInList Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
259 HiLink sudoersCmndNegationInList Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
260 HiLink sudoersUserNegation Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
261 HiLink sudoersHostNegation Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
262 HiLink sudoersUserNegationInSpec Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
263 HiLink sudoersHostNegationInSpec Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
264 HiLink sudoersUserNegationInRunas Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
265 HiLink sudoersCmndNegationInSpec Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
266 HiLink sudoersCommandArgs String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
267 HiLink sudoersCommandEmpty Special
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
268 HiLink sudoersDefaultEntry Keyword
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
269 HiLink sudoersDefaultTypeAt Special
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
270 HiLink sudoersDefaultTypeColon Special
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
271 HiLink sudoersDefaultTypeGreaterThan Special
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
272 HiLink sudoersBooleanParameter Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
273 HiLink sudoersIntegerParameter Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
274 HiLink sudoersStringParameter Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
275 HiLink sudoersListParameter Identifier
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
276 HiLink sudoersParameterListComma Delimiter
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
277 HiLink sudoersIntegerParameterEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
278 HiLink sudoersStringParameterEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
279 HiLink sudoersListParameterEquals Operator
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
280 HiLink sudoersIntegerValue Number
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
281 HiLink sudoersStringValue String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
282 HiLink sudoersListValue String
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
283 HiLink sudoersPASSWD Special
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
284
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
285 delcommand HiLink
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
286 endif
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
287
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
288 let b:current_syntax = "sudoers"
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
289
410fa1a31baf updated for version 7.0023
vimboss
parents:
diff changeset
290 " vim: set sts=2 sw=2: