Commit Graph

284 Commits (52178851087fff5a56830112d82a6438ceb5d245)

Author SHA1 Message Date
Alexander Larsson 578d2cc9cf bwrap: Use --unshare-user-try
This makes the user ns optional, as it is not supported everywhere.
For instance Arch disables it by default.
2016-05-23 09:10:39 +02:00
Alexander Larsson 910328e535 Support no-deploy and no-pull via system helper 2016-05-20 13:30:50 +02:00
Alexander Larsson 24d4b60f60 Fix build if SCMP_ARCH_AARCH64 not defined 2016-05-20 11:07:34 +02:00
Alexander Larsson e020803554 utils: remove_dangling_symlinks() - fix leak
We were not freeing the iterator.
2016-05-18 13:42:58 +02:00
Alexander Larsson 3d232bbe15 Merge pull request #161 from smcv/spelling
Fix various spelling mistakes
2016-05-17 17:51:20 +02:00
Alexander Larsson b697a78dd3 system-helper: Support running unprivileged on session bus
This is only useful for testing.
2016-05-17 13:06:59 +02:00
Simon McVittie a4641280a7 Fix various spelling mistakes
Mostly detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@debian.org>
2016-05-17 11:43:32 +01:00
Alexander Larsson 18992c2fa0 Look at FLATPAK_SYSTEM_DIR env var for default system dir
This is useful for testing
2016-05-17 11:55:41 +02:00
Alexander Larsson 251dcdb680 system-helper: Never use a system helper recursively 2016-05-17 11:54:44 +02:00
Tristan Van Berkom b13fc460df flatpak-run.c: Handle arm and aarch64 arches
Allows 32bit applications to run in the sandbox on a 64bit aarch64 host.

https://bugs.freedesktop.org/show_bug.cgi?id=95421
2016-05-16 16:28:55 +02:00
Alexander Larsson d1d73bd2b2 run: Remove old seccomp arch code
There was a merge error when we switched to bubblewrap, this
code was replaced with the code that only adds the target
arch, but we forgot to remove this old code.
2016-05-16 10:45:27 +02:00
Alexander Larsson 90c909a932 Fix clang warnings 2016-05-13 16:26:47 +02:00
Alexander Larsson 1504f7bd7f system-helper: Support add/modify/delete of remotes 2016-05-13 16:23:43 +02:00
Alexander Larsson 2875cdead5 remote-delete: Move to FlatpakDir and add checks for installed refs
You can't remove a remote unless you --force or there are no installs
from it.
2016-05-13 14:17:46 +02:00
Alexander Larsson 753cdc97fd Fix typo: flatpak_dir_modify_remove -> flatpak_dir_modify_remote 2016-05-13 13:59:48 +02:00
Alexander Larsson 392f80a4aa FlatpakDir: Add in-memory summary cache
Remote summary files are cached for 5 minutes.
2016-05-13 13:15:45 +02:00
Alexander Larsson fa6e6c51ef Duplicate ostree_repo_remote_list_refs in FlatpakDir
This way we can later add a local summary cache to it.
2016-05-13 11:32:40 +02:00
Alexander Larsson 0098164cd6 Register dbus errors for FLATPAK_ERROR
This allows us to transparently pass them from the system helper.
2016-05-12 22:03:42 +02:00
Alexander Larsson 29390fff39 Change portal error names to not contain Flatpak 2016-05-12 22:03:09 +02:00
Alexander Larsson 5407b8efc6 system-helper: Support uninstall 2016-05-12 21:23:36 +02:00
Alexander Larsson 3964504438 Fix triggers with installation dir on a symlink 2016-05-12 21:16:40 +02:00
Alexander Larsson fe0a1be5f8 common: Add flags for flatpak_dir_uninstall
This is better than a list of booleans.
2016-05-12 19:52:48 +02:00
Alexander Larsson c5e178f339 Use flatpak_dir_uninstall for app and lib 2016-05-12 17:18:14 +02:00
Alexander Larsson 712fc9fc08 Use the installed/not-installed errors more consequently 2016-05-12 17:17:27 +02:00
Alexander Larsson 2ef6d9d5d9 common: Remove FlatpakDirError in favour of FlatpakError from the lib 2016-05-12 16:43:16 +02:00
Alexander Larsson e23bc2b7a6 Move flatpack_error quark to common so that the common code can use it 2016-05-12 16:33:48 +02:00
Richard Hughes 5ff8a00078 Show the error when we fail to build AppStream metadata 2016-05-12 11:07:30 +02:00
Alexander Larsson 14f58fc4b9 system-helper: Fix timeout setting 2016-05-12 09:14:30 +02:00
Alexander Larsson 9c01fb93aa system-helper: Set infinite timeout when doing system-helper calls 2016-05-12 08:59:25 +02:00
Alexander Larsson 47bb7e2b2e Don't fail if there is no user-dirs.dirs
Based on patch from tristan

