Document the failings of the passwd example on GNU systems.
Bug #691
Would match any file name beginning with a letter.
Note that a forward slash (`/') will n\bno\bot\bt be matched by wildcards used in
- the path name. This is to make a path like:
+ the file name portion of the command. This is to make a path like:
/usr/bin/*
matched by wildcards since command line arguments may contain arbitrary
strings and not just path names.
- Wildcards in command line arguments should be used with care. Because
- command line arguments are matched as a single, concatenated string, a
- wildcard such as `?' or `*' can match multiple words. For example, while
- a sudoers entry like:
+ W\bWi\bil\bld\bdc\bca\bar\brd\bds\bs i\bin\bn c\bco\bom\bmm\bma\ban\bnd\bd l\bli\bin\bne\be a\bar\brg\bgu\bum\bme\ben\bnt\bts\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be u\bus\bse\bed\bd w\bwi\bit\bth\bh c\bca\bar\bre\be.\b.
+ Command line arguments are matched as a single, concatenated string.
+ This mean a wildcard such as `?' or `*' will match _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be words. For
+ example, while a sudoers entry like:
%operator ALL = /bin/cat /var/log/messages*
with any group in the _\bA_\bD_\bM_\bI_\bN_\bG_\bR_\bP Runas_Alias (the a\bad\bdm\bm and o\bop\bpe\ber\br groups).
The user p\bpe\bet\bte\be is allowed to change anyone's password except for root on
- the _\bH_\bP_\bP_\bA machines. Note that this assumes passwd(1) does not take
- multiple user names on the command line.
+ the _\bH_\bP_\bP_\bA machines. Because command line arguments are matched as a
+ single, concatenated string, the `*' wildcard will match _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be words.
+ This example assumes that passwd(1) does not take multiple user names on
+ the command line. Note that on GNU systems, options to passwd(1) may be
+ specified after the user argument. As a result, this rule will also
+ allow:
+
+ passwd username --expire
+
+ which may not be desirable.
bob SPARC = (OP) ALL : SGI = (OP) ALL
will
\fBnot\fR
be matched by
-wildcards used in the path name.
+wildcards used in the file name portion of the command.
This is to make a path like:
.nf
.sp
get matched by wildcards since command line arguments may contain
arbitrary strings and not just path names.
.PP
-Wildcards in command line arguments should be used with care.
-Because command line arguments are matched as a single, concatenated
-string, a wildcard such as
+\fBWildcards in command line arguments should be used with care.\fR
+.br
+Command line arguments are matched as a single, concatenated string.
+This mean a wildcard such as
\(oq\&?\(cq
or
\(oq*\(cq
-can match multiple words.
+will match
+\fImultiple\fR
+words.
For example, while a sudoers entry like:
.nf
.sp
root on the
\fIHPPA\fR
machines.
-Note that this assumes
+Because command line arguments are matched as a single,
+concatenated string, the
+\(oq*\(cq
+wildcard will match
+\fImultiple\fR
+words.
+This example assumes that
passwd(1)
does not take multiple user names on the command line.
+Note that on GNU systems, options to
+passwd(1)
+may be specified after the user argument.
+As a result, this rule will also allow:
+.nf
+.sp
+.RS 4n
+passwd username --expire
+.RE
+.fi
+.PP
+which may not be desirable.
.nf
.sp
.RS 0n
will
.Sy not
be matched by
-wildcards used in the path name.
+wildcards used in the file name portion of the command.
This is to make a path like:
.Bd -literal -offset 4n
/usr/bin/*
get matched by wildcards since command line arguments may contain
arbitrary strings and not just path names.
.Pp
+.Bf -symbolic
Wildcards in command line arguments should be used with care.
-Because command line arguments are matched as a single, concatenated
-string, a wildcard such as
+.Ef
+.br
+Command line arguments are matched as a single, concatenated string.
+This mean a wildcard such as
.Ql \&?
or
.Ql *
-can match multiple words.
+will match
+.Em multiple
+words.
For example, while a sudoers entry like:
.Bd -literal -offset 4n
%operator ALL = /bin/cat /var/log/messages*
root on the
.Em HPPA
machines.
-Note that this assumes
+Because command line arguments are matched as a single,
+concatenated string, the
+.Ql *
+wildcard will match
+.Em multiple
+words.
+This example assumes that
.Xr passwd 1
does not take multiple user names on the command line.
+Note that on GNU systems, options to
+.Xr passwd 1
+may be specified after the user argument.
+As a result, this rule will also allow:
+.Bd -literal -offset 4n
+passwd username --expire
+.Ed
+.Pp
+which may not be desirable.
.Bd -literal
bob SPARC = (OP) ALL : SGI = (OP) ALL
.Ed