[Top][All Lists]

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

Re: address@hidden: gamegrid-add-score fails]

From: oliver
Subject: Re: address@hidden: gamegrid-add-score fails]
Date: Thu, 27 Feb 2003 09:27:18 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50

Jesper Harder <address@hidden> writes:

> I now get this backtrace with the lates Emacs from CVS:
> (gamegrid-add-score "baz" 10)
> =>
> Debugger entered--Lisp error: (error "/home/harder/.emacs.d/games/foo: no 
> such directory")

I can not reproduce this with my patched version. I'll look at this
again, when I find the time to make a fresh checkout from CVS. Are
you sure the the right version of gamegrid.el is loaded?

> Also, if you call `game-grid-add-score' with an absolute filename
> (which is the way the function should be called in Emacs 21.2), it
> works the first time:
> (gamegrid-add-score "/tmp/bar" 11)
> => nil  ;; this works.
> but fails on subsequent calls:
> (gamegrid-add-score "/tmp/bar" 12)
> =>
> Debugger entered--Lisp error: (error "Failed to update game score file")

The reason is that the first time /tmp/bar is non-existent in what
emacs thinks to be the system wide game directory, so Emacs creates it
with the user as the owner. The second time it is existent, so Emacs
tries to access it with the setuid "update-game-score". The point is
that the code doesn't check for a directory-name, but only whether a
file exists and whether "update-game-score" is setuid or not.

I don't know what the right thing here is. Maybe Emacs should check
explicitly whether the first argument to `gamegrid-add-score' is a
filename containing `shared-game-score-directory' and call
"update-game-score" only then? Or should it check whether the file is
writeable by the user before acting? Both workarounds seem kludgy to

As I understand it, code calling `gamegrid-add-score' is supposed to
be ignorant of the system and the file system hierarchy. It is very
possible that there is no "/tmp" directory on the system. User control
should happen by means of the variables `shared-game-score-directory'
and `gamegrid-user-score-file-directory'. (That's only my
interpretation of the code, I have not written it.)

Does it break any existing packages the way it is now?

Oliver Scholz               9 Ventôse an 211 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.       http://www.jungdemokratenhessen.de
Tel. (069) 97 40 99 42      http://www.jdjl.org

reply via email to

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