blob: 4cdf598be02f8b02b58853e09ecec7c86a545623 [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
Bram Moolenaardad44732021-03-31 20:07:33 +02003" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com )
Bram Moolenaar214641f2017-03-05 17:04:09 +01004" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Christian Brabandtbd69b392024-09-02 09:53:53 +02005" Latest Revision: 2024 Sep 02
Bram Moolenaara9604e62018-07-21 05:56:22 +02006" Recent Changes: Support for #include and #includedir.
Bram Moolenaarfc65cab2018-08-28 22:58:02 +02007" Added many new options (Samuel D. Leslie)
Christian Brabandtbd69b392024-09-02 09:53:53 +02008" Update allowed Tag_Spec Runas_Spec syntax items
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00009
Bram Moolenaar42eeac32005-06-29 22:40:58 +000010if exists("b:current_syntax")
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000011 finish
12endif
13
Bram Moolenaar42eeac32005-06-29 22:40:58 +000014let s:cpo_save = &cpo
15set cpo&vim
16
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000017" TODO: instead of 'skipnl', we would like to match a specific group that would
18" match \\$ and then continue with the nextgroup, actually, the skipnl doesn't
19" work...
20" TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!)
21
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000022syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite
23
Bram Moolenaar42eeac32005-06-29 22:40:58 +000024syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000025
Christian Brabandtbd69b392024-09-02 09:53:53 +020026syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersTagSpec,@sudoersCmndInSpec
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000027
Bram Moolenaar42eeac32005-06-29 22:40:58 +000028syn keyword sudoersTodo contained TODO FIXME XXX NOTE
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000029
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000030syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo
Bram Moolenaardad44732021-03-31 20:07:33 +020031syn region sudoersInclude display oneline start='[#@]\%(include\|includedir\)\>' end='$'
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000032
Bram Moolenaar42eeac32005-06-29 22:40:58 +000033syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl
34syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl
35syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000036
Bram Moolenaar42eeac32005-06-29 22:40:58 +000037syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl
38syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
39syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl
40syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
41syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl
42syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000043
Bram Moolenaar42eeac32005-06-29 22:40:58 +000044syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
45syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl
46syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
47syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
48syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000049
Bram Moolenaar42eeac32005-06-29 22:40:58 +000050syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
51syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
52syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
53syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl
54syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000055
Bram Moolenaar42eeac32005-06-29 22:40:58 +000056syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
57syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
58syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
59syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl
60syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000061
Bram Moolenaar42eeac32005-06-29 22:40:58 +000062syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl
63syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
64syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000065syn 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 +000066syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl
67syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000068
Bram Moolenaar42eeac32005-06-29 22:40:58 +000069syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
70syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl
71syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl
72syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl
73syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000074
Bram Moolenaar42eeac32005-06-29 22:40:58 +000075syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
76syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000077syn 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 +000078syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl
79syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000080
Bram Moolenaar42eeac32005-06-29 22:40:58 +000081syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000082syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite
Bram Moolenaar42eeac32005-06-29 22:40:58 +000083syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000084
85syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite
Bram Moolenaar42eeac32005-06-29 22:40:58 +000086syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000087
Bram Moolenaar42eeac32005-06-29 22:40:58 +000088syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl
89syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl
90syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl
91syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000092
Bram Moolenaar42eeac32005-06-29 22:40:58 +000093syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl
94syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000095
Christian Brabandtbd69b392024-09-02 09:53:53 +020096syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas,sudoersUserRunasColon skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +000097syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl
Christian Brabandtbd69b392024-09-02 09:53:53 +020098syn match sudoersUserRunasColon contained ':' nextgroup=@sudoersUserInRunas skipwhite skipnl
99syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersTagSpec,@sudoersCmndInSpec skipwhite skipnl
100syn cluster sudoersUserRunas contains=sudoersUserRunasComma,sudoersUserRunasColon,@sudoersUserInRunas,sudoersUserRunasEnd
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000101
102
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000103syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl
104syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl
105syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl
106syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000107
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000108syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl
109syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000110
111
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000112syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl
113syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl
114syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl
115syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000116
117syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000118syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl
119syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000120
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000121syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList
122syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList
123syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000124
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000125syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef
126syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000127
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000128syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec
129syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec
130syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas
131syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000132
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000133syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl
134syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl
135syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl
136
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000137syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl
138syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000139
140syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl
141syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl
142syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl
143syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl
144
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000145syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite
146syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000147
148syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite
149syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl
150
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000151syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl
152syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl
153syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000154syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl
155
156" TODO: could also deal with special characters here
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000157syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl
Bram Moolenaar00654022011-02-25 14:42:19 +0100158syn keyword sudoersBooleanParameter contained skipwhite skipnl
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200159 \ always_query_group_plugin
Bram Moolenaar00654022011-02-25 14:42:19 +0100160 \ always_set_home
161 \ authenticate
162 \ closefrom_override
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200163 \ compress_io
Bram Moolenaar00654022011-02-25 14:42:19 +0100164 \ env_editor
165 \ env_reset
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200166 \ exec_background
167 \ fast_glob
Bram Moolenaar00654022011-02-25 14:42:19 +0100168 \ fqdn
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200169 \ ignore_audit_errors
Bram Moolenaar00654022011-02-25 14:42:19 +0100170 \ ignore_dot
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200171 \ ignore_iolog_errors
Bram Moolenaar00654022011-02-25 14:42:19 +0100172 \ ignore_local_sudoers
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200173 \ ignore_logfile_errors
174 \ ignore_unknown_defaults
Bram Moolenaar00654022011-02-25 14:42:19 +0100175 \ insults
176 \ log_host
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200177 \ log_input
178 \ log_output
Bram Moolenaar00654022011-02-25 14:42:19 +0100179 \ log_year
180 \ long_otp_prompt
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200181 \ mail_all_cmnds
Bram Moolenaar00654022011-02-25 14:42:19 +0100182 \ mail_always
183 \ mail_badpass
184 \ mail_no_host
185 \ mail_no_perms
186 \ mail_no_user
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200187 \ match_group_by_gid
188 \ netgroup_tuple
Bram Moolenaar00654022011-02-25 14:42:19 +0100189 \ noexec
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200190 \ pam_session
191 \ pam_setcred
Bram Moolenaar00654022011-02-25 14:42:19 +0100192 \ passprompt_override
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200193 \ path_info
Bram Moolenaar00654022011-02-25 14:42:19 +0100194 \ preserve_groups
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200195 \ pwfeedback
Bram Moolenaar00654022011-02-25 14:42:19 +0100196 \ requiretty
197 \ root_sudo
198 \ rootpw
199 \ runaspw
200 \ set_home
201 \ set_logname
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200202 \ set_utmp
Bram Moolenaar00654022011-02-25 14:42:19 +0100203 \ setenv
204 \ shell_noargs
205 \ stay_setuid
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200206 \ sudoedit_checkdir
Bram Moolenaardad44732021-03-31 20:07:33 +0200207 \ sudoedit_follow
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200208 \ syslog_pid
Bram Moolenaar00654022011-02-25 14:42:19 +0100209 \ targetpw
210 \ tty_tickets
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200211 \ umask_override
212 \ use_netgroups
213 \ use_pty
214 \ user_command_timeouts
215 \ utmp_runas
Bram Moolenaar00654022011-02-25 14:42:19 +0100216 \ visiblepw
217
218syn keyword sudoersIntegerParameter contained
219 \ nextgroup=sudoersIntegerParameterEquals
220 \ skipwhite skipnl
221 \ closefrom
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200222 \ command_timeout
Bram Moolenaar00654022011-02-25 14:42:19 +0100223 \ loglinelen
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200224 \ maxseq
Bram Moolenaar00654022011-02-25 14:42:19 +0100225 \ passwd_timeout
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200226 \ passwd_tries
227 \ syslog_maxlen
Bram Moolenaar00654022011-02-25 14:42:19 +0100228 \ timestamp_timeout
229 \ umask
230
231syn keyword sudoersStringParameter contained
232 \ nextgroup=sudoersStringParameterEquals
233 \ skipwhite skipnl
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200234 \ askpass
Bram Moolenaar00654022011-02-25 14:42:19 +0100235 \ badpass_message
236 \ editor
Bram Moolenaar00654022011-02-25 14:42:19 +0100237 \ env_file
238 \ exempt_group
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200239 \ fdexec
240 \ group_plugin
241 \ iolog_dir
242 \ iolog_file
243 \ iolog_flush
244 \ iolog_group
245 \ iolog_mode
246 \ iolog_user
Bram Moolenaar00654022011-02-25 14:42:19 +0100247 \ lecture
248 \ lecture_file
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200249 \ lecture_status_dir
Bram Moolenaar00654022011-02-25 14:42:19 +0100250 \ listpw
251 \ logfile
252 \ mailerflags
253 \ mailerpath
254 \ mailfrom
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200255 \ mailsub
Bram Moolenaar00654022011-02-25 14:42:19 +0100256 \ mailto
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200257 \ noexec_file
258 \ pam_login_service
259 \ pam_service
260 \ passprompt
261 \ restricted_env_file
262 \ role
263 \ runas_default
Bram Moolenaar00654022011-02-25 14:42:19 +0100264 \ secure_path
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200265 \ sudoers_locale
Bram Moolenaar00654022011-02-25 14:42:19 +0100266 \ syslog
Bram Moolenaarfc65cab2018-08-28 22:58:02 +0200267 \ syslog_badpri
268 \ syslog_goodpri
269 \ timestamp_type
270 \ timestampdir
271 \ timestampowner
272 \ type
Bram Moolenaar00654022011-02-25 14:42:19 +0100273 \ verifypw
274
275syn keyword sudoersListParameter contained
276 \ nextgroup=sudoersListParameterEquals
277 \ skipwhite skipnl
278 \ env_check
279 \ env_delete
280 \ env_keep
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000281
282syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl
283
Bram Moolenaar446cb832008-06-24 21:56:24 +0000284syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000285
286syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl
287syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000288syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000289
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000290syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl
291syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
292syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
293syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl
294syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000295
Christian Brabandtbd69b392024-09-02 09:53:53 +0200296syn match sudoersTagSpec contained '\%(NO\)\=\%(EXEC\|FOLLOW\|LOG_\%(INPUT\|OUTPUT\)\|MAIL\|INTERCEPT\|PASSWD\|SETENV\):' nextgroup=sudoersTagSpec,@sudoersCmndInSpec skipwhite
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000297
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000298hi def link sudoersSpecEquals Operator
299hi def link sudoersTodo Todo
300hi def link sudoersComment Comment
301hi def link sudoersAlias Keyword
302hi def link sudoersUserAlias Identifier
303hi def link sudoersUserNameInList String
304hi def link sudoersUIDInList Number
305hi def link sudoersGroupInList PreProc
306hi def link sudoersUserNetgroupInList PreProc
307hi def link sudoersUserAliasInList PreProc
308hi def link sudoersUserName String
309hi def link sudoersUID Number
310hi def link sudoersGroup PreProc
311hi def link sudoersUserNetgroup PreProc
312hi def link sudoersUserAliasRef PreProc
313hi def link sudoersUserNameInSpec String
314hi def link sudoersUIDInSpec Number
315hi def link sudoersGroupInSpec PreProc
316hi def link sudoersUserNetgroupInSpec PreProc
317hi def link sudoersUserAliasInSpec PreProc
318hi def link sudoersUserNameInRunas String
319hi def link sudoersUIDInRunas Number
320hi def link sudoersGroupInRunas PreProc
321hi def link sudoersUserNetgroupInRunas PreProc
322hi def link sudoersUserAliasInRunas PreProc
323hi def link sudoersHostAlias Identifier
324hi def link sudoersHostNameInList String
325hi def link sudoersIPAddrInList Number
326hi def link sudoersNetworkInList Number
327hi def link sudoersHostNetgroupInList PreProc
328hi def link sudoersHostAliasInList PreProc
329hi def link sudoersHostName String
330hi def link sudoersIPAddr Number
331hi def link sudoersNetwork Number
332hi def link sudoersHostNetgroup PreProc
333hi def link sudoersHostAliasRef PreProc
334hi def link sudoersHostNameInSpec String
335hi def link sudoersIPAddrInSpec Number
336hi def link sudoersNetworkInSpec Number
337hi def link sudoersHostNetgroupInSpec PreProc
338hi def link sudoersHostAliasInSpec PreProc
339hi def link sudoersCmndAlias Identifier
340hi def link sudoersCmndNameInList String
341hi def link sudoersCmndAliasInList PreProc
342hi def link sudoersCmndNameInSpec String
343hi def link sudoersCmndAliasInSpec PreProc
344hi def link sudoersUserAliasEquals Operator
345hi def link sudoersUserListComma Delimiter
346hi def link sudoersUserListColon Delimiter
347hi def link sudoersUserSpecComma Delimiter
348hi def link sudoersUserRunasBegin Delimiter
349hi def link sudoersUserRunasComma Delimiter
Christian Brabandtbd69b392024-09-02 09:53:53 +0200350hi def link sudoersUserRunasColon Delimiter
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000351hi def link sudoersUserRunasEnd Delimiter
352hi def link sudoersHostAliasEquals Operator
353hi def link sudoersHostListComma Delimiter
354hi def link sudoersHostListColon Delimiter
355hi def link sudoersHostSpecComma Delimiter
356hi def link sudoersCmndAliasEquals Operator
357hi def link sudoersCmndListComma Delimiter
358hi def link sudoersCmndListColon Delimiter
359hi def link sudoersCmndSpecComma Delimiter
360hi def link sudoersCmndSpecColon Delimiter
361hi def link sudoersUserNegationInList Operator
362hi def link sudoersHostNegationInList Operator
363hi def link sudoersCmndNegationInList Operator
364hi def link sudoersUserNegation Operator
365hi def link sudoersHostNegation Operator
366hi def link sudoersUserNegationInSpec Operator
367hi def link sudoersHostNegationInSpec Operator
368hi def link sudoersUserNegationInRunas Operator
369hi def link sudoersCmndNegationInSpec Operator
370hi def link sudoersCommandArgs String
371hi def link sudoersCommandEmpty Special
372hi def link sudoersDefaultEntry Keyword
373hi def link sudoersDefaultTypeAt Special
374hi def link sudoersDefaultTypeColon Special
375hi def link sudoersDefaultTypeGreaterThan Special
376hi def link sudoersBooleanParameter Identifier
377hi def link sudoersIntegerParameter Identifier
378hi def link sudoersStringParameter Identifier
379hi def link sudoersListParameter Identifier
380hi def link sudoersParameterListComma Delimiter
381hi def link sudoersIntegerParameterEquals Operator
382hi def link sudoersStringParameterEquals Operator
383hi def link sudoersListParameterEquals Operator
384hi def link sudoersIntegerValue Number
385hi def link sudoersStringValue String
386hi def link sudoersListValue String
Christian Brabandtbd69b392024-09-02 09:53:53 +0200387hi def link sudoersTagSpec Special
Bram Moolenaara9604e62018-07-21 05:56:22 +0200388hi def link sudoersInclude Statement
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000389
390let b:current_syntax = "sudoers"
391
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000392let &cpo = s:cpo_save
393unlet s:cpo_save