NeilStevens: A ToME 2.3.3 binary is now shipped, so the below is obsolete.
I'm currently running ToME 2.3.2 on MacOS X and have been for a couple of weeks. It involved hacking files.c so that setuid() was not called. My question is whether anyone would like to have it and what I need to do to make and distribute it.
NeilStevens: If you found a bug that keeps that build from running, file it in BugReports (with a patch if you have it). Or you can just send a patch to the mailing list.
HarryErwin: I don't have a real fix. I checked out V 3.0.6, and RR deleted the following
- /* Free the bundle */ CFRelease(main_bundle);
to get around the getuid error. On the other hand, he left this in, and this is probably where ToME 2.3.2 is dying:
- /* Free the url */ CFRelease(main_url);
The point is that Apple messed around with the setuid stuff recently to deal with a security problem, and that broke ToME. The workaround in files.c is the following:
void safe_setuid_drop(void) {return;}
void safe_setuid_grab(void) {return;}
and that's a real kludge. I don't want to make that change until we really understand the problem.
NeilStevens: So it's only broken for multi-user installs?
HarryErwin: I've got the application installed in /Application, and I'm running it as one user of several, so that might be the issue. I haven't tried installing it in my user directory. I don't think a single-user install is a solution, though, in MacOS X. Nobody with any sense runs as root.
NeilStevens: You misunderstand the single-user builds. Single-user builds don't install to a system-wide directory. They are kept together in one directory, with the library directory set to "lib", so that you run it in place and the game has direct access to all its files.
HarryErwin: That's how I'm running it. I just am keeping it all under /Applications. The implication is yes, it's broken for single-user installs. And yes, RR was setting up a multi-user install for V, and that had slightly different symptoms. The implication is that the UID problem may have something to do with who owns the directory that contains the save files. Not working in the area, I don't understand the issues.
NeilStevens: Aha! There is a separate problem here from the one breaking multi-user installs, and that is that single-user installs are needlessly making SET_UID calls. The problem is in h-config.h, where SET_UID is conditioned on the OS, not the install preferences.
One thing we need to do is fix that to be conditioned on whether the build is multi-user or single-user. That'd fix the single-user builds right away.
That's at least one thing I can debug without access to a Mac.
KentBehrends: If you need access to a Mac, I can give you command line access (via ssh). I have all the tools needed to compile/run T.o.M.E. You wont be able to set the tome binary to setuid root, but everything else. Just let me know via e-mail (send along a public key).
HarryErwin: Kent's fix works for setuid, so it should be inserted into the master source. (Neil?) To have 8 bit and 16 bit graphics, you have to install the .png files in the application.app directory, which isn't done by the current makefile but can be added easily, following the Angband model. I don't yet know how to get 32 bit graphics. I suppose I need to go back over the Angband work I did in that area...
NeilStevens: Which fix again?
HarryErwin: From Developer's Corner, a posting by Kent Behrends:
/* * Macintosh and SAFE_SETUID_POSIX do not get along... */ #if defined(USE_MACOSX) # undef SAFE_SETUID_POSIX #endif
(Moving the rest of the discussion of this patch over to Developers Corner/Mac OS compilation issues
ToME Wiki