Bug 215961

Summary: fortune -o does not work anymore
Product: Base System Reporter: Andras Farkas <deepbluemistake>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Many People CC: FreeBSD, jilles, xmj
Priority: --- Keywords: regression
Version: 11.0-RELEASE   
Hardware: Any   
OS: Any   

Description Andras Farkas 2017-01-11 09:09:55 UTC
``No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune.''
I know fortune -o worked in a previous version of FreeBSD, too.
Comment 1 Shane 2017-01-12 03:59:18 UTC
fortune included in the liveCD of the 9.3 and 10.3 install disks behaves the same.

> fortunes -Do
> 
> 	trying "/usr/share/games/fortune/fortunes-o"
> adding file "/usr/share/games/fortune/fortunes-o"
> 	trying "/usr/local/share/games/fortune/fortunes-o"
> adding file "/usr/local/share/games/fortune/fortunes-o"
> No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune.

That would indicate only searching for one specific filename for offensive fortunes, rather than all fortune files ending in -o
Comment 2 Jilles Tjoelker freebsd_committer freebsd_triage 2017-01-15 21:41:41 UTC
The -o fortunes were removed from the base system in https://svnweb.freebsd.org/base?view=revision&revision=248200
Comment 3 Shane 2017-01-16 06:09:49 UTC
(In reply to Jilles Tjoelker from comment #2)
While related, it's not the same issue - removing a potentially offensive datafile ("fortunes-o") from the base system is not the same as `fortune -o` selecting from files ending with "-o".

/head/games/fortune/datfiles/Makefile comments that the "limerick murphy-o gerrold.limerick" are potentially offensive, so even removing "fortunes-o" didn't remove all offensive fortunes.

man fortune states - 

> -o Choose only from potentially offensive aphorisms.
> ...
> ...(those files ending ``-o'' contain the offensive fortunes)

So the issue isn't whether offensive fortunes exist, they could have been added by the user, or installed from ports. The issue is that the `-o` option should use files ending with "-o" when finding a fortune to display, currently the `-o` option only searches for one filename, which doesn't exist now, when it should find all files ending with "-o". Of course the `-o` option could be removed with all fortune files being treated as equals.

If the current behaviour is "as expected", then the man page should be updated to reflect that.
Comment 4 Johannes Jost Meixner freebsd_committer freebsd_triage 2017-03-24 17:52:48 UTC
Whether offensive fortune files have been removed from the base system is immaterial to the bug at hand. Even if you manually install offensive fortune files into /usr/{,local/}share/games/fortune/*-o, `fortune -o` won't find them:

xmj@mx16:/usr/src# file /usr/share/games/fortune/murphy-o{,.dat}
/usr/share/games/fortune/murphy-o:     ASCII text
/usr/share/games/fortune/murphy-o.dat: data
xmj@mx16:~/repos/hardenedbsd-playground# fortune -D -o
        trying "/usr/share/games/fortune/fortunes-o"
adding file "/usr/share/games/fortune/fortunes-o"
        trying "/usr/local/share/games/fortune/fortunes-o"
adding file "/usr/local/share/games/fortune/fortunes-o"
No fortunes found in /usr/share/games/fortune:/usr/local/share/games/fortune.