cowsay-org / cowsay

apjanke's fork of the classic cowsay project
http://cowsay.diamonds
GNU General Public License v3.0
83 stars 15 forks source link

Not suitable for children. #46

Open vimnux opened 2 months ago

vimnux commented 2 months ago

Would you be so kind to remove: NSFW

Reason: cowsay is used by kids.

apjanke commented 2 months ago

Oh, sure. I'm planning to pull all of the NSFW cows out of the main cowsay package and put them in a separate "offensive" package like modern fortune distributions do. I'll include this one. Can probably have it done for next cowsay release, in a week or two.

Let me know if you identify other cows that should get the same treatment.

vimnux commented 2 months ago

Thank you !

I took a look at the other cows and they're all fine 👍

apjanke commented 2 months ago

Cool. Done in https://github.com/cowsay-org/cowsay/commit/fa960eae7c7867ad966a59619adc9c5e9d2b15d2. Made a separate cows-offensive repo to pasture it in, so the history isn't lost and it's still available for folks who want such cows.

This is a small enough change, I think it can go out in a patch release pretty soon, instead of waiting for 3.9.0.

apjanke commented 2 months ago

Cowsay 3.8.2 is out, with this change. Closing as Fixed.

Thanks for the report, and for using Cowsay!

apjanke commented 2 months ago

Looks like "telebears" and "satanic" cows are also problematic. Sent those over to the cows-offensive pasture, too. In https://github.com/cowsay-org/cowsay/commit/abcbcc906fdbb739aa24456b6d4ebf1ef07b5e82. Will go out in 3.8.3.

vimnux commented 2 months ago

Thank you !

Had seen 'satanic'. It's not that bad but .. might indeed be offensive with religious people.

'telebears' sounded so innocent that I didn't take a look at it 😅 ... lesson learned.

I did look at 'head-in' though ... I think it's funny ... other people might find it offensive though ... IDK.

apjanke commented 2 months ago

Oh look, Debian already has a broken-out cowsay-off package for the offensive cows, based on classic cowsay.

root@trix-test-as:/home/janke# apt info cowsay-off 2>/dev/null | head -3
Package: cowsay-off
Version: 3.03+dfsg2-8
Priority: optional
root@trix-test-as:/home/janke# apt info cowsay-off 2>/dev/null | grep Descript
Description: configurable talking cow (offensive cows)
root@trix-test-as:/home/janke# apt info cowsay-off 2>/dev/null | grep offens
Description: configurable talking cow (offensive cows)
 This package contains cows which some may consider to be offensive.
root@trix-test-as:/home/janke# 

Might follow their lead here for particular choices.

root@trix-test-as:/home/janke# dpkg -L cowsay-off
/.
/usr
/usr/share
/usr/share/cowsay
/usr/share/cowsay/cows
/usr/share/cowsay/cows/beavis.zen.cow
/usr/share/cowsay/cows/bong.cow
/usr/share/cowsay/cows/mutilated.cow
/usr/share/doc
/usr/share/doc/cowsay-off

Looks like they have bong, mutilated, and beavis.zen in "offensive". And I don't see sodomized, telebears, or satanic in either of the packages. I'll have a look at the git commit history and the Debian package definition and see if those cows were added after 3.03, or if Debian is considering them too risqué to ship even in the "offensive" cowsay-off package.

apjanke commented 2 months ago

Re-opening this issue, since it looks like there's more work to be done in this area.

Feel free to un-Follow this issue, @vimnux, if you don't want to get spammed with comment notifications.

Another idea: maybe add a -o option like fortune has, so that even on systems which have the offensive cows installed at a system level, using them is opt-in on a per-user basis (for stuff like -r randomization), and it's easy to write programs that script cowsay and exclude the offensive cows.

vimnux commented 2 months ago

Can't go wrong with Debian.

I made a diff between the Debian default cows and the cows of your previous package:

1c1,3
< apt.cow
---
> beavis.zen.cow
> blowfish.cow
> bong.cow
4d5
< calvin.cow
6d6
< cock.cow
12,13d11
< duck.cow
< elephant-in-snake.cow
14a13
> elephant-in-snake.cow
17d15
< fox.cow
19c17
< gnu.cow
---
> head-in.cow
21d18
< kangaroo.cow
22a20
> kitty.cow
26c24
< mech-and-cow.cow
---
> meow.cow
30,31c28
< pony-smaller.cow
< pony.cow
---
> mutilated.cow
32a30
> satanic.cow
35c33,34
< snowman.cow
---
> small.cow
> sodomized.cow
38c37,39
< suse.cow
---
> supermilker.cow
> surgery.cow
> telebears.cow
43,45c44
< unipony-smaller.cow
< unipony.cow
< vader-koala.cow
---
> udder.cow
46a46
> vader-koala.cow

