b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
8752c5752f3b9023f9ce96a55d70c6e5fc31118f |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move more locale-related calls to locale-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out user/group/uid/gid calls into user-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
1e2527a6fede996a429bd44b30a15e76ee293437 |
|
05-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
hashmap: hash_funcs - make inputs unambiguous
Make sure all variable-length inputs are properly terminated or that
their length is encoded in some way. This avoids ambiguity of
adjacent inputs.
E.g., in case of a hash function taking two strings, compressing "ab"
followed by "c" is now distinct from "a" followed by "bc". |
b826ab586c9e0a9c0d438a75c28cf3a8ab485929 |
|
05-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
hashmap: refactor hash_func
All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.
This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result. |
3f6fd1ba65f962702753c4ad284b588e59689a23 |
|
29-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce common version() implementation and use it everywhere
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE. |
f6d1e6cbe98307b72fbc02ad8f269f5588681856 |
|
23-Sep-2015 |
Lars Uebernickel <lars@uebernic.de> |
busctl: also monitor messages to SERVICE arguments
Add a 'destination' match rule for every SERVICE argument in addition to
the 'sender' rule. This is consistent with busctl(1), which documents
monitor as dumping "messages to or from this peer". |
1fc464f6fbecfc5d8ba9f7b98d19e21fb324bfb9 |
|
22-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
cgtop: underline table header
Let's underline the header line of the table shown by cgtop, how it is
customary for tables. In order to do this, let's introduce new ANSI
underline macros, and clean up the existing ones as side effect. |
59f448cf15f94bc5ebfd5b254de6f2441d02fbec |
|
10-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: never use the off_t unless glibc makes us use it
off_t is a really weird type as it is usually 64bit these days (at least
in sane programs), but could theoretically be 32bit. We don't support
off_t as 32bit builds though, but still constantly deal with safely
converting from off_t to other types and back for no point.
Hence, never use the type anymore. Always use uint64_t instead. This has
various benefits, including that we can expose these values directly as
D-Bus properties, and also that the values parse the same in all cases. |
057171efc103ac76c60a2a0d277d8bbf25415c21 |
|
27-Aug-2015 |
David Herrmann <dh.herrmann@gmail.com> |
Revert "sd-bus: do not connect to dbus-1 socket when kdbus is available"
This reverts commit d4d00020d6ad855d65d31020fefa5003e1bb477f. The idea of
the commit is broken and needs to be reworked. We really cannot reduce
the bus-addresses to a single address. We always will have systemd with
native clients and legacy clients at the same time, so we also need both
addresses at the same time. |
d4d00020d6ad855d65d31020fefa5003e1bb477f |
|
11-Aug-2015 |
Kay Sievers <kay@vrfy.org> |
sd-bus: do not connect to dbus-1 socket when kdbus is available
We should not fall back to dbus-1 and connect to the proxy when kdbus
returns an error that indicates that kdbus is running but just does not
accept new connections because of quota limits or something similar.
Using is_kdbus_available() in libsystemd/ requires it to move from
shared/ to libsystemd/.
Based on a patch from David Herrmann:
https://github.com/systemd/systemd/pull/886 |
8d87d4a989e05e69ed80c0aca38fdbc6f4959cf3 |
|
31-Jul-2015 |
David Herrmann <dh.herrmann@gmail.com> |
busctl: make sure --address connects as bus-client
There is really no reason to use `busctl` to connect to legacy private
bus endpoints. Fix this and make sure `busctl --address=unix:path=/foo`
works! |
cbfa6a41317b72553433f4ebe250dd0d34bf058f |
|
31-Jul-2015 |
Namhyung Kim <namhyung@gmail.com> |
busctl: fix assertion failure on --size option
Using --size option triggers an assert failure below because
parse_size() requires the second argument, base, being either 1000 or
1024. As it's for a packet size, it'd be better using IEC binary
suffix (base 1024) IMHO.
$ busctl --size 2048
Assertion 'base == 1000 || base == 1024' failed at src/basic/util.c:2222,
function parse_size(). Aborting.
Aborted (core dumped) |
d28ebe27f2f77264a4090ae6566d3eaa407151ea |
|
31-Jul-2015 |
Namhyung Kim <namhyung@gmail.com> |
busctl: add missing description of --size option
The size option was to specify maximum captured patch length but was
missing its description in the command line help. Add it. |
c030a850ba59fbcdf796abfe48b2f220933c52c0 |
|
31-Jul-2015 |
Namhyung Kim <namhyung@gmail.com> |
busctl: add and use strcmp_ptr()
In member_compare_func(), it compares interface, type and name of
members. But as it can contain NULL pointer, it needs to check them
before calling strcmp(). So make it as a separate strcmp_ptr
function (named after streq_ptr) so that it can be used by others.
Also let streq_ptr() to use it in order to make the code simpler. |
1d44f7584a713ab24e1ead541a8c85e176b99fd2 |
|
04-Jul-2015 |
David Herrmann <dh.herrmann@gmail.com> |
busctl: flush stdout after dumping data
Running `busctl monitor` currently buffers data for several seconds /
kilobytes before writing stdout. This is highly confusing if you dump in a
file, ^C busctl and then end up with a file with data of the last few
_seconds_ missing.
Fix this by explicitly flushing after each signal. |
03976f7b4a84b8b1492a549a3470b2bba8f37008 |
|
03-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: introduce new sd_bus_flush_close_unref() call
sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush()
(which writes all unwritten messages out) + sd_bus_close() (which
terminates the connection, releasing all unread messages) +
sd_bus_unref() (which frees the connection).
The combination of this call is used pretty frequently in systemd tools
right before exiting, and should also be relevant for most external
clients, and is hence useful to cover in a call of its own.
Previously the combination of the three calls was already done in the
_cleanup_bus_close_unref_ macro, but this was only available internally.
Also see #327 |
288a74cce597f81d3ba01d8a5ca7d2ba5b654b7e |
|
11-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add terminal-util.[ch] |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
63c372cb9df3bee01e3bf8cd7f96f336bddda846 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary. |
05bae4a60c32e29797597979cee2f3684eb3bc1e |
|
18-Jan-2015 |
David Herrmann <dh.herrmann@gmail.com> |
bus: use EUID over UID and fix unix-creds
Whenever a process performs an action on an object, the kernel uses the
EUID of the process to do permission checks and to apply on any newly
created objects. The UID of a process is only used if someone *ELSE* acts
on the process. That is, the UID of a process defines who owns the
process, the EUID defines what privileges are used by this process when
performing an action.
Process limits, on the other hand, are always applied to the real UID, not
the effective UID. This is, because a process has a user object linked,
which always corresponds to its UID. A process never has a user object
linked for its EUID. Thus, accounting (and limits) is always done on the
real UID.
This commit fixes all sd-bus users to use the EUID when performing
privilege checks and alike. Furthermore, it fixes unix-creds to be parsed
as EUID, not UID (as the kernel always takes the EUID on UDS). Anyone
using UID (eg., to do user-accounting) has to fall back to the EUID as UDS
does not transmit the UID. |
92d66625794057081046f051f7564e0789de0ace |
|
07-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
busctl: exit cleanly when the bus connection is severed |
de33fc625725d199629ed074d6278504deb23deb |
|
24-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()
Pretty much everywhere else we use the generic term "machine" when
referring to containers in API, so let's do though in sd-bus too. In
particular, since the concept of a "container" exists in sd-bus too, but
as part of the marshalling system. |
4f44c03eaa7bc05240ef619d07766f61eda3d5b7 |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: when introspecting objects, optionally limit output by interface name |
3c70e3bb022f0de3317f3600c9366a2f4597339e |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
core: rearrange code so that libsystemd/sd-bus/ does not include header files from core
Stuff in src/shared or src/libsystemd should *never* include code from
src/core or any of the tools, so don't do that here either. It's not OK! |
1ed24c6170c95fbe61fed919db2e98cf0d1d568e |
|
02-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: fix 'command line' style output of properties |
5b820358cf2a5cb6d67cc0b1faaaca3b0171f1ac |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add new sd_bus_get_address() for querying the current bus address
Also, update "busctl" to show this in its output. |
5c3026927de9dfa60ad6ae8326fef5d7824e723e |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: rename sd_bus_get_owner_id() → sd_bus_get_bus_id()
The ID returned really doesn't identify the owner, but the bus instance,
hence fix this misnaming.
Also, update "busctl status" to show the ID in its output. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
3acc1dafd14420872f7f13319260eeb5d62c2533 |
|
28-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add new call sd_bus_get_scope() for querying whether one is connected to a system or a user bus |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
b5dae4c7f77f7c87b91e0afb60a31c690dda4a1f |
|
26-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add suppot for renegotiating message credential attach flags |
2e9efd22ce0099c3b4d35898d70f8fc706c8a66c |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: if no parameter is specified for "busctl status" show credentials of bus owner |
40ed1a4574152337479f7f9c01763b84847ff09f |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add new --augment-creds= switch for controlling whether shown credential data shall be augment with data from /proc |
1d58a1fe13cd725110be595c40cdc973d7e57d9e |
|
25-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: improve readability a bit |
a44b10818a531787c359f6446d218a975503f032 |
|
21-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add --timeout= option to specify method call timeout |
38051578360c211e88ef4082ce5746adb52a500e |
|
21-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add options to control message header flags when invoking methods |
1fc5560911a7e9e8cf2993e17e1f0a001e148809 |
|
21-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: show property values in "introspect" output, add "set-property" command, and support both a terse and a verbose output format |
b18ec7e29f9756bb66f63a0fa02a6ceb40b38b03 |
|
21-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: when --address is specified do not assume we connect to a full bus |
79f34de9fb8e4faa6ed0847b386099a4ba100a8a |
|
21-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: use canned error message on parse failure |
73fc23c0641d3659330f44cf1a6ea112d6a51708 |
|
20-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: pass error output to stdout (rather than stderr) when generate tree for all objects
This is a ton more useful when some services fail, since we continue
crawling then and output everything to a pager. |
d0b2babf5264429e6ac0870b2c7cb13eacba2b86 |
|
20-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: improve output of service creds |
0171da06ef8bb19c175c5aa8aff8cf95f3de7dc1 |
|
20-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add new "introspect" verb for introspecting objects |
a1ad376761af16da46c9ad90fd8df41c8c5c0976 |
|
20-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: split out introspection parser from tree logic so that we can reuse it for a future "busctl introspect" command |
d55192add75584f55932ad463ee6b4cc30370c63 |
|
14-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: introduce busctl "get-property" command for reading and dumping object properties |
56c8b52d4dc652bf15aa8c2ef44d35b166b419c1 |
|
14-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: various tweaks to "busctl tree" output |
781fa93815fafd02b5287ef5781b92ef7b99973b |
|
14-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add new "call" command to invoke methods on a service |
d9130355ee0530117518ff24354bdd552d030238 |
|
10-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add "tree" command to explore object trees |
455971c1493fc6dc3125d235cf4ea6102cac626d |
|
04-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: rename "connection name" to "description" for the sd-bus API too
kdbus recently renamed this concept, and so should we in what we expose
in userspace. |
1f70b0876a9388f38422c12fa0c73761559d9425 |
|
30-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: add new "capture" verb to record bus messages in libpcap compatible files, for dissection with wireshark |
056f95d0a70413e10e4a4ea9966baabb5a1450ed |
|
22-Oct-2014 |
Daniel Mack <daniel@zonque.org> |
sd-bus: rename sd_bus_get_owner_uid(), sd_bus_get_owner_machine_id() and sd_bus_get_peer_creds()
Clean up the function namespace by renaming the following:
sd_bus_get_owner_uid() → sd_bus_get_name_creds_uid()
sd_bus_get_owner_machine_id() → sd_bus_get_name_machine_id()
sd_bus_get_peer_creds() → sd_bus_get_owner_creds() |
d5099efc47d4e6ac60816b5381a5f607ab03f06e |
|
15-Sep-2014 |
Michal Schmidt <mschmidt@redhat.com> |
hashmap: introduce hash_ops to make struct Hashmap smaller
It is redundant to store 'hash' and 'compare' function pointers in
struct Hashmap separately. The functions always comprise a pair.
Store a single pointer to struct hash_ops instead.
systemd keeps hundreds of hashmaps, so this saves a little bit of
memory. |
249968612f16a71df909d6e73785c18a9ff36a65 |
|
04-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
bus: always explicitly close bus from main programs
Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC
busses anymore when unsent messages remain that keep their reference,
when they otherwise are not referenced anymore. This means that if we
explicitly want connections to go away, we need to close them.
With this change we will no do so explicitly wherver we connect to the
bus from a main program (and thus know when the bus connection should go
away), or when we create a private bus connection, that really should go
away after our use.
This fixes connection leaks in the NSS and PAM modules. |
601185b43da638b1c74153deae01dbd518680889 |
|
04-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Unify parse_argv style
getopt is usually good at printing out a nice error message when
commandline options are invalid. It distinguishes between an unknown
option and a known option with a missing arg. It is better to let it
do its job and not use opterr=0 unless we actually want to suppress
messages. So remove opterr=0 in the few places where it wasn't really
useful.
When an error in options is encountered, we should not print a lengthy
help() and overwhelm the user, when we know precisely what is wrong
with the commandline. In addition, since help() prints to stdout, it
should not be used except when requested with -h or --help.
Also, simplify things here and there. |
19befb2d5fc087f96e40ddc432b2cc9385666209 |
|
15-May-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection
This makes callback behaviour more like sd-event or sd-resolve, and
creates proper object for unregistering callbacks.
Taking the refernce to the slot is optional. If not taken life time of
the slot will be bound to the underlying bus object (or in the case of
an async call until the reply has been recieved). |
d0ce77344bfb71e50da7296cd0d4f2529a109044 |
|
19-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: when monitoring the bus, enable all credentials |
09365592341b4ba4ceca677bb551dcde811e0333 |
|
19-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add proper monitoring API |
151b9b9662a90455262ce575a8a8ae74bf4ff336 |
|
20-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
api: in constructor function calls, always put the returned object pointer first (or second)
Previously the returned object of constructor functions where sometimes
returned as last, sometimes as first and sometimes as second parameter.
Let's clean this up a bit. Here are the new rules:
1. The object the new object is derived from is put first, if there is any
2. The object we are creating will be returned in the next arguments
3. This is followed by any additional arguments
Rationale:
For functions that operate on an object we always put that object first.
Constructors should probably not be too different in this regard. Also,
if the additional parameters might want to use varargs which suggests to
put them last.
Note that this new scheme only applies to constructor functions, not to
all other functions. We do give a lot of freedom for those.
Note that this commit only changes the order of the new functions we
added, for old ones we accept the wrong order and leave it like that. |
17d47d8d2dee22ee4f0a7319b9603d3e33a0b28a |
|
19-Feb-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
busctl: add --no-legend and use in bash completion |
14008e4e9cc6b51d68cd07ed091f788239d92856 |
|
22-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
busctl: include connection name in busctl output |
607553f9306286fdccf0b356bc3d1087adfe21c4 |
|
21-Jan-2014 |
Tom Gundersen <teg@jklm.no> |
libsystemd: split up into subdirs
We still only produce on .so, but let's keep the sources separate to make things a bit
less messy. |