https://bugs.freedesktop.org/show_bug.cgi?id=95339
2016-05-12 08:45:40 +02:00
Alexander Larsson 9e4bb25b2c modify-remote: Move the actual config rewriting to FlatpakDir
This is in preparation for doing this in the system helper.
2016-05-11 15:43:40 +02:00
Alexander Larsson e6f6959afb run: Last fd issue??? 2016-05-11 15:41:49 +02:00
Alexander Larsson edcf485dde run: More background fd issues fixed
This also simplifies the child_setup func by clearing CLOEXEC
on the needed fds.
2016-05-11 15:33:49 +02:00
Alexander Larsson 7d7e5c3bf9 run: Also keep the --args fd alive 2016-05-11 15:23:29 +02:00
Alexander Larsson 3f71025497 run: Fix running in the background
We need to keep all the fd:s needed for bubblewrap alive, so
neuter g_spawn_async:s close of fds and do our own.

Also, we need this so these fds can be closed in the launching app.
2016-05-11 15:14:11 +02:00
Alexander Larsson 4f6a2d5cd7 deploy: Ensure deploy dir is world readable 2016-05-11 13:55:33 +02:00
Alexander Larsson 4da7dc4742 appstream: Generate root dir of appstream branch world-readable 2016-05-11 12:23:55 +02:00
Alexander Larsson 1877f0be8d system-helper: Add support for updating appstream branch 2016-05-11 10:35:24 +02:00
Alexander Larsson d62127a437 run: Always cover /tmp/.X11-unix with an empty tmpfs
This way --filesystem=/tmp doesn't grant full access to the X sockets.
2016-05-10 10:53:24 +02:00
Alexander Larsson 4f9ea6bb57 Remove unused variables
This fixes warnings from clang
2016-05-09 12:49:54 +02:00
Alexander Larsson 5e9b247d26 Migrate ~/.local/share/xdg-app to ~/.local/share/flatpak 2016-05-09 12:21:28 +02:00
Alexander Larsson 8abbc0186e Rename everything but the on-disk location to flatpak 2016-05-09 11:11:55 +02:00
Alexander Larsson ba37b22d78 Rename library to libflatpak 2016-05-09 09:46:26 +02:00
Alexander Larsson c24528d369 Rename source files to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 6a613d1fab Rename all non-autogenerated symbols to flatpak 2016-05-09 09:00:20 +02:00
Alexander Larsson 1ffdf27d92 uncruftify: Initial run, all non-problematic changes 2016-05-06 16:03:27 +02:00
Alexander Larsson de9fe1cb6a common: Work around new glib codegen autogenerating g_autoptr support
glib master generates g_autoptr support, which causes a multiple
declaration conflict. We work around this by using a custom type.
2016-05-04 09:10:11 +02:00
Alexander Larsson 131961644d Use the userspace arch as the default, not the kernel arch
Its not super uncommon to e.g. have a 64bit kernel with 32bit userspace.
So, we default to the arch xdg-app was built for, rather than what
uname reports (the kernel version).
2016-05-04 09:00:12 +02:00
Alexander Larsson 663cfcf3a8 Fix make check if uninstalled
This uses various environment variables set during make check
to find the trigger, bwrap and xdg-app-dbusproxy from the build/source dir
rather than the installed location.
2016-05-03 10:27:36 +02:00
Alexander Larsson 5e06e18e6a run: Always use --unshare-user
This is the default if bwrap is unprivileged, but we want to use
it also if its setuid.
2016-04-29 16:12:54 +02:00
Alexander Larsson f55bb0edc9 Remove xdg-app-helper 2016-04-29 15:52:47 +02:00
Alexander Larsson 4c3bf179e2 Use bubblewrap instead of xdg-app-helper
Bubblewrap is a new tool from project atomic. Its similar to the old
xdg-app-helper, but even more minimal, and a bit more generic. Its designed
to be easy to git submodule install, but at some point we will probably
support using the system installed version too.

