groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] GNU troff in OpenBSD


From: Werner LEMBERG
Subject: Re: [Groff] GNU troff in OpenBSD
Date: Mon, 17 Oct 2011 08:46:55 +0200 (CEST)

>>> -.  pso bash -c "echo -n .ds *date\ ;date"
>>> +.  pso /bin/sh -c "echo -n .ds *date\ ;date"
> 
>> That smells odd;
> 
> Yes, please do say that aloud.  :-/

:-)

> This part of the hdtbl example code looks horribly unsafe;
> shelling out of roff code is already questionable practice:

I fully agree, however, this doesn't affect normal users since `.pso'
is disabled in groff by default.  You must explicitly activate it with
flag `-U'.

> Some people read manuals as root and probably don't expect malicious
> manuals to run arbitrary code (for that reason, we decided that we
> will never support .pso in mandoc(1) at all).

There is no `.pso' call in any groff manual...

>> what if I've a file called ./mandate?  Do the globs need escaping?
>> I realise you haven't introduced them

... we are talking about running `make' after unpacking the tarball,
right?  And the specific line constructs an `echo' command for the
groff string \*[*date] (so no globs are involved at all) which holds
the output of the `date' command.

> Yes, and exactly those potential security issues were the reason why
> i disabled those examples completely when porting groff to OpenBSD,
> rather than even trying to fix the shell GNUism.

OK.  However, Joe User had to explicitly use `-U' to make the examples
work...

>> Also, would plain `sh' suffice, relying on PATH?
> 
> Yes, it would suffice.

Such a patch is already in CVS since January.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]