#1 Cluster's ranking records.dat not found until first win

Open
opened 4 years ago by andreatsh · 11 comments

The cluster's ranking records.dat is not loaded until first win. The error is:

/home/andreatsh/.invaders/records.dat not found.

The cluster's ranking records.dat is not loaded until first win. The error is: /home/andreatsh/.invaders/records.dat not found.

If the program is used outside of the cluster, even after the first win the file will not be present. If I understood the code correctly, the program tries to create /home/150/invaders/records.dat if it is not present, and to symlink $HOME/.local/share/invaders/records.dat to it. If this program is intended only to run in lcm, this is probably ok; otherwise we need to allow the user to change the global directory, or to choose something more general (like /usr/local/games/invaders, which would probably require some attention to permissions).

If the program is used outside of the cluster, even after the first win the file will not be present. If I understood the code correctly, the program tries to create `/home/150/invaders/records.dat` if it is not present, and to symlink `$HOME/.local/share/invaders/records.dat` to it. If this program is intended only to run in lcm, this is probably ok; otherwise we need to allow the user to change the global directory, or to choose something more general (like `/usr/local/games/invaders`, which would probably require some attention to permissions).
blue commented 4 years ago
Owner

I could double-check, but it's faster and safer if @jp denies/confirms.

I could double-check, but it's faster and safer if @jp denies/confirms.
jp commented 4 years ago
Collaborator

The version we have on this repo is lcm-specific and I think it's ok to leave it this way. I'd have no problems moving the save to /usr/local/games but that'd require the admins' permission (the chosen directory would need to be made writable by all users).

As for the original issue, maybe we should check that the symlink exists on start and create it otherwise?

The version we have on this repo is lcm-specific and I think it's ok to leave it this way. I'd have no problems moving the save to /usr/local/games but that'd require the admins' permission (the chosen directory would need to be made writable by all users). As for the original issue, maybe we should check that the symlink exists on start and create it otherwise?

I am trying to work on that, but I have a couple questions.

The first one is related to permissions. In lcm I can't read /home/150/invaders/records.dat using, for example, cat. Nevertheless, invaders can still create a symlink to it and write on it. It doesn't seem to be run with stuid or setgid, so I don't understand how it is possible (I may be missing something obvious).

The second question is: is there a reason why we need the local symlink? Can't we just write to the global file?

Thank you

I am trying to work on that, but I have a couple questions. The first one is related to permissions. In lcm I can't read `/home/150/invaders/records.dat` using, for example, `cat`. Nevertheless, `invaders` can still create a symlink to it and write on it. It doesn't seem to be run with stuid or setgid, so I don't understand how it is possible (I may be missing something obvious). The second question is: is there a reason why we need the local symlink? Can't we just write to the global file? Thank you
Matteo Savatteri commented 4 years ago
Owner

Are you sure? Seems like you don't have search access to /home/150, by any mean. Can you provide something to prove your statement. Anyway I don't think /home/150 is the right place to keep records.dat.

Are you sure? Seems like you don't have search access to `/home/150`, by any mean. Can you provide something to prove your statement. Anyway I don't think `/home/150` is the right place to keep `records.dat`.
Matteo Savatteri commented 4 years ago
Owner

Are you sure your symlink doesn't point to /home/invaders/records.dat?

Are you sure your symlink doesn't point to `/home/invaders/records.dat`?
Matteo Savatteri commented 4 years ago
Owner

I think the best way to solve a bunch of issues is to install the same version of invaders found in this repo to LCM cluster and conduct our tests with it.

Regarding this specific issue:

matteosavatteri@king:~$ strings $(which invaders) | grep /home
/home/invaders/
/home/jp/Space/curses_invaders4.4.5
matteosavatteri@king:~$ strings $(which invaders) | grep /home
I think the best way to solve a bunch of issues is to install the same version of `invaders` found in this repo to LCM cluster and conduct our tests with it. Regarding this specific issue: ``` matteosavatteri@king:~$ strings $(which invaders) | grep /home /home/invaders/ /home/jp/Space/curses_invaders4.4.5 matteosavatteri@king:~$ strings $(which invaders) | grep /home ```
blue commented 4 years ago
Owner

I think the best way to solve a bunch of issue is to install the same version of invaders found in this repo to LCM cluster and conduct our tests with it.

Yes that's the goal. The requirement is to be sure that the two versions are compatible in terms of features, bugs and game difficulty (this last requirement is to make sure old high-scores will be compatible with new high-scores). We still have one bug here that is not present in LCM (fixed by #23) and we have the issue that bossrush here is much easier than in LCM for some reason.

> I think the best way to solve a bunch of issue is to install the same version of invaders found in this repo to LCM cluster and conduct our tests with it. Yes that's the goal. The requirement is to be sure that the two versions are compatible in terms of features, bugs and game difficulty (this last requirement is to make sure old high-scores will be compatible with new high-scores). We still have one bug here that is not present in LCM (fixed by #23) and we have the issue that bossrush here is much easier than in LCM for some reason.

@savo you are right, I was misled by the fact that the repo version uses /home/150/invaders. The version installed in lcm uses /home/invaders. That is probably a better place, even if it still remains lcm specific (which seem to be ok for our purposes). The only question now is whether we need the local symlink to the file.

@savo you are right, I was misled by the fact that the repo version uses `/home/150/invaders`. The version installed in lcm uses `/home/invaders`. That is probably a better place, even if it still remains lcm specific (which seem to be ok for our purposes). The only question now is whether we need the local symlink to the file.
Matteo Savatteri commented 4 years ago
Owner

I think we need a configuration file to let the user set different things e.g. The location of records.dat.

I think we need a configuration file to let the user set different things e.g. The location of `records.dat`.
blue commented 4 years ago
Owner

People, let's stay on topic: "Cluster's ranking records.dat not found until first win" :D

I think we need a configuration file to let the user set different things e.g. The location of records.dat.

We don't need a configuration file, but feel free to open an issue to request the feature.

People, let's stay on topic: "Cluster's ranking records.dat not found until first win" :D > I think we need a configuration file to let the user set different things e.g. The location of records.dat. We don't _need_ a configuration file, but feel free to open an issue to request the feature.
Sign in to join this conversation.
No Milestone
No assignee
5 Participants
Loading...
Cancel
Save
There is no content yet.