Document double escaping of backslashes. Bug #961.

This commit is contained in:
Todd C. Miller
2021-03-03 15:49:18 -07:00
parent 06beb6f064
commit 2759920b86
2 changed files with 32 additions and 2 deletions

View File

@@ -25,7 +25,7 @@
.nr BA @BAMAN@ .nr BA @BAMAN@
.nr LC @LCMAN@ .nr LC @LCMAN@
.nr PS @PSMAN@ .nr PS @PSMAN@
.TH "SUDOERS" "@mansectform@" "February 16, 2020" "Sudo @PACKAGE_VERSION@" "File Formats Manual" .TH "SUDOERS" "@mansectform@" "March 3, 2020" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.nh .nh
.if n .ad l .if n .ad l
.SH "NAME" .SH "NAME"
@@ -1111,6 +1111,21 @@ when they contain multiple words.
Special characters may be escaped with a backslash Special characters may be escaped with a backslash
(\(oq\e\(cq). (\(oq\e\(cq).
.PP .PP
To include a literal backslash character in a command line argument
you must escape the backslash twice.
For example, to match
\(oq\en\(cq
as part of a command line argument, you must use
\(oq\e\e\e\en\(cq
in the
\fIsudoers\fR
file.
This is due to there being two levels of escaping, one in the
\fIsudoers\fR
parser itself and another when command line arguments are matched by the
fnmatch(3)
function.
.PP
Lists have two additional assignment operators, Lists have two additional assignment operators,
\fR+=\fR \fR+=\fR
and and

View File

@@ -24,7 +24,7 @@
.nr BA @BAMAN@ .nr BA @BAMAN@
.nr LC @LCMAN@ .nr LC @LCMAN@
.nr PS @PSMAN@ .nr PS @PSMAN@
.Dd February 16, 2020 .Dd March 3, 2020
.Dt SUDOERS @mansectform@ .Dt SUDOERS @mansectform@
.Os Sudo @PACKAGE_VERSION@ .Os Sudo @PACKAGE_VERSION@
.Sh NAME .Sh NAME
@@ -1065,6 +1065,21 @@ when they contain multiple words.
Special characters may be escaped with a backslash Special characters may be escaped with a backslash
.Pq Ql \e . .Pq Ql \e .
.Pp .Pp
To include a literal backslash character in a command line argument
you must escape the backslash twice.
For example, to match
.Ql \en
as part of a command line argument, you must use
.Ql \e\e\e\en
in the
.Em sudoers
file.
This is due to there being two levels of escaping, one in the
.Em sudoers
parser itself and another when command line arguments are matched by the
.Xr fnmatch 3
function.
.Pp
Lists have two additional assignment operators, Lists have two additional assignment operators,
.Li += .Li +=
and and