From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 4db075b7; for ; Thu, 27 Nov 2014 18:40:19 -0500 (EST) Date: Thu, 27 Nov 2014 18:40:19 -0500 (EST) Message-Id: <4002935741860819814.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Downgrade .Bd -file from FATAL to ERROR. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Downgrade .Bd -file from FATAL to ERROR. Since this was the last remaining FATAL error in this area, this change will allow major simplifications in the mdoc(7) parser. Modified Files: -------------- mdocml: mandoc.1 mandoc.h mdoc_validate.c read.c Revision Data ------------- Index: read.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/read.c,v retrieving revision 1.98 retrieving revision 1.99 diff -Lread.c -Lread.c -u -p -r1.98 -r1.99 --- read.c +++ read.c @@ -202,6 +202,7 @@ static const char * const mandocerrs[MAN /* related to request and macro arguments */ "escaped character not allowed in a name", "argument count wrong", + "NOT IMPLEMENTED: Bd -file", "missing list type, using -item", "missing manual name, using \"\"", "uname(3) system call failed, using UNKNOWN", @@ -214,7 +215,6 @@ static const char * const mandocerrs[MAN "generic fatal error", "input too large", - "NOT IMPLEMENTED: Bd -file", "NOT IMPLEMENTED: .so with absolute path or \"..\"", ".so request failed", Index: mandoc.1 =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandoc.1,v retrieving revision 1.123 retrieving revision 1.124 diff -Lmandoc.1 -Lmandoc.1 -u -p -r1.123 -r1.124 --- mandoc.1 +++ mandoc.1 @@ -1396,6 +1396,17 @@ The indicated request or macro has too f The syntax tree will contain the wrong number of arguments as given. Formatting behaviour depends on the specific request or macro in question. Note that the same message may also occur as a WARNING, see above. +.It Sy "NOT IMPLEMENTED: Bd -file" +.Pq mdoc +For security reasons, the +.Ic \&Bd +macro does not support the +.Fl file +argument. +By requesting the inclusion of a sensitive file, a malicious document +might otherwise trick a privileged user into inadvertently displaying +the file on the screen, revealing the file content to bystanders. +The argument is ignored including the file name following it. .It Sy "missing list type, using -item" .Pq mdoc A @@ -1484,17 +1495,6 @@ cannot handle input files larger than it of 2^31 bytes (2 Gigabytes). Since useful manuals are always small, this is not a problem in practice. Parsing is aborted as soon as the condition is detected. -.It Sy "NOT IMPLEMENTED: Bd -file" -.Pq mdoc -For security reasons, the -.Ic \&Bd -macro does not support the -.Fl file -argument. -By requesting the inclusion of a sensitive file, a malicious document -might otherwise trick a privileged user into inadvertently displaying -the file on the screen, revealing the file content to bystanders. -The parser exits immediately. .It Sy "NOT IMPLEMENTED: .so with absolute path or \(dq..\(dq" .Pq roff For security reasons, Index: mandoc.h =================================================================== RCS file: /home/cvs/mdocml/mdocml/mandoc.h,v retrieving revision 1.169 retrieving revision 1.170 diff -Lmandoc.h -Lmandoc.h -u -p -r1.169 -r1.170 --- mandoc.h +++ mandoc.h @@ -159,6 +159,7 @@ enum mandocerr { /* related to request and macro arguments */ MANDOCERR_NAMESC, /* escaped character not allowed in a name: name */ MANDOCERR_ARGCOUNT, /* argument count wrong */ + MANDOCERR_BD_FILE, /* NOT IMPLEMENTED: Bd -file */ MANDOCERR_BL_NOTYPE, /* missing list type, using -item: Bl */ MANDOCERR_NM_NONAME, /* missing manual name, using "": Nm */ MANDOCERR_OS_UNAME, /* uname(3) system call failed, using UNKNOWN */ @@ -171,7 +172,6 @@ enum mandocerr { MANDOCERR_FATAL, /* ===== start of fatal errors ===== */ MANDOCERR_TOOLARGE, /* input too large */ - MANDOCERR_BD_FILE, /* NOT IMPLEMENTED: Bd -file */ MANDOCERR_SO_PATH, /* NOT IMPLEMENTED: .so with absolute path or ".." */ MANDOCERR_SO_FAIL, /* .so request failed */ Index: mdoc_validate.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/mdoc_validate.c,v retrieving revision 1.257 retrieving revision 1.258 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.257 -r1.258 --- mdoc_validate.c +++ mdoc_validate.c @@ -761,7 +761,7 @@ pre_bd(PRE_ARGS) case MDOC_File: mandoc_msg(MANDOCERR_BD_FILE, mdoc->parse, n->line, n->pos, NULL); - return(0); + break; case MDOC_Offset: if (0 == argv->sz) { mandoc_msg(MANDOCERR_ARG_EMPTY, -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv