aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2020-07-23Fix native compilationjellyfish_9.99.4jellyfish_9.99.3jellyfish_9.99.2jellyfish/9.99.4jellyfish/9.99.3jellyfish/9.99.29.99.49.99.39.99.2Scott Murray1-0/+1
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
2020-07-23Merge "Add wait for start jobs"Jan-Simon Moeller2-0/+66
2020-07-22Add wait for start jobsScott Murray2-0/+66
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
2020-07-11Fix labelling of files of widgetsJosé Bollo3-24/+131
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>
2020-05-28Fix uninstall of widgets without iconsScott Murray1-12/+14
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
2020-05-19Improve use of systemd's statesJosé Bollo4-57/+99
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>
2020-05-06afm-urun: Fix infinite loop on start statusJosé Bollo1-3/+6
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>
2020-02-28Add feature of autosigning widgetsJosé Bollo3-2/+107
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>
2020-02-28Refactor ALLOW_NO_SIGNATURE compile flagJose Bollo3-11/+23
Fix a tiny bug and minor improvements Bug-AGL: SPEC-2840 Change-Id: I9b74a8fd604980615d5669219cb5de801de61163 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2020-02-28Rename source files and improve readabilityJosé Bollo6-35/+59
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>
2020-02-14Remove distinction of widget's versionJose Bollo3-1/+20
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>
2020-01-08Update copyrightJosé Bollo65-70/+70
Change-Id: I1d68e07563d9f0f139d1bc8128e09a5da0a648af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-12-20wgtpkg-install: Fix allocation of IDsicefish_8.99.4icefish/8.99.48.99.4Jose Bollo1-3/+9
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>
2019-12-03Enforce numeric application IDsJosé Bollo5-60/+72
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>
2019-12-03wgtpkg-install: Add default permissionsJosé Bollo1-0/+14
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>
2019-06-14afm-user-daemon: Remove it by defaultJosé Bollo1-3/+5
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>
2019-05-23afm-user-session: moves in libexec directoryJosé Bollo1-1/+1
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>
2019-05-23Use definition of afm_prefixJosé Bollo2-12/+12
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>
2019-04-30Allow setting of libexec locationJosé Bollo1-1/+1
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>
2019-03-21Add ability to manage all widget/applicationsJosé Bollo5-65/+108
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>
2019-02-07Update date in copyrightssandbox/scottrif29/scottdocsJosé Bollo65-70/+70
Change-Id: Ie2ff321f78c59913373e2ffb2820297fd423d6f4 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2019-02-06wgtpkg-unit: Fix Segmentation faultJose Bollo1-4/+8
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>
2019-02-06wgtpkg-pack: Ensure packing relative filesJose Bollo2-3/+13
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>
2019-02-06wgtpkg-zip: Ensure zip will not complainJose Bollo1-2/+3
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>
2018-12-18afm-unit: Fix http port multi allocationJosé Bollo5-13/+29
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>
2018-12-18wrap-json: Upgrade to latest versionJosé Bollo2-51/+384
Change-Id: Iaaf302aa13650390bc8536f19187708dd67fa174 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-11-29wgtpkg-install: Improve port allocationguppy_6.99.2guppy/6.99.26.99.2José Bollo1-20/+58
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>
2018-11-21onappid: retrieves the 'appid' with id fieldguppy_6.99.1guppy/6.99.16.99.1Clément Bénier1-1/+1
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>
2018-11-05Treat correctly running/not running statusJosé Bollo2-3/+17
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>
2018-10-31afm-system-daemon: Improve error message reportJosé Bollo2-11/+14
Bug-AGL: SPEC-1872 Change-Id: I6e48baa05312b1490edd38ccf9231afe4aa6eb51 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-10-29Install afm-user-daemon with correct rightsJose Bollo1-1/+3
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>
2018-10-28afm-urun: Force scan of systemd unitsJosé Bollo1-13/+7
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>
2018-09-17wgtpkg-install: Force uninstallJose Bollo1-0/+11
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>
2018-08-16Add the external binding featureflounder_5.99.3flounder/5.99.35.99.3José Bollo3-0/+30
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>
2018-07-17wgtpkg-digsig: Add flag to accept/refuse a WGT without signatureJosé Bollo4-7/+14
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>
2018-07-17wgtpkg-digsig: Fix digital signature checkJosé Bollo1-1/+1
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>
2018-07-07wgtpkg-install: Fix SEGV when no icon in config fileflounder_5.99.2flounder/5.99.25.99.2José Bollo1-1/+1
Bug-AGL: SPEC-1573 Change-Id: I891c4edc3a7ded7848fe11cbc3ce3fe429650bf8 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-14afm-user-daemon: Update to future version of app-framework-binderJosé Bollo1-0/+5
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>
2018-06-14wrap-json: sync with upstreamJosé Bollo2-6/+103
Change-Id: Ie4e7e759c9bc2a745835b722c9d26e560608aedb Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-14afm-binding: use binding api v3José Bollo1-49/+109
Change-Id: Iac5140db95e473dc0954c70b5dc401380450e017 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-14afm-user-daemon: Update to binder changes for bindings v3José Bollo1-10/+16
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>
2018-06-14wrap-json: Update for y/YJosé Bollo2-12/+272
Change-Id: Idca99ad19d5b6cee92ee77e7f5583cb83f5c9c53 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-06-14afm-udb: refactor add_fields_of_contentjobol1-6/+15
Change-Id: Id59c92e18c7d3ed3fdd0df6dc2d46f64d58bdeee Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-06-14afm-udb: split read_unit_filejobol1-48/+60
Change-Id: I4189bcc04b0a889d7f83576ea4b535e00a745e22 Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-06-14afm-udb: improve commentjobol1-0/+3
Change-Id: Ibf639ffaccbcbffff367cec6e919cd516064ab9a Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-06-14afm-binding: fix authorjobol1-1/+1
Change-Id: Iefb2b248b5a9b85b89cd5181b3297fe4390ab149 Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-06-13afm-binding: Review of the permissionsjobol1-22/+49
Change-Id: I1d3a36c69768901f205a47385d124b6483e60638 Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-06-13afm-binding: Improve comment and stringsjobol1-4/+30
Change-Id: Ic70e2abf1301d11b0a610cdf5cfd783d21a5674f Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-04-05CMakeLists: Fix library directoriesjobol1-1/+7
Change-Id: Id9c86eb2385224d657ac69e1b7b5acd07bf6d71d Signed-off-by: jobol <jose.bollo@iot.bzh>
2018-04-05afm-udb: Fix corrupted memoryjobol1-1/+1
Change-Id: Ib78b0843f819f232b05ac45124fe888c784f65d4 Signed-off-by: jobol <jose.bollo@iot.bzh>