blob: 019b0ada32fe64d6937818360cb6236e7d696242 [file] [log] [blame]
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001" Vim syntax file
Bram Moolenaar214641f2017-03-05 17:04:09 +01002" Language: sudoers(5) configuration files
3" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Bram Moolenaarfc65cab2018-08-28 22:58:02 +02004" Latest Revision: 2018-08-18
Bram Moolenaara9604e62018-07-21 05:56:22 +02005" Recent Changes: Support for #include and #includedir.
Bram Moolenaarfc65cab2018-08-28 22:58:02 +02006" Added many new options (Samuel D. Leslie)
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00007
Bram Moolenaar42eeac32005-06-29 22:40:58 +00008if exists("b:current_syntax")
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00009 finish
10endif
11
Bram Moolenaar42eeac32005-06-29 22:40:58 +000012let s:cpo_save = &cpo
13set cpo&vim
14
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000015" TODO: instead of 'skipnl', we would like to match a specific group that would
16" match \\$ and then continue with the nextgroup, actually, the skipnl doesn't
17" work...
18" TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!)
19
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000020syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite
21
Bram Moolenaar42eeac32005-06-29 22:40:58 +000022syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000023
Bram Moolenaar42eeac32005-06-29 22:40:58 +000024syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASSWD,@sudoersCmndInSpec
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000025
Bram Moolenaar42eeac32005-06-29 22:40:58 +000026syn keyword sudoersTodo contained TODO FIXME XXX NOTE
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000027
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000028syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo
Bram Moolenaara9604e62018-07-21 05:56:22 +020029syn region sudoersInclude display oneline start='#\(include\|includedir\)' end='$'
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000030
Bram Moolenaar42eeac32005-06-29 22:40:58 +000031syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl
32syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl
33syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000034
Bram Moolenaar42eeac32005-06-29 22:40:58 +000035syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl
36syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
37syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl
38syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
39syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
40syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000041
Bram Moolenaar42eeac32005-06-29 22:40:58 +000042syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
43syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl
44syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
45syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
46syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000047
Bram Moolenaar42eeac32005-06-29 22:40:58 +000048syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
49syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
50syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
51syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
52syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000053
Bram Moolenaar42eeac32005-06-29 22:40:58 +000054syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
55syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
56syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
57syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
58syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000059
Bram Moolenaar42eeac32005-06-29 22:40:58 +000060syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl
61syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
62syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000063syn match sudoersNetworkInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostList skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +000064syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
65syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000066
Bram Moolenaar42eeac32005-06-29 22:40:58 +000067syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
68syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl
69syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl
70syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
71syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000072
Bram Moolenaar42eeac32005-06-29 22:40:58 +000073syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
74syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000075syn match sudoersNetworkInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostSpec skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +000076syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
77syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000078
Bram Moolenaar42eeac32005-06-29 22:40:58 +000079syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000080syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite
Bram Moolenaar42eeac32005-06-29 22:40:58 +000081syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000082
83syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite
Bram Moolenaar42eeac32005-06-29 22:40:58 +000084syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000085
Bram Moolenaar42eeac32005-06-29 22:40:58 +000086syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl
87syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl
88syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl
89syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000090
Bram Moolenaar42eeac32005-06-29 22:40:58 +000091syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl
92syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000093
94syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +000095syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl
96syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersPASSWD,@sudoersCmndInSpec skipwhite skipnl
97syn cluster sudoersUserRunas contains=sudoersUserRunasComma,@sudoersUserInRunas,sudoersUserRunasEnd
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000098
99
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000100syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl
101syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl
102syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl
103syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000104
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000105syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl
106syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000107
108
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000109syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl
110syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl
111syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl
112syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000113
114syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000115syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl
116syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000117
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000118syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList
119syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList
120syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000121
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000122syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef
123syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000124
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000125syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec
126syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec
127syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas
128syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000129
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000130syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl
131syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl
132syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl
133
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000134syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl
135syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000136
137syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl
138syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl
139syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl
140syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl
141
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000142syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite
143syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000144
145syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite
146syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl
147
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000148syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl
149syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl
150syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000151syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl
152
153" TODO: could also deal with special characters here
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000154syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl
Bram Moolenaar00654022011-02-25 14:42:19 +0100155syn keyword sudoersBooleanParameter contained skipwhite skipnl
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200156 \ always_query_group_plugin
Bram Moolenaar00654022011-02-25 14:42:19 +0100157 \ always_set_home
158 \ authenticate
159 \ closefrom_override
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200160 \ compress_io
Bram Moolenaar00654022011-02-25 14:42:19 +0100161 \ env_editor
162 \ env_reset
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200163 \ exec_background
164 \ fast_glob
Bram Moolenaar00654022011-02-25 14:42:19 +0100165 \ fqdn
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200166 \ ignore_audit_errors
Bram Moolenaar00654022011-02-25 14:42:19 +0100167 \ ignore_dot
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200168 \ ignore_iolog_errors
Bram Moolenaar00654022011-02-25 14:42:19 +0100169 \ ignore_local_sudoers
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200170 \ ignore_logfile_errors
171 \ ignore_unknown_defaults
Bram Moolenaar00654022011-02-25 14:42:19 +0100172 \ insults
173 \ log_host
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200174 \ log_input
175 \ log_output
Bram Moolenaar00654022011-02-25 14:42:19 +0100176 \ log_year
177 \ long_otp_prompt
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200178 \ mail_all_cmnds
Bram Moolenaar00654022011-02-25 14:42:19 +0100179 \ mail_always
180 \ mail_badpass
181 \ mail_no_host
182 \ mail_no_perms
183 \ mail_no_user
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200184 \ match_group_by_gid
185 \ netgroup_tuple
Bram Moolenaar00654022011-02-25 14:42:19 +0100186 \ noexec
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200187 \ pam_session
188 \ pam_setcred
Bram Moolenaar00654022011-02-25 14:42:19 +0100189 \ passprompt_override
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200190 \ path_info
Bram Moolenaar00654022011-02-25 14:42:19 +0100191 \ preserve_groups
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200192 \ pwfeedback
Bram Moolenaar00654022011-02-25 14:42:19 +0100193 \ requiretty
194 \ root_sudo
195 \ rootpw
196 \ runaspw
197 \ set_home
198 \ set_logname
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200199 \ set_utmp
Bram Moolenaar00654022011-02-25 14:42:19 +0100200 \ setenv
201 \ shell_noargs
202 \ stay_setuid
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200203 \ sudoedit_checkdir
204 \ sudoedit_fellow
205 \ syslog_pid
Bram Moolenaar00654022011-02-25 14:42:19 +0100206 \ targetpw
207 \ tty_tickets
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200208 \ umask_override
209 \ use_netgroups
210 \ use_pty
211 \ user_command_timeouts
212 \ utmp_runas
Bram Moolenaar00654022011-02-25 14:42:19 +0100213 \ visiblepw
214
215syn keyword sudoersIntegerParameter contained
216 \ nextgroup=sudoersIntegerParameterEquals
217 \ skipwhite skipnl
218 \ closefrom
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200219 \ command_timeout
Bram Moolenaar00654022011-02-25 14:42:19 +0100220 \ loglinelen
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200221 \ maxseq
Bram Moolenaar00654022011-02-25 14:42:19 +0100222 \ passwd_timeout
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200223 \ passwd_tries
224 \ syslog_maxlen
Bram Moolenaar00654022011-02-25 14:42:19 +0100225 \ timestamp_timeout
226 \ umask
227
228syn keyword sudoersStringParameter contained
229 \ nextgroup=sudoersStringParameterEquals
230 \ skipwhite skipnl
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200231 \ askpass
Bram Moolenaar00654022011-02-25 14:42:19 +0100232 \ badpass_message
233 \ editor
Bram Moolenaar00654022011-02-25 14:42:19 +0100234 \ env_file
235 \ exempt_group
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200236 \ fdexec
237 \ group_plugin
238 \ iolog_dir
239 \ iolog_file
240 \ iolog_flush
241 \ iolog_group
242 \ iolog_mode
243 \ iolog_user
Bram Moolenaar00654022011-02-25 14:42:19 +0100244 \ lecture
245 \ lecture_file
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200246 \ lecture_status_dir
Bram Moolenaar00654022011-02-25 14:42:19 +0100247 \ listpw
248 \ logfile
249 \ mailerflags
250 \ mailerpath
251 \ mailfrom
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200252 \ mailsub
Bram Moolenaar00654022011-02-25 14:42:19 +0100253 \ mailto
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200254 \ noexec_file
255 \ pam_login_service
256 \ pam_service
257 \ passprompt
258 \ restricted_env_file
259 \ role
260 \ runas_default
Bram Moolenaar00654022011-02-25 14:42:19 +0100261 \ secure_path
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200262 \ sudoers_locale
Bram Moolenaar00654022011-02-25 14:42:19 +0100263 \ syslog
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200264 \ syslog_badpri
265 \ syslog_goodpri
266 \ timestamp_type
267 \ timestampdir
268 \ timestampowner
269 \ type
Bram Moolenaar00654022011-02-25 14:42:19 +0100270 \ verifypw
271
272syn keyword sudoersListParameter contained
273 \ nextgroup=sudoersListParameterEquals
274 \ skipwhite skipnl
275 \ env_check
276 \ env_delete
277 \ env_keep
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000278
279syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl
280
Bram Moolenaar446cb832008-06-24 21:56:24 +0000281syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000282
283syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl
284syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000285syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000286
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000287syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl
288syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
289syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
290syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
291syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000292
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000293syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000294
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000295hi def link sudoersSpecEquals Operator
296hi def link sudoersTodo Todo
297hi def link sudoersComment Comment
298hi def link sudoersAlias Keyword
299hi def link sudoersUserAlias Identifier
300hi def link sudoersUserNameInList String
301hi def link sudoersUIDInList Number
302hi def link sudoersGroupInList PreProc
303hi def link sudoersUserNetgroupInList PreProc
304hi def link sudoersUserAliasInList PreProc
305hi def link sudoersUserName String
306hi def link sudoersUID Number
307hi def link sudoersGroup PreProc
308hi def link sudoersUserNetgroup PreProc
309hi def link sudoersUserAliasRef PreProc
310hi def link sudoersUserNameInSpec String
311hi def link sudoersUIDInSpec Number
312hi def link sudoersGroupInSpec PreProc
313hi def link sudoersUserNetgroupInSpec PreProc
314hi def link sudoersUserAliasInSpec PreProc
315hi def link sudoersUserNameInRunas String
316hi def link sudoersUIDInRunas Number
317hi def link sudoersGroupInRunas PreProc
318hi def link sudoersUserNetgroupInRunas PreProc
319hi def link sudoersUserAliasInRunas PreProc
320hi def link sudoersHostAlias Identifier
321hi def link sudoersHostNameInList String
322hi def link sudoersIPAddrInList Number
323hi def link sudoersNetworkInList Number
324hi def link sudoersHostNetgroupInList PreProc
325hi def link sudoersHostAliasInList PreProc
326hi def link sudoersHostName String
327hi def link sudoersIPAddr Number
328hi def link sudoersNetwork Number
329hi def link sudoersHostNetgroup PreProc
330hi def link sudoersHostAliasRef PreProc
331hi def link sudoersHostNameInSpec String
332hi def link sudoersIPAddrInSpec Number
333hi def link sudoersNetworkInSpec Number
334hi def link sudoersHostNetgroupInSpec PreProc
335hi def link sudoersHostAliasInSpec PreProc
336hi def link sudoersCmndAlias Identifier
337hi def link sudoersCmndNameInList String
338hi def link sudoersCmndAliasInList PreProc
339hi def link sudoersCmndNameInSpec String
340hi def link sudoersCmndAliasInSpec PreProc
341hi def link sudoersUserAliasEquals Operator
342hi def link sudoersUserListComma Delimiter
343hi def link sudoersUserListColon Delimiter
344hi def link sudoersUserSpecComma Delimiter
345hi def link sudoersUserRunasBegin Delimiter
346hi def link sudoersUserRunasComma Delimiter
347hi def link sudoersUserRunasEnd Delimiter
348hi def link sudoersHostAliasEquals Operator
349hi def link sudoersHostListComma Delimiter
350hi def link sudoersHostListColon Delimiter
351hi def link sudoersHostSpecComma Delimiter
352hi def link sudoersCmndAliasEquals Operator
353hi def link sudoersCmndListComma Delimiter
354hi def link sudoersCmndListColon Delimiter
355hi def link sudoersCmndSpecComma Delimiter
356hi def link sudoersCmndSpecColon Delimiter
357hi def link sudoersUserNegationInList Operator
358hi def link sudoersHostNegationInList Operator
359hi def link sudoersCmndNegationInList Operator
360hi def link sudoersUserNegation Operator
361hi def link sudoersHostNegation Operator
362hi def link sudoersUserNegationInSpec Operator
363hi def link sudoersHostNegationInSpec Operator
364hi def link sudoersUserNegationInRunas Operator
365hi def link sudoersCmndNegationInSpec Operator
366hi def link sudoersCommandArgs String
367hi def link sudoersCommandEmpty Special
368hi def link sudoersDefaultEntry Keyword
369hi def link sudoersDefaultTypeAt Special
370hi def link sudoersDefaultTypeColon Special
371hi def link sudoersDefaultTypeGreaterThan Special
372hi def link sudoersBooleanParameter Identifier
373hi def link sudoersIntegerParameter Identifier
374hi def link sudoersStringParameter Identifier
375hi def link sudoersListParameter Identifier
376hi def link sudoersParameterListComma Delimiter
377hi def link sudoersIntegerParameterEquals Operator
378hi def link sudoersStringParameterEquals Operator
379hi def link sudoersListParameterEquals Operator
380hi def link sudoersIntegerValue Number
381hi def link sudoersStringValue String
382hi def link sudoersListValue String
383hi def link sudoersPASSWD Special
Bram Moolenaara9604e62018-07-21 05:56:22 +0200384hi def link sudoersInclude Statement
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000385
386let b:current_syntax = "sudoers"
387
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000388let &cpo = s:cpo_save
389unlet s:cpo_save