Commit Graph

164 Commits

Author SHA1 Message Date
Andre Moreira Magalhaes 2846db6529 malcontent-client: Refactor logic to determine type of argument for check/set
Note that this change breaks backward compatibility when handling
flatpak refs/IDs if the passed argument also resolves to a valid path,
in which case an exception will be raised.

Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
2019-06-14 15:55:27 +00:00
Andre Moreira Magalhaes 6c7c386ce2 malcontent-client: Disambiguate usage of path
The cmdline arguments may refer to both paths or flatpak refs so lets
disambiguate here for clarity.

Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
2019-06-14 15:55:27 +00:00
Andre Moreira Magalhaes 3800cd3818 libmalcontent: Add tests for filtering by content type
Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
2019-06-14 15:55:27 +00:00
Andre Moreira Magalhaes da0e63fe99 libmalcontent: Add support for filtering by content type
This is useful for example if blacklisting all apps that can
handle certain content types is desired.

Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
2019-06-14 15:55:27 +00:00
Andre Moreira Magalhaes bbd1b2bdff libmalcontent: Rename app filter paths_blacklist member to blacklist
The filter blacklist also holds information on flatpak refs that are
blacklisted (apart from paths), so lets rename it for clarity.

Signed-off-by: Andre Moreira Magalhaes <andre@endlessm.com>
2019-06-14 15:55:27 +00:00
Philip Withnall 80288aa05a Merge branch 'accounts-service-iface' into 'master'
tests: Use gdbus-codegen to drop hand-coded interface definitions

See merge request pwithnall/malcontent!2
2019-06-13 15:43:49 +00:00
Philip Withnall 418b79ab7f tests: Use g_assert_cmpvariant() from GLib 2.60
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-13 16:40:52 +01:00
Philip Withnall d9acee829a tests: Use gdbus-codegen to drop hand-coded interface definitions
Bump our GLib dependency to 2.60 so we can use `gdbus-codegen
--interface-info-{body,header}` to generate interface definitions
dynamically rather than hand-coding them.

We actually need to depend on 2.60.1 so we get
https://gitlab.gnome.org/GNOME/glib/merge_requests/721.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-13 16:40:52 +01:00
Philip Withnall a95ae0c182 ci: Temporarily disable code coverage support
lcov in F30 doesn’t support gcc in F30, which seems like a fairly
massive oversight.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-13 16:40:52 +01:00
Philip Withnall cc53f88d8d ci: Switch from Debian unstable to Fedora 30
Fedora has GLib ≥2.60.1, which we’ll need in an upcoming commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-13 16:34:14 +01:00
Philip Withnall c96ca4575c Merge branch 'docs' into 'master'
Improve README coverage of whole system design

See merge request pwithnall/malcontent!14
2019-06-12 16:11:18 +00:00
Philip Withnall be12b67e7a docs: Add missing dependency to README
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-12 07:54:59 +01:00
Philip Withnall 027ff10cc9 docs: Expand README coverage of how the whole system is designed
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-12 07:54:39 +01:00
Philip Withnall bb36bf65c6 Merge branch 'quiet' into 'master'
Implement --quiet in the check and set subcommands of malcontent-client

See merge request pwithnall/malcontent!13
2019-06-11 14:02:55 +00:00
Philip Withnall 4051a0292a malcontent-client: Implement --quiet for set subcommand
While not entirely quiet on error, the `set` subcommand is now quieter.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-11 15:01:08 +01:00
Philip Withnall b14fa7b056 malcontent-client: Implement --quiet for check subcommand
When run with `--quiet`, the `check` subcommand will now print nothing.
It continues to exit with an appropriate exit status.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-06-11 15:00:26 +01:00
Philip Withnall af44861281 Merge branch 'missing-field-initializers' into 'master'
libmalcontent: Add missing field initialisers to BUILDER_INIT

See merge request pwithnall/malcontent!12
2019-05-15 13:34:03 +00:00
Philip Withnall 432ba58f74 build: Enable -Wmissing-field-initializers
So we don’t regress on the previous commit in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-15 14:31:44 +01:00
Philip Withnall 30cbeda0ae libmalcontent: Add missing field initialisers to BUILDER_INIT
This fixes use of libmalcontent in projects which build with
`-Wmissing-field-initializers`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-15 14:31:02 +01:00
Philip Withnall 916022af9c Release version 0.3.0
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-29 15:24:13 +01:00
Philip Withnall 6df7596b23 Merge branch 'top-level-header' into 'master'
libmalcontent: Add a top-level header file

See merge request pwithnall/malcontent!11
2019-04-25 15:58:26 +00:00
Philip Withnall ad45f2813b libmalcontent: Add a top-level header file
This just simplifies including the malcontent headers from projects
which use it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-25 16:56:02 +01:00
Philip Withnall 126190a6a9 Merge branch '1-change-signals' into 'master'
libmalcontent: Add MctManager::app-filter-changed signal

Closes #1

See merge request pwithnall/malcontent!10
2019-04-24 12:47:55 +00:00
Philip Withnall f49e0ecfc0 malcontent-client: Add a ‘monitor’ mode to monitor app filter changes
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-24 13:45:59 +01:00
Philip Withnall 2048f0d483 libmalcontent: Add MctManager::app-filter-changed signal
This is emitted when the app filter for a given user changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.freedesktop.org/pwithnall/malcontent/issues/1
2019-04-24 13:45:59 +01:00
Philip Withnall 68ebe8b568 libmalcontent: Factor getting/setting app filter into a manager
Create a new MctManager object which is used as the anchor for getting
or setting MctAppFilters.

This changes the API naming around quite a bit, but doesn’t really
change its behaviour or functionality — see the tests for examples of
how little things change.

This is one step on the way to emitting a signal (from MctManager) when
a user’s parental controls change.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.freedesktop.org/pwithnall/malcontent/issues/1
2019-04-24 13:45:59 +01:00
Philip Withnall 388dedbff2 Merge branch 'all-disabled' into 'master'
libmalcontent: Add MCT_APP_FILTER_ERROR_DISABLED error

See merge request pwithnall/malcontent!9
2019-04-24 10:13:02 +00:00
Philip Withnall 9fb9b75b57 libmalcontent: Drop an unused variable
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-24 11:06:28 +01:00
Philip Withnall a378e28237 libmalcontent: Add MCT_APP_FILTER_ERROR_DISABLED error
This indicates that app filtering is disabled globally, perhaps because
it’s not installed in accountsservice properly.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-24 11:06:28 +01:00
Philip Withnall 9c31a3462a Merge branch 'docs' into 'master'
docs: Expand README to be more informative

See merge request pwithnall/malcontent!8
2019-04-02 16:51:30 +00:00
Philip Withnall a4f5cdd1d0 docs: Expand README to be more informative
Include various architectural-level details of the project.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-04-02 17:49:00 +01:00
Philip Withnall a1d1d307f1 Merge branch 'version-bump' into 'master'
build: Post-release version bump

See merge request pwithnall/malcontent!7
2019-03-19 18:25:59 +00:00
Philip Withnall 85f24df835 build: Post-release version bump
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-19 18:11:29 +00:00
Philip Withnall fb1d43428b Merge branch 'add-flags' into 'master'
lib: Change allow_interactive_authorization bool to flags

See merge request pwithnall/malcontent!6
2019-03-19 17:09:30 +00:00
Philip Withnall 3f3bb6ee54 lib: Change allow_interactive_authorization bool to flags
This is an API break for the mct_{get,set}_app_filter() APIs, but makes
them a bit clearer to use, and a little more future proof.

This includes updates to all the tests and documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-19 16:56:58 +00:00
Philip Withnall c627fbc9b8 Merge branch 'news-fix' into 'master'
docs: Fix NEWS entry

See merge request pwithnall/malcontent!5
2019-03-14 17:15:06 +00:00
Philip Withnall f332e7e5f4 docs: Fix NEWS entry
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-14 15:19:53 +00:00
Philip Withnall 6a0bebf2d0 Merge branch 'release' into 'master'
Release version 0.2.0

See merge request pwithnall/malcontent!4
2019-03-14 15:16:39 +00:00
Philip Withnall 3e78851238 Release version 0.2.0
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-14 13:11:19 +00:00
Philip Withnall e000f2ab6c Merge branch 'rename' into 'master'
Rename project

See merge request pwithnall/malcontent!1
2019-02-27 10:22:19 +00:00
Philip Withnall 0447d5e1f7 ci: Add CI configuration
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-27 10:14:52 +00:00
Philip Withnall 6ff0d7225b build: Bump version number to 0.2.0
To differentiate it from the pre-rename version number, 0.1.0.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-26 17:48:19 +00:00
Philip Withnall e22986d75c docs: Port README to Markdown and update a few references
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-26 17:48:03 +00:00
Philip Withnall 03436eacf5 Rename project from eos-parental-controls to malcontent
Rename the library from libeos-parental-controls to libmalcontent, and
the client from eos-parental-controls-client to malcontent-client.

This was done using the following mechanical edits, and no other
changes:
```
git search-replace -f EPC///MCT
git search-replace -f Epc///Mct
git search-replace -f epc///mct
git search-replace -f eos_parental_controls///malcontent
git search-replace -f eos-parental-controls///malcontent
git search-replace -f EosParentalControls///Malcontent
git search-replace -f 'eos\\-parental\\-controls///malcontent'
git search-replace -f 'Since: 0.1.0///Since: 0.2.0'
```

Note that the accounts-service extension interface has *not* been
renamed, as that would revert people’s parental controls settings in
existing deployments.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-26 17:45:14 +00:00
Philip Withnall c9889a3ce7 docs: Fix homepage link
We’re now hosted at
https://gitlab.freedesktop.org/pwithnall/malcontent.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-26 17:34:45 +00:00
Philip Withnall f872504b41 debian: Drop Debian support
This a relic from being hosted in Endless’ GitHub, and being built
directly for Debian. There’s no need to carry this upstream —
distributions can add their own packaging as needed.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-02-26 17:33:44 +00:00
Philip Withnall ba9f7f593b
Merge pull request #22 from endlessm/T23897-polkit-rules
accounts-service: Add polkit .rules file to stop prompting admins
2019-01-08 11:25:13 +00:00
Philip Withnall f0bb0c9cb9 accounts-service: Add polkit .rules file to stop prompting admins
When logged in as an administrator, and editing other user accounts in
gnome-control-center, polkit keeps popping up authentication dialogues
to read or change other users’ parental controls data. That shouldn’t be
necessary since we’re an admin user, and it’s not a critical enough
action to need to prompt the admin to re-authenticate to make sure they
really want to make such changes.

Add a .rules file to squash the polkit prompts for reading other users’
parental controls. Keep the default policy of auth_admin_keep for
changing our/others’ parental controls, since that should be handled by
the ‘Unlock’ button in g-c-c.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T23897
2019-01-07 15:33:18 +00:00
Philip Withnall b7ec7127c7
Merge pull request #20 from endlessm/T24016-arm-fixes
lib: Cast integers of type uid_t to appropriate types for varargs
2018-12-21 14:00:38 +00:00
Philip Withnall 5262658d48 lib: Cast integers of type uid_t to appropriate types for varargs
When querying for the details of a particular user by their UID, we call
accountsservice over D-Bus. Its API takes a gint64 variant, which we
build using g_variant_new(), which takes varargs. Passing an integer of
type uid_t in the varargs works fine on 64-bit architectures, where
uid_t is 64-bit, but not on other architectures, where it’s likely
32-bit. In that case, g_variant_new() will still read 64 bits from the
varargs input, even though the caller only put 32 on there. The rest
will be filled with rubbish.

Fix that by explicitly casting the uid_t to gint64 in the varargs. Fix a
few other areas where uid_t variables are passed to functions which
might interpret them as a different kind of integer too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://phabricator.endlessm.com/T24016
2018-12-21 13:58:50 +00:00