GNU Chess problem: I can only play games as root

bigtoque

Member

Reaction score: 6
Messages: 75

I've got GNU Chess installed from ports, and have installed xboard and eboard.

When I try to start a new game from a normal user account in either xboard or eboard, I get the error:

"book_open(): can't open file "/usr/local/share/gnuchess/book.bin": Permission denied"

I can run the game as root.

The permissions for the file are:
Code:
-r--r--r--  1 root  wheel

Edit:

If I change the permissions to:
Code:
-r--rw-r--  1 root  wheel
I can run the game without any errors.

Why would the game run under root with only read permission, yet not work under normal account with read permission? And why would allowing write permission to the files group matter, if it can be run by root with only read permission?
 

pmooney

New Member


Messages: 3

bigtoque said:
Why would the game run under root with only read permission, yet not work under normal account with read permission? And why would allowing write permission to the files group matter, if it can be run by root with only read permission?

Root, being the superuser, can open the file read/write even though the FS permissions are set to read-only. Since your regular user lacks this power, but belongs to the wheel group, g+rw must be set on the file for GNU chess to access it in the manner it wishes.
 

vsoto

Member

Reaction score: 6
Messages: 23

For comparison

One of the opening books for games/crafty:

Code:
-rw-rw-r--  1 nobody  nogroup  2653860 Jul 10 03:15 /usr/local/lib/crafty/book.bin
 

fwaggle

Member

Reaction score: 6
Messages: 62

As for why on earth it demands to write to that file, that's probably an issue with either the author or the maintainer.
 

Rock

New Member


Messages: 2

I have no problem as root. Non-root gave an error. The fix. Change
Code:
"gnuchess" -x
to include the
Code:
-x
in .xboardrc.
 

grahamperrin

Son of Beastie

Reaction score: 801
Messages: 2,608

… from a normal user account in either xboard or eboard, I get the error: …

For what it's worth, without XBoard games/xboard, no problem with a normal user account (Chess in foreground, htop in background):

1633161509690.png
 
Top