malcontent/libeos-parental-controls
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
..
tests tests: Add comprehensive tests for libeos-parental-controls 2018-12-20 13:01:01 +00:00
app-filter.c lib: Cast integers of type uid_t to appropriate types for varargs 2018-12-21 13:58:50 +00:00
app-filter.h accounts-service: Add allow-user-installation setting 2018-11-29 21:16:36 +00:00
meson.build libeos-parental-controls: Add epc_app_filter_is_appinfo_allowed() API 2018-11-27 13:58:00 +00:00