On Arch Linux, fortune doesn't have the -o option. We do: # fortune -f to see what datasets are available and then for example: # fortune /usr/share/fortune/tao to get a random fortune from the Tao dataset.

Anyway here is my $0.02: Make the offensive package install with group permissions set to 'offensive'. This way, only users who are members of the 'offensive' group can access and use the offensive cows. To ensure that only group members can see and access the files, you can set the directory permissions to drwxr----- and the file permissions to -rw-r-----. This way, only users in the offensive group will be able to see and access the files.

Thank you for your dedication and hard work in addressing this issue. Your seriousness and effort are greatly appreciated !

apjanke commented 2 months ago

Thanks for the diff! I didn't realize our collections were that different. I think we can get that unified some. I'll look in to it.

Make the offensive package install with group permissions set to 'offensive'. This way, only users who are members of the 'offensive' group can access and use the offensive cows. To ensure that only group members can see and access the files, you can set the directory permissions to drwxr----- and the file permissions to -rw-r-----.

That's an interesting idea. Is an "offensive" group standard practice?

I think that would imply that cowsay should gracefully handle the case where it gets permission-denied failures when trying to read cow dirs on the cowpath, at least for some entries, and should treat that as an expected normal condition without throwing error messages at the user.

Thank you for your dedication and hard work in addressing this issue. Your seriousness and effort are greatly appreciated !

You're welcome! Though "seriousness" may be a bit of an exaggeration; the seriousness is all part of the joke here. ;)

vimnux commented 2 months ago

Using different groups is standard practice to restrict access to binaries, files, devices and whatnot. You can see all groups and their members with: # cat /etc/group

As far as I know, 'offensive' isn't used as a group name by any other application. Therefore using 'offensive' as a group name won't lead to conflicts.

I have a group called 'test' on my system. And I did:

# sudo chown :test /usr/share/cows/head-in.cow
# sudo chmod 750 /usr/share/cows/head-in.cow

after that, running: # cowsay -f head-in mooo as a user, who isn't member of group test, results in text without cow:

 _____ 
< mooo >
 ----- 

no errors so basically no need to change your code. Users who are member of group test will see both text and cow.

When you choose for the 'group solution', you'll only need a few changes in your your Makefile. And you should probably add a pre-install script (aka preinst to add the group) and a post-install script (aka postinst to change the file permissions) to make packaging a bit easier for the distro package maintainers.

Anyway ... it's up to you how to solve the issue.

Ps you don't need full path to access a dataset from fortune ... # fortune perl works just fine 😅

apjanke commented 2 months ago

One more data point for consideration: the core Homebrew cowsay Formula also removes cows sodomized and telebears, but not satanic or head-in, or the beavis.zen, bong, or mutilated cows that Debian moves to cowsay-off.

  def install
    # Remove offensive content
    %w[cows/sodomized.cow cows/telebears.cow].each do |file|
      rm file
      inreplace "Files.base", file, ""
    end
d86604247d1f Formula/cowsay.rb   (Jordan Bracco        2009-11-12 18:07:59 +0100 27)   def install
6767a6aa5d2b Formula/cowsay.rb   (Issy Long            2020-09-27 19:44:47 +0100 28)     # Remove offensive content
6767a6aa5d2b Formula/cowsay.rb   (Issy Long            2020-09-27 19:44:47 +0100 29)     %w[cows/sodomized.cow cows/telebears.cow].each do |file|
6767a6aa5d2b Formula/cowsay.rb   (Issy Long            2020-09-27 19:44:47 +0100 30)       rm file
6767a6aa5d2b Formula/cowsay.rb   (Issy Long            2020-09-27 19:44:47 +0100 31)       inreplace "Files.base", file, ""
6767a6aa5d2b Formula/cowsay.rb   (Issy Long            2020-09-27 19:44:47 +0100 32)     end
6767a6aa5d2b Formula/cowsay.rb   (Issy Long            2020-09-27 19:44:47 +0100 33)

I think this supports the NSFW removals we've done here so far.

Had seen 'satanic'. It's not that bad but .. might indeed be offensive with religious people.

I don't think it's very bad either; I've seen scarier looking villains on Care Bears episodes. But religion is a touchy subject, and the name "satanic" itself could be a problem for family or business folks. Erring on the side of caution here.

Further related discussion is in https://github.com/cowsay-org/cowsay/issues/64 - turns out some of the cows absent from Debian may have been removed due to copyright provenance issues, not offensive content. Looking in to it.