Using bubblewraps lets us share the load of security mainainance and
allows other people to use bubblewrap to do their own unprivileged
sandboxes.
2016-04-29 15:52:44 +02:00
Alexander Larsson f37b3261d6 Add support for disabled remotes
If this is set we don't list them by default, and we don't
automatically update apps from them.
2016-04-27 13:39:34 +02:00
Alexander Larsson e471231414 common: Remove unused xdg_app_dir_get_installed_size 2016-04-27 13:10:32 +02:00
Alexander Larsson ffb6670332 deploy: Deploy to temporary directory and rename at the end 2016-04-27 12:58:31 +02:00
Alexander Larsson 64669a9a96 common: Write and use the new deploydata file
Instead of separate "origin", "subpaths" and eventually "installed-size"
files we store a single (extensible) gvariant with all this info, which
means we need to seek less to get it.

Also, we move this file into the deploy dir as some of the data
differs for each deploy, and that way we can rely on the the active
symlink to make the update atomic.
2016-04-27 12:41:41 +02:00
Alexander Larsson b8b3d319d4 common: Add xdg_app_variant_save 2016-04-27 12:33:47 +02:00
Alexander Larsson 74c0689843 commont: Add deploy data GVariant
This is a single file for the per-deploy data in the deploy dir.
We want this so we can avoid stat:ing a lot of separate files to get
data like origin, subpaths and eventually cached installed size.
2016-04-27 11:49:39 +02:00
Alexander Larsson be71ceb31f xdg_app_dir_get_installed_size: Implement without using ostree sizes
This is slightly slower, but actually works since we stopped
collecting sizes in the commits. Further work will make this more performant.
2016-04-27 10:02:49 +02:00
Alexander Larsson 02c3cae33f xdg_app_repo_collect_sizes: Don't collect unrequested sizes. 2016-04-27 10:02:00 +02:00
Alexander Larsson 9624dd67da common: Export xdg_app_repo_collect_sizes 2016-04-27 09:41:14 +02:00
Alexander Larsson a304b786f4 installation_fetch_remote_size_sync: Always fail with deprecation error
This is not supported anymore since it was replaced with the summary cache.
Remove the code so nothing accidentally uses it.
2016-04-27 09:29:48 +02:00
Alexander Larsson 965530c143 helper: Don't try to mount /.oldroot into the sandbox
This will conflict with the internal .oldroot
2016-04-27 08:49:23 +02:00
Alexander Larsson eeece1a789 Merge branch 'privileged-helper' 2016-04-26 17:01:18 +02:00
Alexander Larsson 07e5b4a219 Move system-helper use into xdg_app_dir_install/update()
This way we don't need to keep state in XdgAppDir for the child
repo, which is not threadsafe.
2016-04-26 16:48:18 +02:00
Alexander Larsson 2a46f3277c Add xdg_app_dir_install/update helpers
These don't do much atm, but will let us clean up the child_repo handling
2016-04-26 16:24:09 +02:00
Alexander Larsson 64a28a9e7c XdgAppDir helper: Update system_helper threadsafely 2016-04-26 15:45:44 +02:00
Alexander Larsson 3ec67c57e6 xgd_app_dir_deploy_update: Use the shared system helper 2016-04-26 12:06:03 +02:00
Alexander Larsson 54af892f3a Use glnx_dirfd_iterator_next_dent_ensure_dtype where possible 2016-04-26 10:49:49 +02:00
Alexander Larsson d1788ae318 xdg_app_dir_init_system_helper: Properly pass the error in 2016-04-26 08:50:42 +02:00
Alexander Larsson 96d236a531 xdg_app_dir_pull_untrusted_local: Fix issues pointed out by cosimoc
Also, remove some spew
2016-04-26 08:50:07 +02:00
Alexander Larsson a7f5b57c75 Don't try to use system helper if its not installed 2016-04-25 19:48:17 +02:00
Alexander Larsson 2d74810cbc common: Add (and use) xdg_app_summary_lookup_ref helper 2016-04-25 18:59:17 +02:00
Alexander Larsson b2b05e1175 update/install: Handle deploy using the system service 2016-04-25 18:59:17 +02:00
Alexander Larsson 6af6d629a2 Initial work on pulling to a child repo 2016-04-25 18:59:17 +02:00
Alexander Larsson fee5d4d169 XdgAppDir: Add xdg_app_dir_pull_untrusted_local helper 2016-04-25 18:59:17 +02:00
Alexander Larsson ac517099eb utils: Add xdg_app_allocate_tmpdir 2016-04-25 18:59:17 +02:00
Alexander Larsson 4261057e2a common: Don't use singletons for the system/user XdgAppDirs
Without this we never finalize them and can't e.g. remote temporary
files.
2016-04-22 08:55:41 +02:00
Alexander Larsson 7d509ab93a Fix confusion about GError types
This was pretty mixed up. Also XdgAppError was not exported.
2016-04-21 20:59:30 +02:00
Alexander Larsson d314df07c1 Add xdg_app_dir_deploy_install helper 2016-04-21 20:59:26 +02:00
Alexander Larsson 91eda8919e common: Move duplicated code into xdg_app_dir_deploy_update 2016-04-21 20:19:01 +02:00
Alexander Larsson 21dd53d1ff common: Set ~/.local/share/xdg-app/system-cache as cache dir for system repo
This means we can use a summary cache for system wide stuff which causes
loads to be faster.
2016-04-21 18:54:15 +02:00
Alexander Larsson 351c2d5bd2 Read system remotes from /etc/xdg-app/remotes.d/*.conf 2016-04-21 18:47:11 +02:00
Alexander Larsson 29458bc154 Remove support for older ostree without bundle support
This is not needed when we depend on 2016.5
2016-04-21 18:34:28 +02:00
Alexander Larsson af03d2f5b4 Remove unused local variables reported by clang 2016-04-21 09:48:56 +02:00
Alexander Larsson 1838b1e9da common: Fix warning due to get_user_dir_from_string return type change 2016-04-21 09:39:55 +02:00
Alexander Larsson 4575d07661 run: Always consider xdg-* valid even when not configured
Before we would claim e.g. xdg-videos as invalid if the user didn't
configure the videos user directory.
2016-04-20 14:26:03 +02:00
Alexander Larsson 5392f2d629 common: Break out xdg_app_mtree_create_root helper 2016-04-20 09:55:13 +02:00
Alexander Larsson 1c1bc4acca common: Move xdg_app_dir_pull_from_bundle to xdg_app_pull_from_bundle
The only difference is it takes an OstreeRepo, not a XdgAppDir, so we
can use it at a lower level too.
2016-04-19 13:31:55 +02:00
Alexander Larsson 3d7d9ece93 Fix warning 2016-04-14 22:12:25 +02:00
Alexander Larsson 167564b637 common: Add xdg_app_dir_remote_fetch_summary
This is in preparation for adding a cache for the summary
2016-04-14 20:04:51 +02:00
Alexander Larsson b06528e0ef Merge pull request #127 from matthiasclasen/bus-logging
Bus logging
2016-04-14 19:30:57 +02:00
Alexander Larsson 1dd993cad6 lib: Add new cache based getters for metadata and size 2016-04-14 19:29:40 +02:00
Alexander Larsson 664fb128e7 utils: Remove unused helper 2016-04-14 19:29:18 +02:00
Alexander Larsson ca9bfc99b8 Use string for metadata cache 2016-04-14 19:18:11 +02:00
Matthias Clasen 4283473b38 Add options to enable bus logging
This can be useful to find out what bus names your app
is actually talking to, so you can set up a bus policy
that is narrowed than blanket access without breaking
your application.
2016-04-14 10:01:42 -04:00
Alexander Larsson 8d4393a7aa build-update: Add installed/download size and metadata cache to summary 2016-04-14 13:53:24 +02:00
Alexander Larsson 3187c0c142 appstream: Don't create new commit for unchanged appstream branch 2016-04-14 11:57:13 +02:00
Alexander Larsson 9ba4030564 Fix crash 2016-04-12 16:19:31 +02:00
Alexander Larsson ba0363bd2a Handle empty subpaths 2016-04-12 16:17:58 +02:00