diff options
author | Stef Walter <stefw@redhat.com> | 2014-02-24 09:58:15 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-03-14 13:42:00 +0100 |
commit | 5bad17538eab85ce69e0355cd25b52b4a473cc36 (patch) | |
tree | 6b2601444417ee89470d64cb914ba09effea7a4f /src/providers/data_provider_be.c | |
parent | 64319158ab6a0e6df2bb03f4fde31668cceb082b (diff) | |
download | sssd-5bad17538eab85ce69e0355cd25b52b4a473cc36.tar.gz sssd-5bad17538eab85ce69e0355cd25b52b4a473cc36.tar.xz sssd-5bad17538eab85ce69e0355cd25b52b4a473cc36.zip |
providers: Fix types passed to dbus varargs functions
Fix some incorrect types passed to dbus_message_get_args(),
dbus_message_append_args() or functions accepting similar
varargs and types.
In particular sizeof(bool) != sizeof(dbus_bool_t) on most
platforms. This probably only worked because the compiler
was aligning stack variables and so writing off the end of
one of them wasn't the end of the world.
In addition fix cases where int != int32_t != uint32_t.
Although these will work on many common platforms, assuming
these are interchangeable is not cross platform safe.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/providers/data_provider_be.c')
-rw-r--r-- | src/providers/data_provider_be.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 5519237e8..5207d19eb 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -618,7 +618,7 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn) DBusError dbus_error; dbus_bool_t dbret; void *user_data; - bool force; + dbus_bool_t force; char *domain_hint; dbus_uint16_t err_maj; dbus_uint32_t err_min; @@ -841,6 +841,7 @@ static void acctinfo_initgroups_callback(struct be_req *be_req, struct be_initgr_prereq); DBusMessage *msg = NULL; dbus_bool_t dbret; + int num; int ret; pr->orig_dp_err_type = dp_err_type; @@ -864,11 +865,12 @@ static void acctinfo_initgroups_callback(struct be_req *be_req, goto done; } + num = pr->gnum; dbret = dbus_message_append_args(msg, DBUS_TYPE_STRING, &pr->user, DBUS_TYPE_STRING, &pr->domain, DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32, - &pr->groups, pr->gnum, + &pr->groups, num, DBUS_TYPE_INVALID); if (!dbret) { DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); |