diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-03-02 09:35:06 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-03-02 09:47:54 -0500 |
commit | 5e3966c99180abdcd1e21774a882f1c14c47aae8 (patch) | |
tree | 1a882b9d49f2c7ac25d70f0bbb644b5cefed6439 /server/sbus | |
parent | 6f5b1ad8c234d58041e45aef4558d50f44d7f021 (diff) | |
download | sssd-5e3966c99180abdcd1e21774a882f1c14c47aae8.tar.gz sssd-5e3966c99180abdcd1e21774a882f1c14c47aae8.tar.bz2 sssd-5e3966c99180abdcd1e21774a882f1c14c47aae8.zip |
Implement GetUserAttributes in the InfoPipe
This patch adds support for requesting user data in the sysdb via
the InfoPipe. It currently has support for reading defined entries
of integral, floating-point or string types.
Tasks remaining:
1) Implement call to the provider when cache is out of date
2) Support byte arrays for userpic and similar
I modified sysdb_search_ctx in sysdb_search.c to accept an array of
attributes to pass into the LDB search.
I also made one additional related fix: the btreemap now sorts in the
correct order. Previously I had accidentally transposed the two
values for sorting, so the map would always have been in exact
reverse order.
Diffstat (limited to 'server/sbus')
-rw-r--r-- | server/sbus/sssd_dbus.h | 2 | ||||
-rw-r--r-- | server/sbus/sssd_dbus_common.c | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h index 43519b3e..8dd0d3e3 100644 --- a/server/sbus/sssd_dbus.h +++ b/server/sbus/sssd_dbus.h @@ -126,4 +126,6 @@ DBusHandlerResult sbus_message_handler(DBusConnection *conn, void sbus_conn_send_reply(struct sbus_conn_ctx *conn_ctx, DBusMessage *reply); +int sbus_is_dbus_fixed_type(int dbus_type); +int sbus_is_dbus_string_type(int dbus_type); #endif /* _SSSD_DBUS_H_*/ diff --git a/server/sbus/sssd_dbus_common.c b/server/sbus/sssd_dbus_common.c index a9e0d816..e5011aa6 100644 --- a/server/sbus/sssd_dbus_common.c +++ b/server/sbus/sssd_dbus_common.c @@ -2,6 +2,7 @@ #include "tevent.h" #include "dbus/dbus.h" #include "util/util.h" +#include "util/btreemap.h" struct timeval _dbus_timeout_get_interval_tv(int interval) { struct timeval tv; @@ -43,3 +44,31 @@ void sbus_remove_timeout(DBusTimeout *timeout, void *data) { talloc_free(te); dbus_timeout_set_data(timeout, NULL, NULL); } + +int sbus_is_dbus_fixed_type(int dbus_type) +{ + switch (dbus_type) { + case DBUS_TYPE_BYTE: + case DBUS_TYPE_BOOLEAN: + case DBUS_TYPE_INT16: + case DBUS_TYPE_UINT16: + case DBUS_TYPE_INT32: + case DBUS_TYPE_UINT32: + case DBUS_TYPE_INT64: + case DBUS_TYPE_UINT64: + case DBUS_TYPE_DOUBLE: + return true; + } + return false; +} + +int sbus_is_dbus_string_type(int dbus_type) +{ + switch(dbus_type) { + case DBUS_TYPE_STRING: + case DBUS_TYPE_OBJECT_PATH: + case DBUS_TYPE_SIGNATURE: + return true; + } + return false; +} |