saved games lost on restart

Bug #1181847 reported by Shahar Or
260
This bug affects 1 person
Affects Status Importance Assigned to Milestone
astromenace (Ubuntu)
Fix Released
Undecided
Tehnick

Bug Description

It loses my games :o
Seriously.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: astromenace 1.3.1+repack-1
ProcVersionSignature: Ubuntu 3.9.0-2.6-generic 3.9.2
Uname: Linux 3.9.0-2-generic x86_64
ApportVersion: 2.10.1-0ubuntu1
Architecture: amd64
Date: Sun May 19 22:35:26 2013
EcryptfsInUse: Yes
InstallationDate: Installed on 2010-10-12 (950 days ago)
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
MarkForUpload: True
SourcePackage: astromenace
UpgradeStatus: Upgraded to saucy on 2013-05-07 (12 days ago)

Related branches

Revision history for this message
Shahar Or (mightyiam) wrote :
Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

Hello,

As I understood, the game didn't store your game progress at exit. Am I right?
Could you, please, attach AstroMenace console output.

Revision history for this message
Shahar Or (mightyiam) wrote :

Here you go.

Seems it can't open the file for saving.

Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

Looks like game can't store file by some reason (can't create file ~/.config/astromenace/amconfig.xml), or can't create ~/.config/astromenace folder.

Please, check your ~/.config and ~/.config/astromenace folders and its permissions. Please note, game must have enough rights for 1) create ~/.config/astromenace folder 2) create and rewrite ~/.config/astromenace/amconfig.xml file.

Note, game will not create XDG_CONFIG_HOME path, so, if you don't have ~/.config folder (in your case), please, create this one manual.

Revision history for this message
Shahar Or (mightyiam) wrote :

Michael,

I have ~/.config:

drwxr-xr-x 57 shahar shahar 12288 May 19 12:17 .config

Game should have enough rights. Perhaps this is a security issue with SELinux or something?

Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

I have same drwxr-xr-x on my Gentoo...

This is strange, because I tested game on fresh installed Ubuntu in VirtualBox, and don't find any security issue with ~/.config folder. Moreover, I usually use live-CD for test compilation from upstream SVN and game test to be sure that Ubuntu users could use upstream code for game compilation and launch.

Ok, could you please manually create ~/.config/astromenace (drwxr-xr-x permission should be fine). I am interesting, if game could create and rewrite ~/.config/astromenace/amconfig.xml file at all.

----------------------------------
I put related code here, just in case. Maybe, I do something wrong, and upstream code need correction.

1) ~/.config/astromenace creation code:

mkdir(ConfigDirName, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
where ConfigDirName set to "~/.config/astromenace"

2) ~/.config/astromenace/amconfig.xml creation code:

SDL_RWops *File = SDL_RWFromFile(ConfigFileName, "wb");
where ConfigFileName set to "~/.config/astromenace/amconfig.xml"

Revision history for this message
Shahar Or (mightyiam) wrote :

I just assumed it didn't create. Apparently, I do have a ~/.config/astromenace , which is empty. It was owned by root. I removed it and that solved the issue. I wonder why it was owned by root. only explanation I can think of is that I ran the game as root by mistake...

Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

Oh... I see. I was so focused on folders permission and forgot about possible wrong folder owner issue. -_-

Shahar Or (mightyiam)
Changed in astromenace (Ubuntu):
status: New → Invalid
Revision history for this message
Jouni Karlsson (nakkel) wrote :

Bumped to this problem myself.

"~/.config/astromenace/" is owned by root and the game has never been launched as root.

Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

Hmmm... this is really strange now. Unfortunately, I can't reproduce this issue... and don't have any ideas how this could by, since "~/.config/astromenace/" folder create by "mkdir" with "S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH" flags and this line is all code connected to this folder at all.

Shahar Or (mightyiam)
information type: Public → Private Security
Shahar Or (mightyiam)
Changed in astromenace (Ubuntu):
status: Invalid → New
information type: Private Security → Public Security
Revision history for this message
Seth Arnold (seth-arnold) wrote :

@Michael, I was able to reproduce this problem using the Saucy packaging in a Saucy VM (it doesn't exactly run well over VNC, but worked well enough to see the problem.)

Have you tried the Saucy packaging? or just try your local builds? The data package feels like a related piece of this puzzle to me..

Changed in astromenace (Ubuntu):
status: New → Confirmed
Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

At least, I got the idea what going on. So, what we have:

1) First at all - this is AstroMenace game bug, "~/.config/astromenace/" folder should not be created during game data file creation. I provide patch fix, upstream code will be corrected too.

2) The point is - Debian package create game data file during installation process under root, so, if you are using "su" (as I usually do), all should be fine, but with "sudo" you will have "~/.config/astromenace/" created by root in local user home folder (at least in Ubuntu).

Hope this help.

Revision history for this message
Shahar Or (mightyiam) wrote :

Thanks, Michael.

I assume that packaging policy forbids doing anything to user homes!

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "folder_owner.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Tehnick (tehnick) wrote :

> I assume that packaging policy forbids doing anything to user homes!

Yes, exactly.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Michael, does your patch fix the problem completely? Or are changes still required in the Debian/Ubuntu packaging?

Thanks

Revision history for this message
Mikhail Kurinnoi (viewizard) wrote :

Yes, patch fix the problem completely. No changes in packaging required.

Tehnick (tehnick)
Changed in astromenace (Ubuntu):
assignee: nobody → Tehnick (tehnick)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package astromenace - 1.3.1+repack-3

---------------
astromenace (1.3.1+repack-3) unstable; urgency=low

  * Add temporary patch debian/patches/08_do_not_touch_home_dir.patch:
    Without this patch AstroMenace creates directory ~/.config/astromenace/
    during generation of gamedata.vfs file. When sudo is used for package
    installation, this created directory is owned by root, so game settings
    cannot be saved by user. (LP: #1181847)
  * Add xz-utils to astromenace dependencies. (Closes: #714609)
  * Fix lintian note desktop-entry-lacks-keywords-entry.

 -- Boris Pek <email address hidden> Mon, 01 Jul 2013 22:02:35 +0300

Changed in astromenace (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers