0.76: please submit patches for this section with actual code/doc
patches!
+* '[...]' parsing: document it and also fix it to support '\]' escape
+ sequence. Feature request from Russell Kliese (Bug 517064 -
+ agmorgan).
* pam_rootok: compilation warning noted by Tony den Haan wrt no
prototype for strcmp() (Bug 557322 - agmorgan).
* documentation: (a few of mine in passing) and app documentation
<title>The Linux-PAM System Administrators' Guide
<author>Andrew G. Morgan, <tt>morgan@kernel.org</tt>
-<date>DRAFT v0.76 2002/05/09
+<date>DRAFT v0.76 2002/05/26
<abstract>
This manual documents what a system-administrator needs to know about
the <bf>Linux-PAM</bf> library. It covers the correct syntax of the
the following form:
<tscreen>
<verb>
-service-name module-type control-flag module-path arguments
+service-name module-type control-flag module-path args
</verb>
</tscreen>
Below, we explain the meaning of each of these tokens. The second (and
error to <tt/syslog(3)/. For a list of <em/generic/ options see the
next section.
+Note, if you wish to include spaces in an argument, you should
+surround that argument with square brackets. For example:
+<tscreen>
+<verb>
+squid auth required pam_mysql.so user=passwd_query passwd=mada \
+ db=eminence [query=select user_name from internet_service where \
+ user_name='%u' and password=PASSWORD('%p') and \
+ service='web_proxy']
+</verb>
+</tscreen>
+Note, when using this convention, you can include `<tt/[/' characters
+inside the string, and if you wish to include a `<tt/]/' character
+inside the string that will survive the argument parsing, you should
+use `<tt/\[/'. In other words:
+<tscreen>
+<verb>
+[..[..\]..] --> ..[..]..
+</verb>
+</tscreen>
+
</descrip>
<p>
for (i=1; i<256; table[i++] = '\0');
for (i=0; format[i] ; table[(int)format[i++]] = 'y');
- /* look for first non-blank char */
+ /* look for first non-format char */
while (*from && table[(int)*from]) {
++from;
}
* special case, "[...]" is considered to be a single
* object. Note, however, if one of the format[] chars is
* '[' this single string will not be read correctly.
+ * Note, any '[' inside the outer "[...]" pair will survive.
+ * Note, the first ']' will terminate this string, but
+ * that "\]" will get compressed into "]". That is:
+ *
+ * "[..[..\]..]..." --> "..[..].."
*/
- for (end=++from; *end && *end != ']'; ++end) {
+ char *to;
+ for (to=end=++from; *end && *end != ']'; ++to, ++end) {
if (*end == '\\' && end[1] == ']')
++end;
+ if (to != end) {
+ *to = *end;
+ }
+ }
+ if (to != end) {
+ *to = '\0';
}
/* note, this string is stripped of its edges: "..." is what
remains */