![]() |
#1 |
Scout
|
![]()
So, here I am on my Mac, running OSX, when my copy of Angband v3.0.6 suddenly decides to start giving me the message: "Cannot create the '/var/root/Library/Preferences/Angband/scores/scores.raw' file! The lib directory is probably missing or broken. Perhaps the archive was not extracted correctly. See the 'readme.txt' file for more information."
So I mess around for a while. I restart a few times. I'm not, by the way, very good at this. Anyway, I can't fix it. So, I kidnap my favorite save file, dump everything else Angband related I can find into the trash, and try to re-download it. And it still doesn't work! ![]() So, does anyone know how to make my Angband work? I've even found a more recent version (v3.0.9), and it still isn't helping. By the way, I registered with these forums for the initial reason of working this out, so please don't fail me! |
![]() |
![]() |
![]() |
#2 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 56
Posts: 9,319
Donated: $60
![]() ![]() |
I'm really guessing here (and hopefully someone with some actual knowledge will give a better answer), but it looks to me like something else has changed with your system that is stopping that file from being written. If you have changed anything else recently, that might give some clues.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#3 |
Knight
Join Date: Apr 2007
Posts: 590
![]() |
Agreed: it's obviously a file permissions error (Angband lost its authority to write the file in the first place). As OSX is a *NIX and doing a clean install of V3.0.9 didn't work, I'd say either that Angband is not running as the user the installer runs as, or the installer is not giving said user write permissions to its own directories. As a recent change that the OP hadn't figured out already, it probably was a side effect of a patch or recentlly installed application.
In any case, making the relevant directories world-writeable will bypass this (insecurely), assuming that the caveat about Mac9 and lower having nonunique filepaths doesn't hold for OSX. Windows Vista has this problem as well. (Can't install to Program Files subdirectory because Angband isn't guaranteed to be able to write to where it's installed; have to unpack/build archive as the login who's going to play it). |
![]() |
![]() |
![]() |
#4 |
Scout
|
Another event, if it helps.
So, I downloaded Zangband, thinking maybe it would work, and also that it was a version I'd been wanting to play, and it didn't work either. BUT, when I downloaded Steamband (a weird, weird version, by the way), it worked just fine. Is there anyone out there who is enough of a Mac computer person that they can walk me through giving Angband the permissions it needs? I'd rather not make my hard drive world-writeable if I can avoid it. |
![]() |
![]() |
![]() |
#5 |
Adept
Join Date: Dec 2007
Posts: 167
![]() |
/var/root is the home directory for root (superuser) and shouldn't be readable by other users. It looks like Angband was installed by root, and thus is putting the score file there.
By comparison, I installed Angband as myself (not root), by dragging-and-dropping the application bundle into /Applications/. This resulted in my scores directory (and save, data, and bone) being created in /Users/roustk/Library/Preferences/Angband/. Why did this suddenly become a problem? I would guess that you either (1) installed a new security update or version of the OS or (2) ran "fix permissions" from DiskUtility. Angband doesn't keep any "preference" file telling it where its directories are stored, so the fact that the ~root/Library/Preferences/Angband stuff exists shouldn't be causing problems with a new installation. (Angband's file locations are fixed by the PRIVATE_USER_PATH variable at compile time -- either all directories are in a central application under Angband.app on MacOS X or most directories are there but some, like scores and save, are under ~/Library/Preferences/Angband/.) Suggestions for a fix: 1) If you are compiling Angband yourself, do it as yourself, not as root. You may also want to use sudo and delete /var/root/Library/Preferences/Angband. 2) If you are installing from the pre-compiled dmg, just drag-and-drop the application while logged in as yourself. 3) If all else fails, you can brutally change the permissions on the directory in /var/root. We will isolate the access to just the Angband directory, but it probably is still a possible security hole that may get 'fixed' again. Changing permissions is easy, especially if you've ever used Terminal (or unix) before: a) Open Terminal. It should be in either /Applications or /Applications/Utilities. b) Enter the following command: Code:
sudo chmod -R ugo+rwX /var/root/Library/Preferences/Angband c) Enter your login password when asked. (If you've never used sudo, you'll get a lecture about trust.) d) Type "logout" (no quotes). e) Close the window and quit terminal. (Explanation: Terminal allows a command-line interface to the unix system behind OSX, 'sudo' runs the command as superuser, 'chmod' changes read/write permissions, '-R' makes chmod affect sub-directories, 'ugo+rwX' means to add permission for everybody (user, group, and other) to read and write files and read, write, or execute (access) directories.) Kevin Last edited by roustk; January 21, 2008 at 20:18. |
![]() |
![]() |
![]() |
#6 | |
Veteran
Join Date: Apr 2007
Posts: 1,947
Donated: $40
![]() |
Quote:
(This was also reported on http://dev.rephial.org/trac/ticket/384. Given I don't have a Mac yet, I can't really help out on this issue so well...) |
|
![]() |
![]() |
![]() |
#7 |
Scout
|
Nope. No app launcher.
|
![]() |
![]() |
![]() |
#8 | |
Adept
Join Date: Dec 2007
Posts: 167
![]() |
EDIT: This dives deeply into the code. Skip as needed./EDIT
Quote:
Makefile.osx sets -DPRIVATE_USER_PATH=\"~/Library/Preferences\" -DUSE_PRIVATE_PATHS and ultimately SET_UID (through h-basic.h). This means that init2.c calls the first version of path_parse() in z-file.c like this: Code:
path_parse(dirpath, sizeof(dirpath), PRIVATE_USER_PATH); Code:
file=(char *)"~/Library/Preferences" u=file+1 s=u user[0]='\0' u=user u=getlogin() Code:
pw=getpwuid(getuid()) As the code has already tried the only two ways to identify the user, we are stuck for a good way to figure out who he really is. I can think of three potential workarounds, all with significant drawbacks: 1) On an essentially single-user system, we might be able to make a good guess by using getutxent() to identify who is logged in on console. This code would likely be ugly, and the assumption would be obviously false on a multiuser system. Limiting it to Macs (and maybe non-Server Macs) might work. 2) We could ask the user to type in their username. This code might be easy enough, but error checking could be a nightmare. 3) We could fall back on the centralized directory structure (not USE_PRIVATE_PATHS). If the failure to identify the user is transitory, this is an unimaginably bad solution. If the user doesn't have write permission to the central directory (inside the application, on Macs), this will also fail. Kevin |
|
![]() |
![]() |
![]() |
#9 | |
Adept
Join Date: Dec 2007
Posts: 167
![]() |
Quote:
(That is, under your home directory, in Library, in Preferences, in Angband, in save.) Just for kicks, can you open a terminal and run the following command, while Angband is running? Code:
ps -axcj Code:
[roustk-mac:~] roustk% open /Applications/Angband.app/ [roustk-mac:~] roustk% ps -axcj USER PID PPID PGID SESS JOBC STAT TT TIME COMMAND root 1 0 1 24a8e88 0 S<s ?? 0:01.78 launchd ... roustk 754 77 77 24a77e4 0 S ?? 0:06.93 angband ... [roustk-mac:~] roustk% Kevin |
|
![]() |
![]() |
![]() |
#10 |
Scout
|
Yes, that is where I found the save file.
So, when I enter "ps -axcj" into the Terminal, I discover that my computer thinks 'mark' (that's me) is running Angband. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|