[comp.sources.games.bugs] mdg_stop can be succesfully executed by everyone

chris@attron.ruhr.sub.org (Christian Schlichtherle) (02/27/91)

Hmm... mdg_stop can be succesfully executed by everyone, so everyone
could stop the daemon. This should not happen as is stated in the
README file (one of several "bugs" I found so far, see latest articles).
To remedy the situation, you simply can patch dmain.c like this:

	if((dqid = msgget(dmsgkey, IPC_CREAT | 0777)) == -1) {

to

	if((dqid = msgget(dmsgkey, IPC_CREAT | 0644)) == -1) {

(0777 has no sense anyway - it should have been 0666). This should
work like it is expected. The Daemon can only be stopped by the user
who started it or by the superuser.
To get in effect and work as expected, mdg, mdg_char and mdg_daemon
must be setuid ("bin" on my system) and mdg_stop and mdg_save must not
be setuid (as is stated in the README file)!

Further testing,
	Chris
-- 
Snail: Christian Schlichtherle, Elbscheweg 20, 5802 Wetter 4, Germany
Email: chris@attron.ruhr.sub.org	Tel.: +49 2335 7550
"Der Tod ist ein Meister aus Deutschland" -- Paul Celan