From: Todd C. Miller Date: Tue, 7 Aug 2018 16:03:05 +0000 (-0600) Subject: Fix ambiguity when talking about Aliases. We can't use User_Alias X-Git-Tag: SUDO_1_8_24^2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0484e3d6a9a3505745237d68d1ea99eb2ff30f91;p=sudo Fix ambiguity when talking about Aliases. We can't use User_Alias in the grammar as both the definition of the Alias as well as its name. This adds {User,Runas,Host,Cmnd}_Alias_Spec to help differentiate between the name of the alias and its definition. Bug #834 --- diff --git a/doc/sudoers.cat b/doc/sudoers.cat index d99e67432..cbae43db7 100644 --- a/doc/sudoers.cat +++ b/doc/sudoers.cat @@ -244,18 +244,26 @@ SSUUDDOOEERRSS FFIILLEE FFOORRMMAATT There are four kinds of aliases: User_Alias, Runas_Alias, Host_Alias and Cmnd_Alias. - Alias ::= 'User_Alias' User_Alias (':' User_Alias)* | - 'Runas_Alias' Runas_Alias (':' Runas_Alias)* | - 'Host_Alias' Host_Alias (':' Host_Alias)* | - 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)* + Alias ::= 'User_Alias' User_Alias_Spec (':' User_Alias_Spec)* | + 'Runas_Alias' Runas_Alias_Spec (':' Runas_Alias_Spec)* | + 'Host_Alias' Host_Alias_Spec (':' Host_Alias_Spec)* | + 'Cmnd_Alias' Cmnd_Alias_Spec (':' Cmnd_Alias_Spec)* - User_Alias ::= NAME '=' User_List + User_Alias ::= NAME - Runas_Alias ::= NAME '=' Runas_List + User_Alias_Spec ::= User_Alias '=' User_List - Host_Alias ::= NAME '=' Host_List + Runas_Alias ::= NAME - Cmnd_Alias ::= NAME '=' Cmnd_List + Runas_Alias_Spec ::= Runas_Alias '=' Runas_List + + Host_Alias ::= NAME + + Host_Alias_Spec ::= Host_Alias '=' Host_List + + Cmnd_Alias ::= NAME + + Cmnd_Alias_Spec ::= Cmnd_Alias '=' Cmnd_List NAME ::= [A-Z]([A-Z][0-9]_)* @@ -2919,4 +2927,4 @@ DDIISSCCLLAAIIMMEERR file distributed with ssuuddoo or https://www.sudo.ws/license.html for complete details. -Sudo 1.8.24 April 18, 2018 Sudo 1.8.24 +Sudo 1.8.24 August 7, 2018 Sudo 1.8.24 diff --git a/doc/sudoers.man.in b/doc/sudoers.man.in index 974bb8dab..bc2061215 100644 --- a/doc/sudoers.man.in +++ b/doc/sudoers.man.in @@ -20,7 +20,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.TH "SUDOERS" "5" "April 18, 2018" "Sudo @PACKAGE_VERSION@" "File Formats Manual" +.TH "SUDOERS" "5" "August 7, 2018" "Sudo @PACKAGE_VERSION@" "File Formats Manual" .nh .if n .ad l .SH "NAME" @@ -576,18 +576,26 @@ and .nf .sp .RS 0n -Alias ::= 'User_Alias' User_Alias (':' User_Alias)* | - 'Runas_Alias' Runas_Alias (':' Runas_Alias)* | - 'Host_Alias' Host_Alias (':' Host_Alias)* | - 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)* +Alias ::= 'User_Alias' User_Alias_Spec (':' User_Alias_Spec)* | + 'Runas_Alias' Runas_Alias_Spec (':' Runas_Alias_Spec)* | + 'Host_Alias' Host_Alias_Spec (':' Host_Alias_Spec)* | + 'Cmnd_Alias' Cmnd_Alias_Spec (':' Cmnd_Alias_Spec)* -User_Alias ::= NAME '=' User_List +User_Alias ::= NAME -Runas_Alias ::= NAME '=' Runas_List +User_Alias_Spec ::= User_Alias '=' User_List -Host_Alias ::= NAME '=' Host_List +Runas_Alias ::= NAME -Cmnd_Alias ::= NAME '=' Cmnd_List +Runas_Alias_Spec ::= Runas_Alias '=' Runas_List + +Host_Alias ::= NAME + +Host_Alias_Spec ::= Host_Alias '=' Host_List + +Cmnd_Alias ::= NAME + +Cmnd_Alias_Spec ::= Cmnd_Alias '=' Cmnd_List NAME ::= [A-Z]([A-Z][0-9]_)* .RE diff --git a/doc/sudoers.mdoc.in b/doc/sudoers.mdoc.in index 7ba7911d7..7f5684137 100644 --- a/doc/sudoers.mdoc.in +++ b/doc/sudoers.mdoc.in @@ -19,7 +19,7 @@ .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" -.Dd April 18, 2018 +.Dd August 7, 2018 .Dt SUDOERS @mansectform@ .Os Sudo @PACKAGE_VERSION@ .Sh NAME @@ -560,18 +560,26 @@ There are four kinds of aliases: and .Li Cmnd_Alias . .Bd -literal -Alias ::= 'User_Alias' User_Alias (':' User_Alias)* | - 'Runas_Alias' Runas_Alias (':' Runas_Alias)* | - 'Host_Alias' Host_Alias (':' Host_Alias)* | - 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)* +Alias ::= 'User_Alias' User_Alias_Spec (':' User_Alias_Spec)* | + 'Runas_Alias' Runas_Alias_Spec (':' Runas_Alias_Spec)* | + 'Host_Alias' Host_Alias_Spec (':' Host_Alias_Spec)* | + 'Cmnd_Alias' Cmnd_Alias_Spec (':' Cmnd_Alias_Spec)* -User_Alias ::= NAME '=' User_List +User_Alias ::= NAME -Runas_Alias ::= NAME '=' Runas_List +User_Alias_Spec ::= User_Alias '=' User_List -Host_Alias ::= NAME '=' Host_List +Runas_Alias ::= NAME -Cmnd_Alias ::= NAME '=' Cmnd_List +Runas_Alias_Spec ::= Runas_Alias '=' Runas_List + +Host_Alias ::= NAME + +Host_Alias_Spec ::= Host_Alias '=' Host_List + +Cmnd_Alias ::= NAME + +Cmnd_Alias_Spec ::= Cmnd_Alias '=' Cmnd_List NAME ::= [A-Z]([A-Z][0-9]_)* .Ed