← Back to team overview

ubuntu-appstore-developers team mailing list archive

Re: Save data for click applications

 

On 08/23/2013 12:03 PM, Dave Morley wrote:
> Just came across this in an app in the standard queue so figured I'd
> ask how we intend to handle this in click.
> 
> Basically the game is installed in /opt/app-name/  the save data at
> the end of the level is set to write in the directory that the app is
> in.  Because the user is non-root the data can't save the
> /opt/app-name folder and crashes.
> 
> How will this be handled in click?  I would suggest at least
> documenting this somewhere so that the devs are aware upfront where
> and how we expect them to store data from their applications.
> Something like ~/.cache/click-apps/com.me.myapp/  would be my
> suggestion as a nice save file format but I thought I would ask as I
> hit it :)

From the application confinement specification[1]:

"Applications will always have read access to their install directory and have
write access to directories they own as determined by the XDG base directory
specification. Specifically: XDG_CACHE_HOME/<APP_PKGNAME>,
XDG_RUNTIME_DIR/confined/<APP_PKGNAME>, XDG_DATA_HOME/<APP_PKGNAME> and
XDG_CONFIG_HOME/<APP_PKGNAME>. Apps can discover these paths using standard APIs
and appending the package name as defined by the 'name' field of the manifest."

In addition, TMPDIR will be set to an application specific location.

[1]https://wiki.ubuntu.com/SecurityTeam/Specifications/ApplicationConfinement#Launching_applications

-- 
Jamie Strandboge                 http://www.ubuntu.com/

Attachment: signature.asc
Description: OpenPGP digital signature


References