In case where the binary to be invoked is either not a shared library
object (e.g. it's a shell script) or when main() cannot be resolved
as shared library (because it hasn't been exported as such), instead
of abort()ing due to an uncaught exception, handle the exception and
print the error message in the log + on the console, and then fail.
We don't have a "boosted" group anymore, so the call fails.
Remove all code related to the failing call.
The re-classification for policy does not seem to be needed anymore?
And if it is indeed still needed, it probably doesn't work atm.
The old name was vague and didn't indicate the change in behavior at
all. Its documentation also described the behavior incorrectly. If the
-o or --keep-oom-score parameter is passed, the OOM score of the boosted
process will be unchanged. Normally, it will be reset to 0 on launch.
The --daemon-mode parameter is kept as an alias for compatibility.
This allows the application to look up its installation prefix (e.g.
/usr) by just looking at argv[0] and calculating relative paths from
there (previously one would need to pass the full path to invoker).
Previously, the user ID and group ID of the process was always set
to that of the application, if it differed from that of the invoker.
This commit adds simple privileges checking for the application
to determine whether or not it is allowed to access privileged
system information, before deciding to drop user ID or group ID.
This feature only encourages poor application interactivity: anything which is
sufficiently slow to require a splash screen should be made faster instead.
In addition to that, the feature is poorly implemented (X11-specific), and thus
useless. Rip it out, and remove the last dependency on X11 from applauncherd.
The tests in here have been in a completely non-working state for a very long
time, and it's now getting to a point where it hurts, rather than hinders
development. Nuke them from the tree.
In the future, the useful parts can be brought back easily from history.
Single-character booster types could potentially conflict when
using out-of-tree boosters, and quickly become confusing.
Old types are mapped for compatibility.
This is a compatibility-breaking change with boosters. The socketId
field is now expected to be a socket name, not a path. Sockets are
placed under ${XDG_RUNTIME_DIR}/mapplauncherd/, defaulting to /tmp/.
Invoker currently expects sockets in that path and named 'booster-X'
where X is the single character booster type. That is expected to
change when types are refactored to use full strings.
Having a single applauncherd process with boosters as plugins is a
flawed idea: most notably, it's not possible to have two boosters with
conflicting libraries, like Qt4 and Qt5.
A much cleaner solution is to turn libapplauncherd into a support
library for boosters, and have each booster run as an independent
process.
XDG_RUNTIME_DIR is tmpfs where HOME is just normal filesystem. We can avoid
some write operations to emmc when we do move these to tmpfs. Also
these files are something that should be reset on each boot anyway.
Signed-off-by: Marko Saukko <marko.saukko@jollamobile.com>