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 | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 4 | " Latest Revision: 2011-02-24 |
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 | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 152 | syn keyword sudoersBooleanParameter contained skipwhite skipnl |
| 153 | \ always_set_home |
| 154 | \ authenticate |
| 155 | \ closefrom_override |
| 156 | \ env_editor |
| 157 | \ env_reset |
| 158 | \ fqdn |
| 159 | \ ignore_dot |
| 160 | \ ignore_local_sudoers |
| 161 | \ insults |
| 162 | \ log_host |
| 163 | \ log_year |
| 164 | \ long_otp_prompt |
| 165 | \ mail_always |
| 166 | \ mail_badpass |
| 167 | \ mail_no_host |
| 168 | \ mail_no_perms |
| 169 | \ mail_no_user |
| 170 | \ noexec |
| 171 | \ path_info |
| 172 | \ passprompt_override |
| 173 | \ preserve_groups |
| 174 | \ requiretty |
| 175 | \ root_sudo |
| 176 | \ rootpw |
| 177 | \ runaspw |
| 178 | \ set_home |
| 179 | \ set_logname |
| 180 | \ setenv |
| 181 | \ shell_noargs |
| 182 | \ stay_setuid |
| 183 | \ targetpw |
| 184 | \ tty_tickets |
| 185 | \ visiblepw |
| 186 | |
| 187 | syn keyword sudoersIntegerParameter contained |
| 188 | \ nextgroup=sudoersIntegerParameterEquals |
| 189 | \ skipwhite skipnl |
| 190 | \ closefrom |
| 191 | \ passwd_tries |
| 192 | \ loglinelen |
| 193 | \ passwd_timeout |
| 194 | \ timestamp_timeout |
| 195 | \ umask |
| 196 | |
| 197 | syn keyword sudoersStringParameter contained |
| 198 | \ nextgroup=sudoersStringParameterEquals |
| 199 | \ skipwhite skipnl |
| 200 | \ badpass_message |
| 201 | \ editor |
| 202 | \ mailsub |
| 203 | \ noexec_file |
| 204 | \ passprompt |
| 205 | \ runas_default |
| 206 | \ syslog_badpri |
| 207 | \ syslog_goodpri |
| 208 | \ sudoers_locale |
| 209 | \ timestampdir |
| 210 | \ timestampowner |
| 211 | \ askpass |
| 212 | \ env_file |
| 213 | \ exempt_group |
| 214 | \ lecture |
| 215 | \ lecture_file |
| 216 | \ listpw |
| 217 | \ logfile |
| 218 | \ mailerflags |
| 219 | \ mailerpath |
| 220 | \ mailfrom |
| 221 | \ mailto |
| 222 | \ secure_path |
| 223 | \ syslog |
| 224 | \ verifypw |
| 225 | |
| 226 | syn keyword sudoersListParameter contained |
| 227 | \ nextgroup=sudoersListParameterEquals |
| 228 | \ skipwhite skipnl |
| 229 | \ env_check |
| 230 | \ env_delete |
| 231 | \ env_keep |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 232 | |
| 233 | syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl |
| 234 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 235 | syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 236 | |
| 237 | syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl |
| 238 | syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 239 | syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 240 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 241 | syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 242 | syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 243 | syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl |
| 244 | syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 245 | syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 246 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 247 | syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 248 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 249 | hi def link sudoersSpecEquals Operator |
| 250 | hi def link sudoersTodo Todo |
| 251 | hi def link sudoersComment Comment |
| 252 | hi def link sudoersAlias Keyword |
| 253 | hi def link sudoersUserAlias Identifier |
| 254 | hi def link sudoersUserNameInList String |
| 255 | hi def link sudoersUIDInList Number |
| 256 | hi def link sudoersGroupInList PreProc |
| 257 | hi def link sudoersUserNetgroupInList PreProc |
| 258 | hi def link sudoersUserAliasInList PreProc |
| 259 | hi def link sudoersUserName String |
| 260 | hi def link sudoersUID Number |
| 261 | hi def link sudoersGroup PreProc |
| 262 | hi def link sudoersUserNetgroup PreProc |
| 263 | hi def link sudoersUserAliasRef PreProc |
| 264 | hi def link sudoersUserNameInSpec String |
| 265 | hi def link sudoersUIDInSpec Number |
| 266 | hi def link sudoersGroupInSpec PreProc |
| 267 | hi def link sudoersUserNetgroupInSpec PreProc |
| 268 | hi def link sudoersUserAliasInSpec PreProc |
| 269 | hi def link sudoersUserNameInRunas String |
| 270 | hi def link sudoersUIDInRunas Number |
| 271 | hi def link sudoersGroupInRunas PreProc |
| 272 | hi def link sudoersUserNetgroupInRunas PreProc |
| 273 | hi def link sudoersUserAliasInRunas PreProc |
| 274 | hi def link sudoersHostAlias Identifier |
| 275 | hi def link sudoersHostNameInList String |
| 276 | hi def link sudoersIPAddrInList Number |
| 277 | hi def link sudoersNetworkInList Number |
| 278 | hi def link sudoersHostNetgroupInList PreProc |
| 279 | hi def link sudoersHostAliasInList PreProc |
| 280 | hi def link sudoersHostName String |
| 281 | hi def link sudoersIPAddr Number |
| 282 | hi def link sudoersNetwork Number |
| 283 | hi def link sudoersHostNetgroup PreProc |
| 284 | hi def link sudoersHostAliasRef PreProc |
| 285 | hi def link sudoersHostNameInSpec String |
| 286 | hi def link sudoersIPAddrInSpec Number |
| 287 | hi def link sudoersNetworkInSpec Number |
| 288 | hi def link sudoersHostNetgroupInSpec PreProc |
| 289 | hi def link sudoersHostAliasInSpec PreProc |
| 290 | hi def link sudoersCmndAlias Identifier |
| 291 | hi def link sudoersCmndNameInList String |
| 292 | hi def link sudoersCmndAliasInList PreProc |
| 293 | hi def link sudoersCmndNameInSpec String |
| 294 | hi def link sudoersCmndAliasInSpec PreProc |
| 295 | hi def link sudoersUserAliasEquals Operator |
| 296 | hi def link sudoersUserListComma Delimiter |
| 297 | hi def link sudoersUserListColon Delimiter |
| 298 | hi def link sudoersUserSpecComma Delimiter |
| 299 | hi def link sudoersUserRunasBegin Delimiter |
| 300 | hi def link sudoersUserRunasComma Delimiter |
| 301 | hi def link sudoersUserRunasEnd Delimiter |
| 302 | hi def link sudoersHostAliasEquals Operator |
| 303 | hi def link sudoersHostListComma Delimiter |
| 304 | hi def link sudoersHostListColon Delimiter |
| 305 | hi def link sudoersHostSpecComma Delimiter |
| 306 | hi def link sudoersCmndAliasEquals Operator |
| 307 | hi def link sudoersCmndListComma Delimiter |
| 308 | hi def link sudoersCmndListColon Delimiter |
| 309 | hi def link sudoersCmndSpecComma Delimiter |
| 310 | hi def link sudoersCmndSpecColon Delimiter |
| 311 | hi def link sudoersUserNegationInList Operator |
| 312 | hi def link sudoersHostNegationInList Operator |
| 313 | hi def link sudoersCmndNegationInList Operator |
| 314 | hi def link sudoersUserNegation Operator |
| 315 | hi def link sudoersHostNegation Operator |
| 316 | hi def link sudoersUserNegationInSpec Operator |
| 317 | hi def link sudoersHostNegationInSpec Operator |
| 318 | hi def link sudoersUserNegationInRunas Operator |
| 319 | hi def link sudoersCmndNegationInSpec Operator |
| 320 | hi def link sudoersCommandArgs String |
| 321 | hi def link sudoersCommandEmpty Special |
| 322 | hi def link sudoersDefaultEntry Keyword |
| 323 | hi def link sudoersDefaultTypeAt Special |
| 324 | hi def link sudoersDefaultTypeColon Special |
| 325 | hi def link sudoersDefaultTypeGreaterThan Special |
| 326 | hi def link sudoersBooleanParameter Identifier |
| 327 | hi def link sudoersIntegerParameter Identifier |
| 328 | hi def link sudoersStringParameter Identifier |
| 329 | hi def link sudoersListParameter Identifier |
| 330 | hi def link sudoersParameterListComma Delimiter |
| 331 | hi def link sudoersIntegerParameterEquals Operator |
| 332 | hi def link sudoersStringParameterEquals Operator |
| 333 | hi def link sudoersListParameterEquals Operator |
| 334 | hi def link sudoersIntegerValue Number |
| 335 | hi def link sudoersStringValue String |
| 336 | hi def link sudoersListValue String |
| 337 | hi def link sudoersPASSWD Special |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 338 | |
| 339 | let b:current_syntax = "sudoers" |
| 340 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 341 | let &cpo = s:cpo_save |
| 342 | unlet s:cpo_save |