Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 2 | " Language: sudoers(5) configuration files |
Bram Moolenaar | 57657d8 | 2006-04-21 22:12:41 +0000 | [diff] [blame] | 3 | " Maintainer: Nikolai Weibull <now@bitwi.se> |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 4 | " Latest Revision: 2007-08-02 |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 5 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 6 | if exists("b:current_syntax") |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 7 | finish |
| 8 | endif |
| 9 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 10 | let s:cpo_save = &cpo |
| 11 | set cpo&vim |
| 12 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 13 | " TODO: instead of 'skipnl', we would like to match a specific group that would |
| 14 | " match \\$ and then continue with the nextgroup, actually, the skipnl doesn't |
| 15 | " work... |
| 16 | " TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!) |
| 17 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 18 | syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite |
| 19 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 20 | syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 21 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 22 | syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASSWD,@sudoersCmndInSpec |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 23 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 24 | syn keyword sudoersTodo contained TODO FIXME XXX NOTE |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 25 | |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 26 | syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 27 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 28 | syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl |
| 29 | syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl |
| 30 | syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 31 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 32 | syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl |
| 33 | syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 34 | syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 35 | syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 36 | syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 37 | syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 38 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 39 | syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 40 | syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 41 | syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 42 | syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 43 | syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 44 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 45 | syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 46 | syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 47 | syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 48 | syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 49 | syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 50 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 51 | syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 52 | syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 53 | syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 54 | syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 55 | syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 56 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 57 | syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl |
| 58 | syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl |
| 59 | syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 60 | syn match sudoersNetworkInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostList skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 61 | syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl |
| 62 | syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 63 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 64 | syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 65 | syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl |
| 66 | syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl |
| 67 | syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 68 | syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 69 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 70 | syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl |
| 71 | syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 72 | syn match sudoersNetworkInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostSpec skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 73 | syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl |
| 74 | syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 75 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 76 | syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 77 | syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 78 | syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 79 | |
| 80 | syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 81 | syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 82 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 83 | syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl |
| 84 | syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl |
| 85 | syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl |
| 86 | syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 87 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 88 | syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl |
| 89 | syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 90 | |
| 91 | syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 92 | syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl |
| 93 | syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersPASSWD,@sudoersCmndInSpec skipwhite skipnl |
| 94 | syn cluster sudoersUserRunas contains=sudoersUserRunasComma,@sudoersUserInRunas,sudoersUserRunasEnd |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 95 | |
| 96 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 97 | syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl |
| 98 | syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl |
| 99 | syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl |
| 100 | syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 101 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 102 | syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl |
| 103 | syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 104 | |
| 105 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 106 | syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl |
| 107 | syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl |
| 108 | syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl |
| 109 | syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 110 | |
| 111 | syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 112 | syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl |
| 113 | syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 114 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 115 | syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList |
| 116 | syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList |
| 117 | syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 118 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 119 | syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef |
| 120 | syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 121 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 122 | syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec |
| 123 | syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec |
| 124 | syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas |
| 125 | syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 126 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 127 | syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl |
| 128 | syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl |
| 129 | syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl |
| 130 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 131 | syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl |
| 132 | syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 133 | |
| 134 | syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl |
| 135 | syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl |
| 136 | syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl |
| 137 | syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl |
| 138 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 139 | syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite |
| 140 | syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 141 | |
| 142 | syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite |
| 143 | syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl |
| 144 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 145 | syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl |
| 146 | syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl |
| 147 | syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 148 | syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl |
| 149 | |
| 150 | " TODO: could also deal with special characters here |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 151 | syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 152 | 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 |
| 153 | syn keyword sudoersIntegerParameter contained passwd_tries loglinelen timestamp_timeout passwd_timeout umask nextgroup=sudoersIntegerParameterEquals skipwhite skipnl |
| 154 | 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 |
| 155 | syn keyword sudoersListParameter contained env_check env_delete env_keep nextgroup=sudoersListParameterEquals skipwhite skipnl |
| 156 | |
| 157 | syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl |
| 158 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 159 | syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 160 | |
| 161 | syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl |
| 162 | syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 163 | syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 164 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 165 | syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 166 | syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 167 | syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl |
| 168 | syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 169 | syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 170 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 171 | syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 172 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 173 | hi def link sudoersSpecEquals Operator |
| 174 | hi def link sudoersTodo Todo |
| 175 | hi def link sudoersComment Comment |
| 176 | hi def link sudoersAlias Keyword |
| 177 | hi def link sudoersUserAlias Identifier |
| 178 | hi def link sudoersUserNameInList String |
| 179 | hi def link sudoersUIDInList Number |
| 180 | hi def link sudoersGroupInList PreProc |
| 181 | hi def link sudoersUserNetgroupInList PreProc |
| 182 | hi def link sudoersUserAliasInList PreProc |
| 183 | hi def link sudoersUserName String |
| 184 | hi def link sudoersUID Number |
| 185 | hi def link sudoersGroup PreProc |
| 186 | hi def link sudoersUserNetgroup PreProc |
| 187 | hi def link sudoersUserAliasRef PreProc |
| 188 | hi def link sudoersUserNameInSpec String |
| 189 | hi def link sudoersUIDInSpec Number |
| 190 | hi def link sudoersGroupInSpec PreProc |
| 191 | hi def link sudoersUserNetgroupInSpec PreProc |
| 192 | hi def link sudoersUserAliasInSpec PreProc |
| 193 | hi def link sudoersUserNameInRunas String |
| 194 | hi def link sudoersUIDInRunas Number |
| 195 | hi def link sudoersGroupInRunas PreProc |
| 196 | hi def link sudoersUserNetgroupInRunas PreProc |
| 197 | hi def link sudoersUserAliasInRunas PreProc |
| 198 | hi def link sudoersHostAlias Identifier |
| 199 | hi def link sudoersHostNameInList String |
| 200 | hi def link sudoersIPAddrInList Number |
| 201 | hi def link sudoersNetworkInList Number |
| 202 | hi def link sudoersHostNetgroupInList PreProc |
| 203 | hi def link sudoersHostAliasInList PreProc |
| 204 | hi def link sudoersHostName String |
| 205 | hi def link sudoersIPAddr Number |
| 206 | hi def link sudoersNetwork Number |
| 207 | hi def link sudoersHostNetgroup PreProc |
| 208 | hi def link sudoersHostAliasRef PreProc |
| 209 | hi def link sudoersHostNameInSpec String |
| 210 | hi def link sudoersIPAddrInSpec Number |
| 211 | hi def link sudoersNetworkInSpec Number |
| 212 | hi def link sudoersHostNetgroupInSpec PreProc |
| 213 | hi def link sudoersHostAliasInSpec PreProc |
| 214 | hi def link sudoersCmndAlias Identifier |
| 215 | hi def link sudoersCmndNameInList String |
| 216 | hi def link sudoersCmndAliasInList PreProc |
| 217 | hi def link sudoersCmndNameInSpec String |
| 218 | hi def link sudoersCmndAliasInSpec PreProc |
| 219 | hi def link sudoersUserAliasEquals Operator |
| 220 | hi def link sudoersUserListComma Delimiter |
| 221 | hi def link sudoersUserListColon Delimiter |
| 222 | hi def link sudoersUserSpecComma Delimiter |
| 223 | hi def link sudoersUserRunasBegin Delimiter |
| 224 | hi def link sudoersUserRunasComma Delimiter |
| 225 | hi def link sudoersUserRunasEnd Delimiter |
| 226 | hi def link sudoersHostAliasEquals Operator |
| 227 | hi def link sudoersHostListComma Delimiter |
| 228 | hi def link sudoersHostListColon Delimiter |
| 229 | hi def link sudoersHostSpecComma Delimiter |
| 230 | hi def link sudoersCmndAliasEquals Operator |
| 231 | hi def link sudoersCmndListComma Delimiter |
| 232 | hi def link sudoersCmndListColon Delimiter |
| 233 | hi def link sudoersCmndSpecComma Delimiter |
| 234 | hi def link sudoersCmndSpecColon Delimiter |
| 235 | hi def link sudoersUserNegationInList Operator |
| 236 | hi def link sudoersHostNegationInList Operator |
| 237 | hi def link sudoersCmndNegationInList Operator |
| 238 | hi def link sudoersUserNegation Operator |
| 239 | hi def link sudoersHostNegation Operator |
| 240 | hi def link sudoersUserNegationInSpec Operator |
| 241 | hi def link sudoersHostNegationInSpec Operator |
| 242 | hi def link sudoersUserNegationInRunas Operator |
| 243 | hi def link sudoersCmndNegationInSpec Operator |
| 244 | hi def link sudoersCommandArgs String |
| 245 | hi def link sudoersCommandEmpty Special |
| 246 | hi def link sudoersDefaultEntry Keyword |
| 247 | hi def link sudoersDefaultTypeAt Special |
| 248 | hi def link sudoersDefaultTypeColon Special |
| 249 | hi def link sudoersDefaultTypeGreaterThan Special |
| 250 | hi def link sudoersBooleanParameter Identifier |
| 251 | hi def link sudoersIntegerParameter Identifier |
| 252 | hi def link sudoersStringParameter Identifier |
| 253 | hi def link sudoersListParameter Identifier |
| 254 | hi def link sudoersParameterListComma Delimiter |
| 255 | hi def link sudoersIntegerParameterEquals Operator |
| 256 | hi def link sudoersStringParameterEquals Operator |
| 257 | hi def link sudoersListParameterEquals Operator |
| 258 | hi def link sudoersIntegerValue Number |
| 259 | hi def link sudoersStringValue String |
| 260 | hi def link sudoersListValue String |
| 261 | hi def link sudoersPASSWD Special |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 262 | |
| 263 | let b:current_syntax = "sudoers" |
| 264 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 265 | let &cpo = s:cpo_save |
| 266 | unlet s:cpo_save |