346d6d8bf5fdb446921d754c07c8a7d913a048d5 |
|
29-Jan-2018 |
René Genz <liebundartig@freenet.de> |
Fix minor spelling mistakes
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
a02a5ed51178b2cbede0396d66aed716b8898096 |
|
25-Oct-2017 |
René Genz <liebundartig@freenet.de> |
Fix minor spelling mistakes
Merges: https://pagure.io/SSSD/sssd/pull-request/3556
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
b1afef0bc8d98c389a7f71307bee8ef9fc991ced |
|
01-Feb-2017 |
Pavel Březina <pbrezina@redhat.com> |
SBUS: use sss_ptr_hash for signals table
This patch reuses sss_ptr_hash module introduced in NSS patches in sbus code.
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> |
ea872f140a04419fba3f2b9722da74d7fd1ca1ee |
|
01-Feb-2017 |
Pavel Březina <pbrezina@redhat.com> |
SBUS: use sss_ptr_hash for nodes table
This patch reuses sss_ptr_hash module introduced in NSS patches in sbus code.
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> |
a3b2bc38263191f23eba2ad98470d8ecd016a60b |
|
01-Feb-2017 |
Pavel Březina <pbrezina@redhat.com> |
SBUS: use sss_ptr_hash for opath table
This patch reuses sss_ptr_hash module introduced in NSS patches in sbus code.
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> |
bc898b360b9667195a7ae59537587c3ec696ac19 |
|
01-Feb-2017 |
Pavel Březina <pbrezina@redhat.com> |
SBUS: remove unused symbols
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> |
7622d9d97eb6747a9f3406633281f2492f8f4a0a |
|
23-Jan-2017 |
Fabiano Fidêncio <fidencio@redhat.com> |
SBUS: Add destructor data to sbus_connection
This additions has a very specific reason: unregister a service when
it's shutdown.
So far, we never had to do this kind of operation because the services
were started during SSSD's startup when finished when SSSD finished.
Now, with the socket-activation in place the game will be a little bit
different as the services will have an idle timeout and will be able
shut themselves down. In order to do it properly the monitor will need
to "unregister" the service and there's no way to do that without adding
this destructor data to the sbus_connection structure and introducing a
new function to access it from the monitor (where we're going to
set the destructor function to the sbus_connection for the
socket-activated services).
So far it's not being used anywhere as every function taking it as
parameter is just receiving NULL, but it will be used in the follow up
commits, by the monitor.
Related:
https://fedorahosted.org/sssd/ticket/3245
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
b46c4c0d3e364636af1b42683cd3229ffa0b77cb |
|
23-Jan-2017 |
Fabiano Fidêncio <fidencio@redhat.com> |
SBUS: Add a time_t pointer to the sbus_connection
The idea of this commit is to provide a way to update the time of the
last request coming from/going to the responders through sbus.
For now it's not used anywhere as all the functions that will pass their
time_t to the sbus_connection are currently passing NULL. It will be
used by follow-up patches.
Related:
https://fedorahosted.org/sssd/ticket/3245
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
d4aa049726ce8c6feeaf6995d4abb4cb5155b9a1 |
|
19-Jun-2015 |
Pavel Březina <pbrezina@redhat.com> |
sbus: listen to NameOwnerChanged
Resolves:
https://fedorahosted.org/sssd/ticket/2326
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
ae7247551b78a05a5397d3c790afad7ef51b0d9d |
|
19-Jun-2015 |
Pavel Březina <pbrezina@redhat.com> |
sbus: add support for incoming signals
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
f7adbb15dbdcb79e291f7cf361a400ce25f7b382 |
|
18-Jun-2015 |
Pavel Březina <pbrezina@redhat.com> |
SBUS: Add support for <node /> in introspection
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
46ee931314e6a5517f5c6b6b14f759364be119cc |
|
23-Jan-2015 |
Pavel Březina <pbrezina@redhat.com> |
sbus: support multiple interfaces on single path
This patch removes the old message handler which is replaced
with a new one that supports multiple interfaces registered
on single object path.
A hash table is used to store registered object paths and their
interfaces. When an entry or the table itself is destroyed,
registered object path is unregistered through delete callback.
It temporarily removes support of Introspect and Properties
standard D-Bus interfaces and disables unit tests of those
interfaces. The support is brought back by following patches.
Resolves:
https://fedorahosted.org/sssd/ticket/2339
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
d87e960c17d7598781cf032d06ba03a3ecadbfa2 |
|
23-Jan-2015 |
Pavel Březina <pbrezina@redhat.com> |
sbus: move iface and object path code to separate file
This is done to better distinguish between connection code and interface
stuff. It will help with orientation and thus simplify next changes.
Preparation for:
https://fedorahosted.org/sssd/ticket/2339
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
9fa95168d80beba04b333b06edc492ecb8b085a1 |
|
23-Jan-2015 |
Pavel Březina <pbrezina@redhat.com> |
sbus: add new iface via sbus_conn_register_iface()
Rename sbus_conn_add_interface() to sbus_conn_register_iface()
and remove sbus_new_interface() calls since it is just one more
unnecessary call outside the sbus code.
The function sbus_new_interface() is made static and used
directly in sbus_conn_register_iface().
The name was chosen to better describe what the function is
doing. That it registers an interface on a given object path.
The same interface can be used with different paths so it is
not really about adding an interface.
Preparation for:
https://fedorahosted.org/sssd/ticket/2339
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
aa871e019f00493dfa53b48f906132bf94eeae9f |
|
22-Oct-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Allow connections from other UIDs
Unless dbus_connection_set_unix_user_function() is used, D-Bus only
allows connections from UID 0. This patch adds a custom checker function
that allows either UID 0 or the pre-configured SSSD user ID.
Reviewed-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
886d29fced0bcc1668a3cb99a5bca66ea486b3a4 |
|
27-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Consolidate VTABLE_FUNC definitions in sssd_dbus_meta.h
We had several duplicated declarations of the VTABLE_FUNC macro in the
SSSD source code. This patch consolidates on one definition in
sssd_dbus_meta.h that is usable by all consumers, including the upcoming
GetAll method implementation.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
1319e71fd1680ca4864afe0b1aca2b8c8e4a1ee4 |
|
22-May-2014 |
Stef Walter <stefw@redhat.com> |
SBUS: Start implementing property access
This patch adds the basis of SBUS getters and setters. A new module,
sssd_dbus_properties.c would contain handlers for the property methods
like Get, Set and GetAll.
Type-safe property access works in a similar fashion like type-safe
method calls - the invoker calls the getter which returns the primitive
type, which is in turn marshalled into variant by the invoker.
This patch does not contain the complete functionality, see later
patches that continue implementing the getters and setters.
Reviewed-by: Stef Walter <stefw@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
2376eab65eef84eabb9ebb8796efa7a87f6a6c08 |
|
13-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Allow registering paths with fallback
Some interfaces we support, such as domain might not be bound to a
single path, but rather anything under a path 'directory'. This patch
allows the SBUS to register a fallback path that would route any
messages under a given anchor to a handler of an interface.
The fallback interface is denoted with a trailing wildcard:
/org/sssd/anchor/*
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
8d5d91878875fec2930b37ff79ef6bb6782faa65 |
|
13-May-2014 |
Pavel Březina <pbrezina@redhat.com> |
SBUS: remove unused variables
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
07976be2a09ebb1346c841d4a32e417a8bb43862 |
|
13-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Refactor sbus_message_handler to retrieve caller ID
sbus_message_handler() is refactored so that it only verifies the
message matches any of the interfaces SSSD listens on in order to be
able to return either of HANDLED or NOT_YET_HANDLED.
If the interface is one of those the SSSD should handle, the caller ID
is first resolved using sbus_get_sender_id_send and only then passed on
to the appropriate special handler.
If the sernder ID can't be retrieved, the message is dropped with an
error.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Stef Walter <stefw@redhat.com> |
0161a3c5637a0c0092bf54c436bb3d6508d7df26 |
|
13-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Add an async request to retrieve the caller ID
Adds an async request sbus_get_sender_id_{send,recv} that allows
retrieval of UID based on "sender" as returned by
dbus_message_get_sender().
The UID is an int64_t to be able to use "-1" to as a fallback value for
uknown or error cases.
The unit test is added as a standalone one, not part of the sbus_tests
because the request, and by extension the unit test relies on being
connected to the system bus, which is very unlikely to work in a build
system.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Stef Walter <stefw@redhat.com> |
b81ad4a7c59cade13d52216f805d904392627136 |
|
13-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Add SBUS_CONN_TYPE_SYSBUS
We need to retrieve caller IDs for each call from the system bus. This
commit adds a new SBUS connection type that identifies system bus
connection. The connection is used in the IFP provider.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Stef Walter <stefw@redhat.com> |
393099fb7caa2c128277e26ba3463aa7f95a0ebb |
|
13-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Split out dbus_conn_send
Split dbus_conn_send out of sbus_conn_send to be able to call DBus
messages without having a full sbus connection. This function is
available to the sbus code only, consumers of sbus (responders and
providers) should use sbus_conn_send.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Stef Walter <stefw@redhat.com> |
3d5908ed0faf400a5c7d9c3e4312597ee1b7786a |
|
13-May-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: several trivial style fixes
In SSSD we tend to use {} brackets around single-line blocks, too to
make sure we don't forget to add them should the block become larger.
We also don't add a space between function name and the opening "(".
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Stef Walter <stefw@redhat.com> |
dff909d473f43a6bd0f0286fa2d279c0ebe945c6 |
|
19-Apr-2014 |
Stef Walter <stefw@redhat.com> |
sbus: Add type-safe DBus method handlers and finish functions
Type safe method handlers allow methods not to have to do tedious
unwrapping and wrapping of DBus method call messages or replies.
Arguments of the following DBus types are supported in type-safe
method handlers. In addition arrays of these are supported.
y: uint8_t
b: bool (but no arrays, yet)
n: int16_t
q: uint16_t
i: int32_t
u: uint32_t
x: int64_t
t: uint64_t
d: double
s: char * (utf8 string)
o: char * (object path)
As an exception, arrays of booleans are not supported, but could be
added later. Other more complex types could be added later if desired.
If a method has other argument types, then it must be marked as having
a raw handler (see below).
Internally each method can have a type specific invoker function which
unpacks the incoming arguments and invokes the method handler with the
correct arguments.
Each method also has a finish which accepts the type-safe out arguments
(ie: return values) and builds the reply message. Like other request
'finish' functions, these free the request talloc context, and are to
be used in place of sbus_request_finish() or friends.
Raw method handlers parse their own method arguments, and prepare their
own reply (ideally using sbus_request_finish() helpers). They can also
do strange things like have variable arguments. To mark a DBus method
as having a raw method handler use the following annotation:
<annotation name="org.freedesktop.sssd.RawHandler" value="true"/>
Raw methods do not have invokers or finish functions.
I've left all of the internal peer to peer communication using raw
method handlers. No code changes here. |
7a9a6ee1b5f5479c3a6958401f9b34c571c3b6bf |
|
19-Apr-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Create an sbus_method_meta instance for Introspection
Also fixes a warning about uninitialized 'method' as the 'method'
variable was unused and not set previously when introspecting. |
42c28b9424b6ef8a0021b124773e171dd5defadd |
|
15-Apr-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SBUS: Generate introspection from the interface meta structure
https://fedorahosted.org/sssd/ticket/2234
This patch generates the introspection data from the sbus interface meta
structure. The generated XML conforms to
http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format
The XML description of the interface also always includes the
org.freedesktop.DBus.Introspectable interface, which this patch also allows
in the policy settings. |
07e941c1bbdc752142bbd3b838c540bc7ecd0ed7 |
|
14-Mar-2014 |
Stef Walter <stefw@redhat.com> |
sbus: Refactor how we export DBus interfaces
Most importantly, stop using per connection private data. This doesn't
scale when you have more than one thing exporting or exported on a
connection.
Remove struct sbus_interface and expand sbus_conn_add_interface()
function. Remove various struct sbus_interface args to connection
initialization functions and make callers use sbus_conn_add_interface()
directly. The old method was optimized for exporting one interface
on a connection. We'll have connections that export zero, one or more
interfaces.
To export an interface on a DBus server, call sbus_conn_add_interface()
from within the sbus_server_conn_init_fn. To export an interface on
a DBus client, call sbus_conn_add_interface() after sbus_new_connection()
returns.
As before struct sbus_interface represents an object exported via DBus.
However it is now talloc allocated. One can set instance data on the
struct sbus_interface. This instance data is passed to the various
handlers and used in their implementation.
However, we now have type safe interface exporting in the various
high level sss_process_init() sss_monitor_init() and so on.
Introspection support was not in use, and is now gone until we
implement it using the metadata (future patch).
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
d9577dbd92555b0755881e37724019ef9c578404 |
|
14-Mar-2014 |
Stef Walter <stefw@gnome.org> |
sbus: Add struct sbus_request to represent a DBus invocation
struct sbus_request represents a request from a dbus client
being handled by a dbus server implementation. The struct
contains the message, connection and method (and in the
future teh property) which is being requested.
In the future it will contain caller information as well.
sbus_request is a talloc memory context, and is a good place to
attach any allocations and memory specific to the request.
Each handler accepts an sbus_request. If a handler returns
EOK, it is assumed that the handler will finish the request.
Any of the sbus_request_*finish() methods can be used to
complete the request and send back a reply.
sbus_request_return_and_finish() uses the same argument
varargs syntax as dbus_message_append_args(), which isn't
a great syntax. Document it a bit, but don't try to redesign:
The marshalling work (will follow this patch set) will remove
the need to use varargs for most DBus implementation code.
This patch migrates the monitor and data provider dbus code
to use sbus_request, but does not try to rework the talloc
context's to use it.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
769347ad4d35d43488eb98f980143495b0db415d |
|
24-Feb-2014 |
Stef Walter <stefw@redhat.com> |
sbus: Rework sbus to use interface metadata and vtables
Previous commits added support for interface metadata and
handler vtables. This commit ports sbus_dbus_connection to
use them.
Port the internal uses of dbus to use the new scheme in a
very minimal way. Further cleanup is possible here.
This commit provides basic definitions of the internal
dbus interfaces. The interfaces aren't fully defined, as the
handlers will continue to unpack manually, and often overload
DBus methods with different arguments (which is rather
unorthodox, but not the end of the world).
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
83bf46f4066e3d5e838a32357c201de9bd6ecdfd |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Update DEBUG* invocations to use new levels
Use a script to update DEBUG* macro invocations, which use literal
numbers for levels, to use bitmask macros instead:
grep -rl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e 'use strict;
use File::Slurp;
my @map=qw"
SSSDBG_FATAL_FAILURE
SSSDBG_CRIT_FAILURE
SSSDBG_OP_FAILURE
SSSDBG_MINOR_FAILURE
SSSDBG_CONF_SETTINGS
SSSDBG_FUNC_DATA
SSSDBG_TRACE_FUNC
SSSDBG_TRACE_LIBS
SSSDBG_TRACE_INTERNAL
SSSDBG_TRACE_ALL
";
my $text=read_file(\*STDIN);
my $repl;
$text=~s/
^
(
.*
\b
(DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM)
\s*
\(\s*
)(
[0-9]
)(
\s*,
)
(
\s*
)
(
.*
)
$
/
$repl = $1.$map[$3].$4.$5.$6,
length($repl) <= 80
? $repl
: $1.$map[$3].$4."\n".(" " x length($1)).$6
/xmge;
print $text;
' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
a3c8390d19593b1e5277d95bfb4ab206d4785150 |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic
macro, supplying format string and its arguments directly, instead of
wrapping them in parens.
This script was used to update the code:
grep -rwl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e \
'use strict;
use File::Slurp;
my $text=read_file(\*STDIN);
$text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs;
print $text;' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
19b4bb652f5cdc2797b66595eaf8811881aa9873 |
|
22-Oct-2013 |
Jakub Hrozek <jhrozek@redhat.com> |
Include external headers with #include <foo.h>
I find it more readable to include headers from outside the sssd tree
with <foo.h>, not "foo.h". The latter should be used for in-tree headers
only. |
7b55e91d0909035e57fa2081a7dfd2bce42dc365 |
|
11-Sep-2013 |
Lukas Slebodnik <lslebodn@redhat.com> |
Fix pointer formatting |
6e8b4d412a9a28bb79f575b9970c3fd7876609ac |
|
06-Apr-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
Catch cases where D-Bus connection is NULL
https://fedorahosted.org/sssd/ticket/1270 |
e091bbd28c35fe8f916a15b4b0548f1b5419aab7 |
|
20-May-2010 |
Sumit Bose <sbose@redhat.com> |
Defer sbus_dispatch() for 30ms during reconnect |
9fbf00c7802719becd633ecbc45879d5d0ddb985 |
|
15-Mar-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Properly handle dbus send attempts on a closed connection
dbus_connection_send_with_reply() will report success and return
a NULL pending_reply when the connection is not open for
communication. This patch creates a new wrapper around
dbus_connection_send_with_reply() to properly detect this
condition and report it as an error. |
1c48b5a62f73234ed26bb20f0ab345ab61cda0ab |
|
18-Feb-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Rename server/ directory to src/
Also update BUILD.txt |