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. |
e5abebabb32b46c865f8a6f7a534795e1b72b757 |
|
14-Dec-2015 |
Torstein Husebø <torstein@huseboe.net> |
treewide: fix typos and indentation |
f3f4f0086ea45ce82658d5fd8a9a36f25685043f |
|
02-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: SMBIOS 3.0 knows the "tablet" form factor, add support for it |
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. |
cf0fbc49e67b55f8d346fc94de28c90113505297 |
|
16-Nov-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: sort includes
Sort the includes accoding to the new coding style. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
ee104e11e303499a637c5cd8157bd12ad5cc116d |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
user-util: move UID/GID related macros from macro.h to user-util.h |
bb15fafe9cd815fe5bf9eae84c08aead2eb98fd7 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: move filename_is_valid() and path_is_safe() to path-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] |
76c73487d090afaac3fb8bea232c2ebe965d59fd |
|
24-Sep-2015 |
David Herrmann <dh.herrmann@gmail.com> |
hostnamed: drop redundant code
Doing argc checks once is enough enough enough enough. |
1f6b411372076426c0faf0bb350437fb4d82931f |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: update empty-if coccinelle script to cover empty-while and more
Let's also clean up single-line while and for blocks. |
ece174c5439021e32ebcc858842de9586072c006 |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: drop {} from one-line if blocks
Patch via coccinelle. |
a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources. |
75f86906c52735c98dc0aa7e24b773edb42ee814 |
|
07-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection. |
403ed0e5c914f2a0a683403d8ba7eaf96e3ffcdf |
|
05-Sep-2015 |
Michael Chapman <mike@very.puzzling.org> |
bus-util: support details in CheckAuthorization calls
Extra details for an action can be supplied when calling polkit's
CheckAuthorization method. Details are a list of key/value string pairs.
Custom policy can use these details when making authorization decisions. |
8fb494435889dcb9e1c09b8c7220e47bab717bf9 |
|
06-Aug-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
hostname-util: add relax parameter to hostname_is_valid
Tests are modified to check behaviour with relax and without relax.
New tests are added for hostname_cleanup().
Tests are moved a new file (test-hostname-util) because there's
now a bunch of them.
New parameter is not used anywhere, except in tests, so there should
be no observable change. |
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 |
139e5336286c37d9d4a2df01931ba0a86abbac69 |
|
19-May-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
hostname: Allow comments in /etc/hostname
The hostname(1) tool allows comments in /etc/hostname. Introduce a new
read_hostname_config() in hostname-util which reads a hostname configuration
file like /etc/hostname, strips out comments, whitespace, and cleans the
hostname. Use it in hostname-setup.c and hostnamed and remove duplicated code.
Update hostname manpage. Add tests.
https://launchpad.net/bugs/1053048 |
958b66ea16deddd794b3a52643bd44633e165ead |
|
18-May-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split all hostname related calls into hostname-util.c |
190700621f95160d364f8ec1d3e360246c41ce75 |
|
29-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: drop bus parameter from message callback prototype
This should simplify the prototype a bit. The bus parameter is redundant
in most cases, and in the few where it matters it can be derived from
the message via sd_bus_message_get_bus(). |
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. |
c529695e7a30b300fdaa61ace4a8a4ed0e94ad1c |
|
18-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
logind: open up most bus calls for unpriviliged processes, using PolicyKit
Also, allow clients to alter their own objects without any further
priviliges. i.e. this allows clients to kill and lock their own sessions
without involving PK. |
d7b8eec7dc7fe307d3a08b32cf1a9ad4276ce6d5 |
|
28-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
tmpfiles: add new line type 'v' for creating btrfs subvolumes |
ffbc903f030d9acd2c40e4defd8e549b046ec520 |
|
25-Dec-2014 |
Filipe Brandenburger <filbranden@google.com> |
hostnamed: remove spurious include of <sys/capability.h>
It does not use any functions from libcap directly. The CAP_SYS_ADMIN constant
in use by this file comes from <linux/capability.h> imported through "missing.h".
Tested that "systemd-hostnamed" builds cleanly and works after this change. |
ae6c3cc009a21df4b51851fb8fe3fde0b7d6d8f0 |
|
12-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
util: when using basename() for creating temporary files, verify the resulting name is actually valid
Also, rename filename_is_safe() to filename_is_valid(), since it
actually does a full validation for what the kernel will accept as file
name, it's not just a heuristic. |
f7340ab269828d917cd1281e33e6dd4fdfee67b3 |
|
11-Dec-2014 |
Torstein Husebø <torstein@huseboe.net> |
treewide: correct spacing near eol in code comments |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
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(). |
25fa306ed58b0b7fe30ca9be37c66a7b3b2de70e |
|
06-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: introduce new "embedded" chassis type
We really don't want to get lost in adding fridge, car, plane, drone, or
whatever else, hence add a generic term "embedded" cover all the cases
where the computer is just part of something bigger, and not at the
focus of things. |
605f81a8968b2df8a28cca2cf11db99ab948a2af |
|
27-Oct-2014 |
Michal Sekletar <msekleta@redhat.com> |
util: introduce sethostname_idempotent
Function queries system hostname and applies changes only when necessary. Also,
migrate all client of sethostname to sethostname_idempotent while at it. |
cc56fafeebf814ef035e549115cf1850e6473fa5 |
|
23-Oct-2014 |
WaLyong Cho <walyong.cho@samsung.com> |
mac: rename apis with mac_{selinux/smack}_ prefix |
caffbef636ec48958dcb22e4b4140a9889a6a769 |
|
16-Sep-2014 |
David Herrmann <dh.herrmann@gmail.com> |
hostname: add missing EMITS_CHANGE annotation
We call into sd-bus to send PropertiesChanged notifications for
"Hostname", but forgot to add the annotation to the bus-vtable. Fix that! |
f38857914ab5c9cc55aac05795e1886963a5fd04 |
|
18-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
bus-util: simplify bus_verify_polkit_async() a bit
First, let's drop the "bus" argument, we can determine it from the
message anyway.
Secondly, determine the right callback/userdata pair automatically from
what is currently is being dispatched. This should simplify things a lot
for us, since it makes it unnecessary to pass pointers through the
original handlers through all functions when we process messages, which
might require authentication. |
def9a7aa0182e5ecca3ac61b26f75136a5c4f103 |
|
15-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-bus: add API to check if a client has privileges
This is a generalization of the vtable privilege check we already have,
but exported, and hence useful when preparing for a polkit change.
This will deal with the complexity that on dbus1 one cannot trust the
capability field we retrieve via the bus, since it is read via
/proc/$$/stat (and thus might be out-of-date) rather than directly from
the message (like on kdbus) or bus connection (as for uid creds on
dbus1).
Also, port over all code to this new API. |
36e34057a202d389263e98030fbd775b28b28af6 |
|
15-Aug-2014 |
Stef Walter <stef@thewalter.net> |
sd-bus: Remove bus arg from bus_verify_polkit_async_registry_free()
It's unneccessary, not used, and complicates callers of the
function. |
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. |
ce0f1493c399178a3c7796415bfe5abd105ad610 |
|
11-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: introduce new location machin-info field, too |
1e5b1aaa4c8531ef531ec46f6ecbb28fb2f81008 |
|
11-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: drop nss-myhostname check
The check only cares about whether the module is installed, not enabled.
But installation we should know anyway, after all we ship the module
with systemd these days... |
c2142cf1d1276f4f220bdd9af4ff7a716cc7a305 |
|
11-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: make use of in_charset() to verify charset |
d77ab3f7e3e56a4fd370caff6347bf4e56e51dec |
|
11-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: minor modernization |
799298d6513e7d40125c19d46578bb870d047db4 |
|
11-Jul-2014 |
Jóhann B. Guðmundsson < <johannbg@gmail.com> |
Add DEPLOYMENT to hostnamectl
[zj: remove the check against a fixed list of environments.] |
c49e59c1831f20fe02276d7bc6ba7d23d24c4ab3 |
|
09-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: add a new chassis type for watches |
6294aa76d818e831de4592b41a37e225fd0871f9 |
|
07-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
util: don't consider tabs special in string_has_cc() anymore
Instead, take a list of exceptions to our usual CC check |
717603e391b52983ca1fd218e7333a1b9dfc5c05 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machinectl: show /etc/os-release information of container in status output |
fecc80c1ba2eed9dadb9a10c15508c356bcc5fc1 |
|
02-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
util: generalize is_localhost() and use it everywhere where applicable |
5ae4d543cb9b45ad6c6b82b78da1d6abc2291cdb |
|
13-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
os-release: define /usr/lib/os-release as fallback for /etc/os-release
The file should have been in /usr/lib/ in the first place, since it
describes the OS container in /usr (and not the configuration in /etc),
hence, let's support os-release files in /usr/lib as fallback if no
version in /etc exists, following the usual override logic.
A prior commit already enabled tmpfiles to create /etc/os-release as a
symlink to /usr/lib/os-release should it be missing, thus providing nice
compatibility with applications only checking in /etc.
While it's probably a good idea if all apps check both locations via a
fallback logic, it is only necessary in the early boot process, as long
as the /etc/os-release symlink has not been restored, in case we boot
with an empty /etc. |
c779a44222161155c039a7fd2fd304c006590ac7 |
|
28-May-2014 |
Stef Walter <stef@thewalter.net> |
hostnamed: Fix the way that static and transient host names interact
It is almost always incorrect to allow DHCP or other sources of
transient host names to override an explicitly configured static host
name.
This commit changes things so that if a static host name is set, this
will override the transient host name (eg: provided via DHCP). Transient
host names can still be used to provide host names for machines that have
not been explicitly configured with a static host name.
The exception to this rule is if the static host name is set to
"localhost". In those cases we act as if no
static host name has been explicitly set.
As discussed elsewhere, systemd may want to have an fd based ownership
of the transient name. That part is not included in this commit. |
9be3455f55a5aa445ae8ae69301c54d19111d2e4 |
|
18-May-2014 |
Djalal Harouni <tixxdz@opendz.org> |
hostnamed: expose KernelVersion on the bus
This is needed to fix bug:
https://bugs.freedesktop.org/show_bug.cgi?id=76498
Reported-by: Zach <zachcook1991@gmail.com> |
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). |
f426cc5d4e30b05a0661c74e93ff3e95414f7a3c |
|
23-Apr-2014 |
Djalal Harouni <tixxdz@opendz.org> |
hostnamed: expose KernelName and KernelRelease on the bus |
44c3298855b60d4635b1be989d7abf0b87070935 |
|
11-Mar-2014 |
Djalal Harouni <tixxdz@opendz.org> |
hostnamed: expose OperatingSystemPrettyName and OperatingSystemCPEName on the bus |
f200e8bb34d08616dbcb03d6503d0610f4e7e5bc |
|
11-Mar-2014 |
Djalal Harouni <tixxdz@opendz.org> |
hostnamed: minor improvements in context_write_data_other()
Prepare context_write_data_other() and rename it to
context_write_data_machine_info() |
3a3c71c19766c4330ef95b27c875907ec7fe2fd8 |
|
24-Feb-2014 |
Michal Sekletar <msekleta@redhat.com> |
hostnamed: correct error message
We are not parsing timezone data. |
248fab742d2b61557de93ac6e422986a8858bf52 |
|
24-Feb-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
virt: make Virtualization an anonymous enum
This makes llvm happy when we assign an error code to the variable. |
37224a5ff522a366b353e8a01e2c2eee1e5416e5 |
|
19-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: fix exit-on-idle for driverd |
6203e07a83214a55bb1f88508fcda2005c601dea |
|
13-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: rework sd-event exit logic
With this change a failing event source handler will not cause the
entire event loop to fail. Instead, we just disable the specific event
source, log a message at debug level and go on.
This also introduces a new concept of "exit code" which can be stored in
the event loop and is returned by sd_event_loop(). We also rename "quit"
to "exit" everywhere else.
Altogether this should make things more robus and keep errors local
while still providing a way to return event loop errors in a clear way. |
5bb658a1784a0fd4f0f32adb4b1fb636ff503f7d |
|
12-Dec-2013 |
Kay Sievers <kay@vrfy.org> |
bus: remove explicit activator-specific flags, the kdbus supports it now |
d90bb66996f5e3e9b6987e60980ff721b6fc2aff |
|
12-Dec-2013 |
Kay Sievers <kay@vrfy.org> |
bus: add SD_BUS_NAME_REPLACE_EXISTING to all activatable services, fix one flags conversion |
29a07cdb4a317f2e1ea160b79bfe6eb1be2e6e01 |
|
12-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: instead of exposing the dbus1 flags when acquiring a name use our own that are closer to kdbus
This turns around DO_NOT_QUEUE into QUEUE which implies a more useful
default. (And negative options are awful anyway.) |
cde93897cdefdd7c7f66c400a61e42ceee5f6a46 |
|
11-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
event: hook up sd-event with the service watchdog logic
Adds a new call sd_event_set_watchdog() that can be used to hook up the
event loop with the watchdog supervision logic of systemd. If enabled
and $WATCHDOG_USEC is set the event loop will ping the invoking systemd
daemon right after coming back from epoll_wait() but not more often than
$WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than
$WATCHDOG_USEC/4*3, to make sure the service manager is called in time.
This means that setting WatchdogSec= in a .service file and calling
sd_event_set_watchdog() in your daemon is enough to hook it up with the
watchdog logic. |
adacb9575a09981fcf11279f2f661e3fc21e58ff |
|
10-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce "trusted" bus concept and encode access control in object vtables
Introduces a new concept of "trusted" vs. "untrusted" busses. For the
latter libsystemd-bus will automatically do per-method access control,
for the former all access is automatically granted. Per-method access
control is encoded in the vtables: by default all methods are only
accessible to privileged clients. If the SD_BUS_VTABLE_UNPRIVILEGED flag
is set for a method it is accessible to unprivileged clients too. By
default whether a client is privileged is determined via checking for
its CAP_SYS_ADMIN capability, but this can be altered via the
SD_BUS_VTABLE_CAPABILITY() macro that can be ORed into the flags field
of the method.
Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and
SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note
however that read access is unrestricted, as PropertiesChanged messages
might send out the values anyway as an unrestricted broadcast.
By default the system bus is set to "untrusted" and the user bus is
"trusted" since per-method access control on the latter is unnecessary.
On dbus1 busses we check the UID of the caller rather than the
configured capability since the capability cannot be determined without
race. On kdbus the capability is checked if possible from the attached
meta-data of a message and otherwise queried from the sending peer.
This also decorates the vtables of the various daemons we ship with
these flags. |
e7176abbe818c75c6acd90227a7a84c3e05fee31 |
|
03-Dec-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: make sd_bus_request_name() and sd_bus_release_name() behave more like other calls
Instead of returning an enum of return codes, make them return error
codes like kdbus does internally.
Also, document this behaviour so that clients can stick to it.
(Also rework bus-control.c to always have to functions for dbus1 vs.
kernel implementation of the various calls.) |
ebcf1f97de4f6b1580ae55eb56b1a3939fe6b602 |
|
21-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: rework message handlers to always take an error argument
Message handler callbacks can be simplified drastically if the
dispatcher automatically replies to method calls if errors are returned.
Thus: add an sd_bus_error argument to all message handlers. When we
dispatch a message handler and it returns negative or a set sd_bus_error
we send this as message error back to the client. This means errors
returned by handlers by default are given back to clients instead of
rippling all the way up to the event loop, which is desirable to make
things robust.
As a side-effect we can now easily turn the SELinux checks into normal
function calls, since the method call dispatcher will generate the right
error replies automatically now.
Also, make sure we always pass the error structure to all property and
method handlers as last argument to follow the usual style of passing
variables for return values as last argument. |
0ccad099d4c08dc5a16c87cdd6eefc05e9d4b670 |
|
21-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: modernizations |
df2d202e6ed4001a21c6512c244acad5d4706c87 |
|
21-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: let's simplify things by getting rid of unnecessary bus parameters |
76b543756ef69ce69784d571aefe8de65eaeb331 |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce concept of a default bus for each thread and make use of it everywhere
We want to emphasize bus connections as per-thread communication
primitives, hence introduce a concept of a per-thread default bus, and
make use of it everywhere. |
afc6adb5ec7e73bc13156c43f52fb015cd80cc68 |
|
12-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: introduce concept of a "default" event loop per-thread and make use of it everywhere
Try to emphasize a bit that there should be a mapping between event
loops and threads, hence introduce a logic that there's one "default"
event loop for each thread, that can be queried via
"sd_event_default()". |
102d8f8169427cb68cdebf5ee0f0e07788e9c2b2 |
|
07-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
consistently use "int" when retrieving "bool" from bus messages |
6c8ea34fd945103e2f998403fea68bb0006e8057 |
|
06-Nov-2013 |
Kay Sievers <kay@vrfy.org> |
Revert "hostnamed: prevent it from crashing if the chassis is unknown"
This reverts commit 95b015de3849d8d8d03d9441ae1682a04c38833b.
"bus: handle serialization of NULL strings" (cd6f997f71c3aba16aa08226d423d14cbc787f82)
should fix this issue. |
95b015de3849d8d8d03d9441ae1682a04c38833b |
|
06-Nov-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
hostnamed: prevent it from crashing if the chassis is unknown
When fallback_chassis would return null it led to a crash and an
empty result in hostnamectl. Only seen after the sd-port. |
9bcbce4201afada1c0ad8ada0cbfbbf58a52a6a7 |
|
22-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
bus: avoid 'bool' storage when retrieving 'b' from the message
Just use an unsigned int as a bool type to avoid issues in the public
message reading API; sizeof(bool) == 1, but the code copies 4 bytes at
the pointers destination. |
abc5fe72503fcc30998334e73c5d8e58f9a9d85e |
|
18-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
bus: automatically flush bus queue when we exit the event loop
This way, we do not have to call it manually |
66a4c743c070761ee8696aa6302445fecf358441 |
|
18-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: port over from libdbus to libsystemd-bus |
ac4c8d6da8b5ebc35f02c9c6cb7595be7b134a05 |
|
12-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Allow tabs in environment files
bash allows them, and so should we.
string_has_cc is changed to allow tabs, and if they are not wanted,
they must be now checked for explicitly. There are two other callers,
apart from the env file loaders, and one already checked anyway, and
the other is changed to check.
https://bugs.freedesktop.org/show_bug.cgi?id=68592
https://bugs.gentoo.org/show_bug.cgi?id=481554 |
fda2c5d28bdf5c6ac1ff1ba504fa884c48ed1439 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
hostnamectl: if somebody invokes 'hostnamectl set-hostname' with a valid internet hostname unset the pretty name
If people are unaware or uninterested in the concept of pretty host
names, and simply invoke "hostnamectl set-hostname" for a valid internet
host name, then use this as indication to unset the pretty host name and
only set the static/dynamic one.
This also allows fqdn, hence "hostnamectl set-hostname www.foobar.com"
will just work if people really insist on using fqdns as hostnames. |
f73141d7657b3f60b8669bc8386413d8a8a372c6 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
shared: rework env file reader
Implement this with a proper state machine, so that newlines and
escaped chars can appear in string assignments. This should bring the
parser much closer to shell. |
574d5f2dfc25226afc718aa5ba1a145fe5cad221 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: rename write_one_line_file() to write_string_file()
You can write much more than just one line with this call (and we
frequently do), so let's correct the naming. |
737732a41e5702540f51c760bebd3b8152c04727 |
|
22-Mar-2013 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: pretty_string_is_safe() already exists in string_has_cc(), so use that |
c6a818c82035da91e7987920510f0dda61d8781a |
|
19-Mar-2013 |
Colin Walters <walters@verbum.org> |
Use bus_maybe_send_reply() where applicable
This is a followup to: commit 1a37b9b9043ef83e9900e460a9a1fccced3acf89
It will fix denial messages from dbus-daemon between gdm and
systemd-logind on logging into GNOME due to this.
See the previous commit for more details. |
ebe5d6d0d05d1f17c96315c42f8d9bcf5e13ba9d |
|
05-Mar-2013 |
Nathaniel Chen <nathaniel.chen@intel.com> |
hostnamed: allow more special characters in pretty hostname
this addresses the bug at:
https://bugs.freedesktop.org/show_bug.cgi?id=59311
https://bugzilla.redhat.com/show_bug.cgi?id=895299
hostnamectl is supposed to allow a range of special characters for
the 'pretty' hostname:
$ hostnamectl set-hostname --pretty "Nathaniels Desktop !@#$%"
..however, it rejects apostrophes, double quotes, and backslashes.
The manual for hostnamectl suggests that this should be allowed.
It makes sense to reject \0, \n, etc. pretty_string_is_safe() is
the same as string_is_safe(), but allows more special characters. |
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 |
|
14-Feb-2013 |
Harald Hoyer <harald@redhat.com> |
honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c
see https://bugzilla.redhat.com/show_bug.cgi?id=881577 |
4d1a69043862ed979642f5688097160355d4cc81 |
|
11-Feb-2013 |
Lennart Poettering <lennart@poettering.net> |
env: considerably beef up environment cleaning logic
Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.
All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.
(This also splits out all environment related calls into env-util.[ch]) |
7871c8e9327e4e5b18de9d8081b0f32fa38c2c1f |
|
24-Dec-2012 |
Lennart Poettering <lennart@poettering.net> |
hostnamed: make chassis type configurable via /etc/machine-info
For many usecases it is useful to store the chassis type somewhere, and
/etc/machine-info sounds like a good place. Ideally we could always
detect the chassis type from firmware, but frequently that's not
available and in many embedded devices probably entirely unrealistic.
This patch adds a configurable setting CHASSIS= to /etc/machine-info and
exposes this via hostnamectl/hostnamed. hostnamed will guess the chassis
type from DMI if nothing is set explicitly. I also added support for
detecting it from ACPI, which should be more useful as ACPI 5.0 actually
knows a "tablet" chassis type, which neither DMI nor previous ACPI
versions knew.
This also enables DMI-based and ACPI-based detection for non-x86 systems
as ACPI is apparently coming to ARM platforms soon.
I tried to minimize the vocabulary of chassis types understood and
added: desktop, laptop, server, tablet, handset. This is much less than
either APCI or DMI know. If we need more types later on we can easily
add them. |
0b507b17a760b21e33fc52ff377db6aa5086c680 |
|
03-Oct-2012 |
Lennart Poettering <lennart@poettering.net> |
dbus: add some more safety checks before accepting data from bus clients |
0d0f0c50d3a1d90f03972a6abb82e6413daaa583 |
|
26-Jul-2012 |
Shawn Landden <shawnlandden@gmail.com> |
log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera |
669241a076108e0483d7d8475beaa506106d077e |
|
25-Jul-2012 |
Shawn Landden <shawnlandden@gmail.com> |
use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.
Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id |
5430f7f2bc7330f3088b894166bf3524a067e3d8 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.
Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.
The bits that used to be MIT continue to be MIT.
The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends. |
89f134406af6a4b4c7493f624a89dcd654b48e81 |
|
11-Feb-2012 |
Lennart Poettering <lennart@poettering.net> |
logind: introduce CanReboot/CanPowerOff bus calls |
d200735e13c52dcfe36c0e066f9f6c2fbfb85a9c |
|
16-Jan-2012 |
Michal Schmidt <mschmidt@redhat.com> |
dbus: more efficient implementation of properties
The way the various properties[] arrays are initialized is inefficient:
- only the .data members change at runtime, yet the whole arrays of
properties with all the fields are constructed on the stack one by
one by the code.
- there's duplication, eg. the properties of "org.freedesktop.systemd1.Unit"
are repeated in several unit types.
Fix it by moving the information about properties into static const
sections. Instead of storing the .data directly in the property, store
a constant offset from a run-time base.
The small arrays of struct BusBoundProperties bind together the constant
information with the right runtime information (the base pointer).
On my system the code shrinks by 60 KB, data increases by 10 KB. |
00c36f274b43e5386b42160c8ce07aea0cf15fc3 |
|
31-Dec-2011 |
Kay Sievers <kay.sievers@vrfy.org> |
hostnamed: move sources to subdirectory |