Page MenuHomeFreeBSD

man(1) does not support some special characters in filenames (double quotes and sub shell character)
ClosedPublic

Authored by wosch on Jan 14 2024, 1:49 PM.
Tags
None
Referenced Files
F156975070: D43453.id.diff
Sun, May 17, 6:06 PM
Unknown Object (File)
Sat, May 16, 8:01 AM
Unknown Object (File)
Fri, May 15, 10:26 PM
Unknown Object (File)
Tue, May 12, 4:08 PM
Unknown Object (File)
Tue, May 12, 1:40 AM
Unknown Object (File)
Tue, May 12, 1:40 AM
Unknown Object (File)
Tue, May 12, 1:00 AM
Unknown Object (File)
Wed, Apr 29, 7:30 PM
Subscribers

Details

Summary

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275967

Unfortunately, there is another problem with double quotes and sub shell character as '`' '$'

$ cp /usr/share/man/man1/cat.1.gz 'c`t.1.gz'
$ /usr/bin/man './c`t.1.gz'
eval: 1: Syntax error: EOF in backquote substitution
eval: 1: Syntax error: Error in command substitution

I think the problem is the usage of eval "string....". I don't know why we are using eval here and if we really need it.

Using eval for untrusted user input does not make a shell script more secure. It is an easy way to shoot yourself in the foot.

Test Plan

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable