Age | Commit message (Collapse) | Author | Files | Lines |
|
The use of nanosleep in the previous job wait change fails to build
for me when building af-main-native, so add the required #include of
time.h. It's not clear to me right off why it actually built for the
target without it, that behavior difference may warrant some further
investigation.
Bug-AGL: SPEC-3365, SPEC-3427, SPEC-3457
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I73203e564c96d3eaea250ce8867149f6a155ec07
|
|
|
|
The systemd job to start an application unit may remain queued long
enough after a call into the systemd D-Bus API that the subsequent
state check sees the unit as still inactive. This results in the
application start being incorrectly reported as having failed, when
it will still actually proceed once the job is dequeued and run in
systemd.
To fix this, checking of the state of the job object returned by the
start D-Bus calls has been added in the various wrapper functions in
src/utils-systemd.c. The timeout mechanism used in the new job_wait
helper function is based on the existing state checking logic of the
wait_state_stable function in src/afm-urun.c.
Bug-AGL: SPEC-3365, SPEC-3427, SPEC-3457
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I01077a4213944233506518869c3dc604bd40f693
|
|
Before that change any application could browse
content of other application.
This change fixes that unintended behaviour by setting
the installed files as private to the application.
This affects the Smack labels of the files that after
the change become the label of the application.
Conversely, it will now be necessarily to explicit
shared files. It happens in situation of resource
widgets, the one that provide a binding using the
feature urn:AGL:widget:provided-binding in config.xml.
The typical example is the widget for testing: afbtest.
The exported binding must be accessible by its clients.
But because it also use files that it provides, these
files must also be accessible by clients.
For that reason, the feature urn:AGL:widget:public-files
is introduced to config files, allowing a widget to make
part of its installed files public.
The installation logic is changed to handle correctly the
security manager that applies rights of directories to
files it contains. So the declaring directories and files
using the order of increasing path length ensures that
the expected rights are applied.
Bug-AGL: SPEC-3489
Change-Id: I933446a8c155a03d9b66767f1dda63aeaeb21eb1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Trying to uninstall a widget without an icon would remove the widget
files, but report an error, and the widget would not be removed from
the database until a reboot, preventing installation of a new version.
To fix this, the error handling in uninstall_widget has been reworked
to only explicitly return an error when the unlink of the icon file
fails for reasons other than the file not being present. This then
allows some code cleanup by removing the extra rc2 variable and fixing
some error checks where rc and rc2 were being mixed.
Bug-AGL: SPEC-3401
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ica4a91f41b2bd9e16e16dee4ce660f6fa1f7840b
|
|
A better handling of systemd state is need to treat
correctly transient states. That change includes:
- Management of states with numeric identifiers
instead of names
- Handling of the state "inactive" as a stable
state. Most of previous seen problems were coming
from that miss.
- Returning no error but also no info on the process
if it falled to "inactive" meaning that it stopped
quickly.
Bug-AGL: SPEC-3323
Change-Id: Ibf35eb6257c5583596d675cad0bec2869f5fd5f7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Ensure that there is no infinite loop when waiting
for the completion of a status.
Bug-AGL: SPEC-3323
Change-Id: I93537e9bbbe8ef357d112bea1cb6201e96d01ebf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This adds the ability to automatically sign the
widgets that are packaged.
This is done by defining in the environment of
the packaging process the variables
WGTPKG_AUTOSIGN_X=key-filepath[:cert-filepath]...
Where X is a number.
If such variable exist, signatures are generated
in the directory of the packaged or signed widget,
one for each variable, replacing any existing one.
Obviously, nothing is done if no such variable exist.
The generated signature file depends on X.
- 0 is for file author-signature.xml
- X is for file signature-X.xml
The program wgtpkg-pack automatically include that
behaviour by default. An option allows to remove it.
Bug-AGL: SPEC-2840
Change-Id: I00bc4a4d094f71b307e467f984f20d3d4cc3c7bd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Fix a tiny bug and minor improvements
Bug-AGL: SPEC-2840
Change-Id: I9b74a8fd604980615d5669219cb5de801de61163
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Also rename wgtpkg-installer tools as wgtpkg-install.
Shorter and obvious.
Bug-AGL: SPEC-2840
Change-Id: Ifed072bfef488700807613dd61875a30a4041d7a
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This removes the distinction between the different
versions of a widget. The boolean CMAKE option
DISTINCT_VERSIONS allows to switch between the two
possibilities:
DISTINCT_VERSIONS=OFF (default)
Widget installed in {afm_appdir}/{id}
Ids of applications have no version part: {id}
DISTINCT_VERSIONS=ON (legacy, old default)
Widget installed in {afm_appdir}/{id}/{ver}
Ids of applications have no version part: {id}@{ver}
Bug-AGL: SPEC-2538
Change-Id: I7cb54d4b296b740c553be8a627e66175107e5a4b
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: I1d68e07563d9f0f139d1bc8128e09a5da0a648af
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The framework wasn't correctly attributing application ids
because scanning existing applications was broken.
Bug-AGL: SPEC-3068
Change-Id: I01aa736c0ea072b5e4141fb5faa1981be81048ce
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
This change allows to index applications numerically.
This can be used for various purposes. One of it is
to compute the HTTP port.
Bug-AGL: SPEC-2968
Change-Id: I74531781f3a39d5d4b09eeb907f57f36822e38f0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Only one default permission is used now:
"urn:AGL:token:valid" that is used to check
token validity.
This adds in the cynagora database the rule
SMACKID * * urn:AGL:token:valid yes forever
That means that applications having a smack label
installed by the framework behave as if they have
a valid token, a token without any scope/permission
but just valid.
This is needed during the transition to token based
permission policy.
Bug-AGL: SPEC-2968
Change-Id: Ia5b1cc50e8308bfc29906346c5b159dca889519b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The daemon afm-user-daemon is deprecated.
To be cleaner, it is removed from the compilation
and the installation.
It is still kept a again for little time in the
unexpected case where it could be useful to compile
it.
Bug-AGL: SPEC-2437
Change-Id: Ifccee49eb14ceff5f7a78fb299260918a585bf93
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Having the binary 'afm-user-session' in /usr/bin
brings nothing. It is better to keep it in private
area.
Bug-AGL: SPEC-2367
Change-Id: I8ef517f599c02e18d8987278a6652a065ee6f0b6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The prefix of the URN for AGL features should be
settable.
Bug-AGL: SPEC-2436
Change-Id: I49e9634ebc6a280c28caa6e6764e543a7e78253c
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The location of the framework binding could not
be tuned but is fixed.
The default location is good but it is important
to be able to tune that location. This at least
has the good effect that the location is set at
one point in the build system instead of at multiple
points as today.
Bug-AGL: SPEC-2367
Change-Id: Ib06fdff56d1828eacd0d1f82c2e1308d0b36fa5e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
For system uses -like automatic testing-, it is
needed to include tha ability to list ALL installed
widgets and ALL running instance of installed
widgets.
This change adds the option -a or --all to the
commands 'list' and 'runners' for the purpose
of listing any installed widgets, even those
requiring to be hidden.
Example: afm-util ps -a
Bug-AGL: SPEC-2272
Bug-AGL: SPEC-1850
Change-Id: I216ec9c63efea1b3af58e1d2d7723d986e04551e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Ie2ff321f78c59913373e2ffb2820297fd423d6f4
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This fixes a segmentation fault raised when
uninstalling a widget. This regression was
introduced by the commit f8b0495.
Bug-AGL: SPEC-2144
Change-Id: Ie10eb97a4d2f2663d73f83b210ef2b17717ed2e6
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
When running external ZIP program, ensures that
the files are stored with a path relative to the
root directory by changing the directory first.
Also, tiny improvement in working directory handling.
Change-Id: I3470c6c933aea9cd93dac197ff7f5e8a0ed86b23
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
The invoked program ZIP may complain that the
target zip file is not valid. It happens either
when it is really invalid or when it is empty.
Change-Id: I8b123019175fab45c6539c1d5938656afd9c7643
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
When serveral targets were set in the widget file, the
framework allocated the same HTTP port to each. This
lead to impossibility to run all targets or to a
systemd conflict.
This should fix the issue by allocating an HTTP port for
each target installed by the widget. To achieves that goal,
the afm-unit.conf tag for the port is moved from
'#metadata.http-port' to '#metatarget.http-port'.
Bug-AGL: SPEC-2068
Change-Id: I5376d6f052e0ffc5c77cc80041528637777aed1e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Iaaf302aa13650390bc8536f19187708dd67fa174
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The algorithm that allocates ports is improved
by:
- allocating ports in the range 31000...32759
- avoiding systematic rescan
Change-Id: I72771cf3f361f4977edc7b59c75921e71f5b470b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
the value of id field shoud be a string not an integer
so {si} is replaced by {ss}
Change-Id: Ief8a1e56295085cfe818301fd0073399a3ae6315
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
|
|
Systemd returns 0 for services that don't run.
It wasn't checked well causing weird effect:
trying to terminate an application not running
killed afm-system-daemon because kill(0) kills
all processes of the group of the caller.
Bug-AGL: SPEC-1836
Change-Id: I1bd64faf871ecd42aaaa5449312e8b8cb26ee9dd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Bug-AGL: SPEC-1872
Change-Id: I6e48baa05312b1490edd38ccf9231afe4aa6eb51
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Install afm-user-daemon with rwx-r-xr-x instead
of --x--x--x as before.
Bug-AGL: SPEC-1846
Change-Id: Ie48d379f5f4cfe8ddf3192ebee85580b05e35b36
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
It was previously assumed that only launched units
had to be scanned. But it was buggy because the
uninstall/install of application rebuilds the database
without taking care of the running applications.
Nevertheless changing the behaviour of the rebuild
of application's database is not the best solution
for two reasons. The fist is that it will complicates
the code. The second, much better, is that it would
allow to track also applications launched automaticaly
-and/or manually in devel-.
Bug-AGL: SPEC-1836
Change-Id: I5fb2bb712ce43be9c851251be6b794a007b1ea6f
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This commit forces uninstall of the previous installed
version instead of reinstall to get around a bug in
cynara.
Bug-AGL: SPEC-1230
Change-Id: Id29fc59794aed7386e0a32df43f9fbacc25c0863
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
|
|
This commit introduce two new features:
<urn:AGL:widget:provided-binding>
<param "name"="public-name" "value"="relative-path-to-the-binding"/>
<urn:AGL:widget:required-binding>
<param "name"="public-name" "value"="extern">
<param "name"="relative-path-to-the-binding" "value"="local">
TODO: manage security by setting correct Smack label to the exported files
Bugs-AGL: SPEC-1439
Bugs-AGL: SPEC-1663
Change-Id: I70aad7d523ece7a2ae0058b79708a02ef81144e2
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
This flag allows with a single function to check the signature
and the case that a not signed widget is to be refused in the same
way that the signature is wrong.
The CMAKE boolean ALLOW_NO_SIGNATURE can be used to control
the default behavior at compile time. By default its value
is OFF meaning that install will refuse widgets without
signature.
Relates to Bug-AGL: SPEC-1590
Change-Id: I403109272759454696a1e5d9913879aaea7676e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The compute of the return code was wrong: it always
returned 0 even in case of error.
Installation of a widget with an error in its signature
was possible due to this error.
Bug-AGL: SPEC-1590
Change-Id: Ibefd74aafd6a00dea32e52d471460cbe08a380ab
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Bug-AGL: SPEC-1573
Change-Id: I891c4edc3a7ded7848fe11cbc3ce3fe429650bf8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
It will become necessarily to perform actions on behlf of the
client, not for its own credentials.
Change-Id: Ie2f50dd84df8b0b673772575f5c21ebec8a317f8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Ie4e7e759c9bc2a745835b722c9d26e560608aedb
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Iac5140db95e473dc0954c70b5dc401380450e017
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
The bindings v3 are now allowed to return an object with
errors. To enforce taking that change into account, the
signature of the object changed. It implies some change
in clients.
Change-Id: I810b625c7e3abec8dcce7fba44e3b4d7ac7f5473
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Idca99ad19d5b6cee92ee77e7f5583cb83f5c9c53
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
|
|
Change-Id: Id59c92e18c7d3ed3fdd0df6dc2d46f64d58bdeee
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: I4189bcc04b0a889d7f83576ea4b535e00a745e22
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: Ibf639ffaccbcbffff367cec6e919cd516064ab9a
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: Iefb2b248b5a9b85b89cd5181b3297fe4390ab149
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: I1d3a36c69768901f205a47385d124b6483e60638
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: Ic70e2abf1301d11b0a610cdf5cfd783d21a5674f
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: Id9c86eb2385224d657ac69e1b7b5acd07bf6d71d
Signed-off-by: jobol <jose.bollo@iot.bzh>
|
|
Change-Id: Ib78b0843f819f232b05ac45124fe888c784f65d4
Signed-off-by: jobol <jose.bollo@iot.bzh>
|