Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 21, 2008, 04:34   #1
ElectricPaladin
Scout
 
Join Date: Jan 2008
Posts: 33
ElectricPaladin is on a distinguished road
Send a message via AIM to ElectricPaladin
Exclamation Troubleshooting

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!
ElectricPaladin is offline   Reply With Quote
Old January 21, 2008, 11:52   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,406
Donated: $60
Nick will become famous soon enough
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.
Nick is offline   Reply With Quote
Old January 21, 2008, 15:10   #3
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
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).
zaimoni is offline   Reply With Quote
Old January 21, 2008, 17:36   #4
ElectricPaladin
Scout
 
Join Date: Jan 2008
Posts: 33
ElectricPaladin is on a distinguished road
Send a message via AIM to ElectricPaladin
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.
ElectricPaladin is offline   Reply With Quote
Old January 21, 2008, 20:10   #5
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
/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
EDIT: note that capitalization is vitally important here. Make absolutely sure that the '-R' and 'X' are capitalized while the rest of 'ugo+rw' is lower case./EDIT
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.
roustk is offline   Reply With Quote
Old January 21, 2008, 21:27   #6
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,947
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by ElectricPaladin View Post
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!
Are you running the game from Quicksilver or any other app launcher?

(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...)
takkaria is offline   Reply With Quote
Old January 21, 2008, 22:14   #7
ElectricPaladin
Scout
 
Join Date: Jan 2008
Posts: 33
ElectricPaladin is on a distinguished road
Send a message via AIM to ElectricPaladin
Nope. No app launcher.
ElectricPaladin is offline   Reply With Quote
Old January 21, 2008, 23:36   #8
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
EDIT: This dives deeply into the code. Skip as needed./EDIT

Quote:
Originally Posted by takkaria View Post
(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...)
I'm usually pretty good with unix, but the code in z-file.c gets fairly deep. Looking at 3.0.9 because that's what I have on my laptop.

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);
If I am following everything correctly, we have internal variables set as follows:
Code:
file=(char *)"~/Library/Preferences"
u=file+1
s=u
user[0]='\0'
u=user
u=getlogin()
On my 10.4 machine, launching Angband through the GUI means that it isn't bound to a terminal, so getlogin() will fail and u is a null pointer, so the path is determined from
Code:
pw=getpwuid(getuid())
getuid() is supposed to never fail to return the uid for the process, but if it did fail it would likely return 0 -- root. I would be tempted to say that if getuid()==0, we have an error and should quit.

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
roustk is offline   Reply With Quote
Old January 21, 2008, 23:54   #9
roustk
Adept
 
Join Date: Dec 2007
Posts: 167
roustk is on a distinguished road
Quote:
Originally Posted by ElectricPaladin View Post
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.
To double-check -- your savefile was in ~/Library/Preferences/Angband/save, right?

(That is, under your home directory, in Library, in Preferences, in Angband, in save.)

Quote:
Originally Posted by ElectricPaladin View Post
Nope. No app launcher.
Just for kicks, can you open a terminal and run the following command, while Angband is running?
Code:
ps -axcj
I'm looking for the line with "angband" on the right side, like below. It is likely the last entry with '??' in the TT column.
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%
What this will tell us is who the computer thinks is running angband (roustk) and the terminal it is associated with (?? -- none).

Kevin
roustk is offline   Reply With Quote
Old January 22, 2008, 03:39   #10
ElectricPaladin
Scout
 
Join Date: Jan 2008
Posts: 33
ElectricPaladin is on a distinguished road
Send a message via AIM to ElectricPaladin
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.
ElectricPaladin is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.