Tom Gundersen [Fri, 3 Jan 2014 15:20:10 +0000 (16:20 +0100)]
networkd: improve link state change logging
Tom Gundersen [Fri, 3 Jan 2014 15:02:12 +0000 (16:02 +0100)]
networkd: add some debug info about notifications we ignore
Kay Sievers [Fri, 3 Jan 2014 01:57:45 +0000 (02:57 +0100)]
bus: always create --user bus when kdbus is active
We set the variable in the unit file for --user, so this check is
always true.
Tom Gundersen [Fri, 3 Jan 2014 01:07:56 +0000 (02:07 +0100)]
networkd: link - explicitly set the link to be up if the call to IFF_UP succeeds
No need to wait for the NEWLINK message to arrive.
Zbigniew Jędrzejewski-Szmek [Fri, 3 Jan 2014 00:49:49 +0000 (19:49 -0500)]
networkd: fix memory leak in error path
Zbigniew Jędrzejewski-Szmek [Fri, 3 Jan 2014 00:49:43 +0000 (19:49 -0500)]
networkd: do not deference null pointer in cleanup
Zbigniew Jędrzejewski-Szmek [Fri, 3 Jan 2014 00:49:33 +0000 (19:49 -0500)]
core: fix gcc unused variable warning
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jan 2014 03:45:45 +0000 (22:45 -0500)]
bus: fix memleak in sd_bus_creds_new_from_pid
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jan 2014 03:35:54 +0000 (22:35 -0500)]
Introduce cleanup functions for cap_free
Unfortunately a different cleanup function is necessary per type,
because cap_t** and char** are incompatible with void**.
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jan 2014 01:20:17 +0000 (20:20 -0500)]
build-sys: add --disable-dbus autoconf option
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jan 2014 01:19:58 +0000 (20:19 -0500)]
build-sys: make valgrind-tests target output nicer
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2013 17:56:59 +0000 (12:56 -0500)]
rtnl: fix memory corruptions after realloc
struct sd_rtnl_message would keep two additional pointers into the hdr
field. Every time hdr was realloced, those pointers should be adjusted,
but weren't. It seems less error-prone to keep offsets instead.
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2013 04:13:38 +0000 (23:13 -0500)]
bus: break reference cycle between bus and messages
Because messages in the read and write queues hold a reference on the
bus, and the bus holds a reference on each of them, we would never
free the bus if the read or write queues were not empty. Explicitly
substract the number of messages in those queue from the bus reference
count when deciding whether to free or not.
A simple test which creates and unrefs simple objects is added.
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 22:22:26 +0000 (17:22 -0500)]
Use format patterns for usec_t, pid_t, nsec_t, usec_t
It is nicer to predefine patterns using configure time check instead of
using casts everywhere.
Since we do not need to use any flags, include "%" in the format instead
of excluding it like PRI* macros.
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 21:12:46 +0000 (16:12 -0500)]
Move bus path definitions to def.h
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 16:21:56 +0000 (11:21 -0500)]
core/service: check if mainpid matches only if it is set
https://bugzilla.redhat.com/show_bug.cgi?id=1047304
Zbigniew Jędrzejewski-Szmek [Sat, 28 Dec 2013 03:12:38 +0000 (22:12 -0500)]
core/manager: print info about interesting signals
Information about signals which are not routinely received by systemd
are printed at info level. This should make it easier to see what is
happening in the system.
Zbigniew Jędrzejewski-Szmek [Sat, 28 Dec 2013 01:03:27 +0000 (20:03 -0500)]
core/service: tweak messages on operation timeouts
Tom Gundersen [Fri, 3 Jan 2014 00:25:18 +0000 (01:25 +0100)]
libsystemd-dhcp: don't assert on client_stop()
We need to be able to stop the dhcp client at any time, and the function appears to be written to handle this.
Tom Gundersen [Thu, 2 Jan 2014 23:55:35 +0000 (00:55 +0100)]
networkd: dhcp - avoid null pointer dereference
Tom Gundersen [Thu, 2 Jan 2014 23:55:09 +0000 (00:55 +0100)]
networkd: add more asserts and ignore all events when link has failed
Kay Sievers [Fri, 3 Jan 2014 00:32:03 +0000 (01:32 +0100)]
rules: drivers - do not reset RUN list
Tom Gundersen [Thu, 2 Jan 2014 14:56:10 +0000 (15:56 +0100)]
networkd: only track state of links we are managing
If a network is not (yet) set for a link, we do not care about its state (as we
anyway don't know what to do with it).
Tom Gundersen [Thu, 2 Jan 2014 14:30:46 +0000 (15:30 +0100)]
networkd: improve logging
Remove redundant messages, add some debugging ones and make wording more uniform.
Kay Sievers [Thu, 2 Jan 2014 04:16:14 +0000 (05:16 +0100)]
networkd: fix NULL pointer deref
Tom Gundersen [Thu, 2 Jan 2014 00:43:05 +0000 (01:43 +0100)]
networkd: fix getting initial state
We were requesting the state and then ignoring it...
Tom Gundersen [Wed, 1 Jan 2014 14:16:34 +0000 (15:16 +0100)]
networkd: add DHCPv4 support
This adds basic DHCPv4 support. Link-sense is enabled unconditionally,
but the plan is to make that configurable.
I tested this in a VM with lots of NICs and over wifi in the various
coffee shops I found this Christmas, but more testing would definitely
be appreciated.
Tom Gundersen [Wed, 1 Jan 2014 14:16:10 +0000 (15:16 +0100)]
networkd: distinguish between static and dynamic addresses/routes
Static addresses/routes are associated with a network. Dynamic
addresses/routes are associtade with links (as the corresponding network
may be shared by several links).
Tom Gundersen [Tue, 31 Dec 2013 16:31:50 +0000 (17:31 +0100)]
network: add support for dropping address
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2013 17:51:46 +0000 (12:51 -0500)]
build-sys: make test output a bit nicer
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2013 16:57:38 +0000 (11:57 -0500)]
dhcp: fix creation of req_opts array
GREEDY_REALLOC needs to have two size variables: one for the
allocated size, and a second one for the used size. Using
the allocated size only lead to leaving some elements unitialized
and assigning some more than once.
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2013 16:48:04 +0000 (11:48 -0500)]
build-sys: make test-dhcp-* statically linked
This makes them behave like everything else following
48d7417d3 'build-sys: link most internal libraries statically'.
Zbigniew Jędrzejewski-Szmek [Tue, 31 Dec 2013 16:23:58 +0000 (11:23 -0500)]
sleep-config: fix double free
Before
34a3baa4d 'sleep-config: Dereference pointer before check for NULL'
oom conditions would not be detected properly. After that commit, a double
free was performed.
Rework the whole function to be easier to understand, and also replace
strv_split_nulstr with strv_new, since we know the strings anyway.
Stefan Beller [Mon, 30 Dec 2013 22:32:22 +0000 (23:32 +0100)]
boot-efi: Remove superfluous assignment
2 lines after the changed line we assign err to efi_get_variable(...)
unconditionally, so it makes no sense to initialize it to some value.
Stefan Beller [Mon, 30 Dec 2013 16:43:52 +0000 (17:43 +0100)]
sleep-config: Dereference pointer before check for NULL
This fixes a bug pointed out by http://css.csail.mit.edu/stack/
(Optimization-unstable code)
It is a similar fix as
f146f5e159 (2013-12-30, core:
Forgot to dereference pointer when checking for NULL)
To explain this bug consider the following similar, but simpler code:
if (!p)
free(*p)
Assume the if condition evaluates to true, then we will access *p,
which means the compiler can assume p is a valid pointer, so it could
dereference p and use the value *p.
Assuming p as a valid pointer, !p will be false.
But initally we assumed the condition evaluates to true.
By this reasoning the optimizing compiler can deduce, we have dead code.
("The if will never be taken, as *p must be valid, because otherwise
accessing *p inside the if would segfault")
This led to an error message of the static code checker, so I checked the
code in question.
As we access *modes and *states before the check in the changed line of
this patch, I assume the line to be wrong and we actually wanted to check
for *modes and *states being both non null.
Stefan Beller [Sun, 29 Dec 2013 23:09:56 +0000 (00:09 +0100)]
bootchart: Remove unneeded check for NULL
Directly before the changed line there is:
while ((parent->next_ps && parent->pid != ps->ppid))
parent = parent->next_ps;
which looks one element ahead of the list, hence we can rely on parent
being non null here.
If 'parent' were NULL at that while loop already, it would crash as we're
dereferencing 'parent' when checking for next_ps already.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 18:00:38 +0000 (13:00 -0500)]
tmpfiles: rename --unsafe to --boot
As suggested by Kay, it is better to describe what is done,
not what might happen.
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 17:10:14 +0000 (12:10 -0500)]
build-sys: fix systemd-stdio-bridge link to work with split /usr
shumski> there seems to be slight error in systemd git master Makefile.am
Stefan Beller [Sun, 29 Dec 2013 23:18:39 +0000 (00:18 +0100)]
core: Forgot to dereference pointer when checking for NULL
Actually we already checked for !rt before, now we'd like to examine
the return value of the memory allocation.
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 05:11:30 +0000 (00:11 -0500)]
man: expand on some more subtle points in systemd.socket(5)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=727708#1694
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 05:01:00 +0000 (00:01 -0500)]
systemd-python: fix listen_fds under Python 2
Zbigniew Jędrzejewski-Szmek [Mon, 30 Dec 2013 04:39:28 +0000 (23:39 -0500)]
systemd-python: fix setting of exception codes
The return value of 0 would be treated as failure by mistake,
resulting in " SystemError: error return without exception set".
The way that set_error() is used is changed to be the same
everywhere.
Zbigniew Jędrzejewski-Szmek [Sun, 29 Dec 2013 19:56:09 +0000 (14:56 -0500)]
acticate: rename --environment to --setenv
Nspawn has --setenv, and systemd itself accepts systemd.setenv.
It is nice to have the same parameter name everywhere.
Old name is accepted, but not advertised.
Kay Sievers [Sun, 29 Dec 2013 17:05:25 +0000 (18:05 +0100)]
udev: LOG_PRIORITY -> LOG_LEVEL
Thomas Hindoe Paaboel Andersen [Fri, 27 Dec 2013 20:57:12 +0000 (21:57 +0100)]
autogen: add shortcut for running scan-build
scan-build is a static analyzer in llvm. As ususal static analyzers
tend to mostly find theoretical bugs in software that has been in
production for a while. For in-development code it can be useful to
check if new issues is added as there is a chance to spot real problems
before release. For systemd we are now down to 297 issues - the vast
majority are false positives because the tool does not understand the
cleanup attribute.
Running clang's static analyzer scan-build is a bit messy. You have to
run both configure and make "inside" the build-scan tool. To have an
easy shortcut from autogen.sh I thus call both directly from it. This
makes it different from the other options in autogen.sh. I chose 's'
for static analysis.
scan-build is in the package clang-analyzer on fedora.
Thomas Hindoe Paaboel Andersen [Fri, 27 Dec 2013 20:54:48 +0000 (21:54 +0100)]
autogen: add shortcut for building with clang
For a while I have been cleaning up warnings when building with clang.
There are currently only two sources of warnings left: Wcast-align and Wgnu.
I am not convinced that fixing up those up is feasible so I run with them
disabled to spot regressions. E.g. clang is a bit more strict wrt to unused
variables with the cleanup attribute and I have fixed a number of those since.
Like the other options in autogen.sh I have a shortcut for clang as well. I use
'l' for llvm.
Marc-Antoine Perennou [Sat, 28 Dec 2013 04:54:19 +0000 (13:54 +0900)]
gitignore: add back user@.service
Lennart Poettering [Sat, 28 Dec 2013 14:05:45 +0000 (15:05 +0100)]
bus: fix a couple of format string mistakes
Marc-Antoine Perennou [Sat, 28 Dec 2013 04:54:16 +0000 (13:54 +0900)]
bus: driverd; add missing format string parameter
This was causing a nasty coredump
Lennart Poettering [Sat, 28 Dec 2013 13:39:12 +0000 (14:39 +0100)]
bus: correct a number of gcc format string attribute usages
Michał Górny [Sat, 28 Dec 2013 04:44:27 +0000 (23:44 -0500)]
man: include autoconf snippet in daemon(7)
https://bugs.freedesktop.org/show_bug.cgi?id=40446
Lubomir Rintel [Fri, 6 Dec 2013 13:05:49 +0000 (14:05 +0100)]
selinux: Check access vector for enable/disable perm for each unit file
SELinux check will be done using the context of the unit file as as a
target instead of the default init_t context, allowing selinux control
on the level of individual units.
https://bugzilla.redhat.com/show_bug.cgi?id=1022762
Lennart Poettering [Sat, 28 Dec 2013 02:03:50 +0000 (03:03 +0100)]
shared: add simplistic XML parser for usage in the D-Bus policy language compat parser
Zbigniew Jędrzejewski-Szmek [Fri, 27 Dec 2013 20:48:07 +0000 (15:48 -0500)]
bus: fix running tests in parallel
Zbigniew Jędrzejewski-Szmek [Fri, 27 Dec 2013 20:27:24 +0000 (15:27 -0500)]
man: add a note about propagating signals
Marcel Holtmann [Fri, 27 Dec 2013 17:35:20 +0000 (09:35 -0800)]
hwdb: Update database of Bluetooth company identifiers
Zbigniew Jędrzejewski-Szmek [Fri, 27 Dec 2013 17:08:04 +0000 (12:08 -0500)]
build-sys: fix generation of user@.service
Mantas Mikulėnas [Fri, 27 Dec 2013 15:10:36 +0000 (17:10 +0200)]
units: user@.service: fix user bus path
Mantas Mikulėnas [Fri, 27 Dec 2013 08:30:53 +0000 (10:30 +0200)]
bus: PORTING-DBUS1: fix user bus path
Thomas Hindoe Paaboel Andersen [Fri, 27 Dec 2013 11:04:00 +0000 (12:04 +0100)]
systemctl: remove unused variable
Thomas Hindoe Paaboel Andersen [Fri, 27 Dec 2013 09:58:35 +0000 (10:58 +0100)]
bus: PORTING-DBUS1 typo fixes
Zbigniew Jędrzejewski-Szmek [Fri, 27 Dec 2013 06:18:39 +0000 (01:18 -0500)]
man: fix Type= reference v2
grawity:
It looks like the old version _was_ correct – the default value will
be "Type=dbus" if the service has a BusName set.
Suggested change: "if neither Type= nor BusName= is specified"
Kay Sievers [Fri, 27 Dec 2013 03:08:53 +0000 (04:08 +0100)]
bus: PORTING-DBUS1 clarify pool size value
Kay Sievers [Fri, 27 Dec 2013 02:38:38 +0000 (03:38 +0100)]
bus: PORTING-DBUS1 update
Kay Sievers [Fri, 27 Dec 2013 00:27:43 +0000 (01:27 +0100)]
bus: update PORTING-DBUS1
Lennart Poettering [Fri, 27 Dec 2013 00:20:21 +0000 (01:20 +0100)]
bus: actually, the kernel does enforce validity of bus names...
Lennart Poettering [Fri, 27 Dec 2013 00:00:51 +0000 (01:00 +0100)]
bus: explain obsoletion of dbus1 .service files
Lennart Poettering [Thu, 26 Dec 2013 23:27:43 +0000 (00:27 +0100)]
bus: refuse invalid names from kbus meta data
Lennart Poettering [Thu, 26 Dec 2013 23:26:05 +0000 (00:26 +0100)]
bus: add some preliminary docs for porting existing dbus1 client libraries to kdbus
Kay Sievers [Thu, 26 Dec 2013 21:03:18 +0000 (22:03 +0100)]
bus: update kdbus.h
Marcos Felipe Rasia de Mello [Thu, 26 Dec 2013 19:47:57 +0000 (17:47 -0200)]
man: fix Type= reference
Simple man page fix attached.
--
Marcos
From
268d10a2f8769fd1dcb9440670af15ac02c5df89 Mon Sep 17 00:00:00 2001
From: Marcos Mello <marcosfrm@gmail.com>
Date: Thu, 26 Dec 2013 17:19:04 -0200
Subject: [PATCH 1/1] man: fix Type= reference
Zbigniew Jędrzejewski-Szmek [Thu, 26 Dec 2013 20:30:22 +0000 (15:30 -0500)]
Use enums to make it obvious what boolean params mean
Suggested-by: Russ Allbery <rra@debian.org>
Zbigniew Jędrzejewski-Szmek [Wed, 25 Dec 2013 23:10:18 +0000 (18:10 -0500)]
systemctl: allow globbing in commands which take multiple unit names
Zbigniew Jędrzejewski-Szmek [Wed, 25 Dec 2013 05:11:51 +0000 (00:11 -0500)]
systemctl: drop uninteresting units immediately
Also properly free memory if list-unit-files --root=... is used.
Zbigniew Jędrzejewski-Szmek [Wed, 25 Dec 2013 04:55:43 +0000 (23:55 -0500)]
systemctl: simplify start_unit
Zbigniew Jędrzejewski-Szmek [Wed, 25 Dec 2013 03:57:15 +0000 (22:57 -0500)]
man: fix description of is-enabled returned value
Lennart Poettering [Thu, 26 Dec 2013 15:07:38 +0000 (16:07 +0100)]
bus: add a temporary hard-coded policy to proxyd to make gdm work
gdm relies on the policy to deny its own requests to not deadlock. Given
that we currently do not enforce any policy in the dbus1 compat proxy
service this means that gdm will necessarily deadlock on our systems.
To work around this, enforce a fixed policy teomporarily, until we
interpret the legacy XML policy in full.
Booh, gdm, booh, for requring this and making me waste two days on
tracking this brokenness down.
Lennart Poettering [Thu, 26 Dec 2013 14:24:58 +0000 (15:24 +0100)]
bus: always show messages we send
Zbigniew Jędrzejewski-Szmek [Thu, 26 Dec 2013 04:20:57 +0000 (23:20 -0500)]
man: document fail/nofail, auto/noauto
Also s/filesystem/file system/ in a few places.
Zbigniew Jędrzejewski-Szmek [Thu, 26 Dec 2013 03:53:09 +0000 (22:53 -0500)]
Trim TODO
Jan Engelhardt [Thu, 26 Dec 2013 01:47:45 +0000 (02:47 +0100)]
man: grammar and wording improvements
This is a recurring submission and includes corrections to:
- missing words, preposition choice.
- change of /lib to /usr/lib, because that is what most distros are
using as the system-wide location for systemd/udev files.
Jan Engelhardt [Thu, 26 Dec 2013 01:47:44 +0000 (02:47 +0100)]
man: improvements to comma placement
This is a recurring submission and includes corrections to:
comma placement.
Jan Engelhardt [Thu, 26 Dec 2013 01:47:43 +0000 (02:47 +0100)]
man: resolve word omissions
This is a recurring submission and includes corrections to:
word omissions and word class choice.
Lennart Poettering [Thu, 26 Dec 2013 02:08:52 +0000 (03:08 +0100)]
bus: don't process Peer interface messages in the proxy
Lennart Poettering [Thu, 26 Dec 2013 02:08:35 +0000 (03:08 +0100)]
update TODO
Lennart Poettering [Thu, 26 Dec 2013 02:08:15 +0000 (03:08 +0100)]
bus: make system bus kdbus node world-accessible
Lennart Poettering [Thu, 26 Dec 2013 00:52:01 +0000 (01:52 +0100)]
journalctl: make sure -b --foobar cannot be misunderstood as --boot=--foobar
Lennart Poettering [Wed, 25 Dec 2013 18:17:14 +0000 (19:17 +0100)]
Revert "completion: don't offer completions for journalctl -b"
This reverts commit
c756a6d57cdb678b702c68913dae3e11ff0427ae.
Lennart Poettering [Wed, 25 Dec 2013 18:17:10 +0000 (19:17 +0100)]
Revert "journalctl: remove unexpected behavior of journalctl -b"
This reverts commit
cf5bccc2bb9569030cb04debbc4208aaca0fe5b4.
We should fix thinks properly if they aren't perfect, not just break
other things...
Lennart Poettering [Wed, 25 Dec 2013 18:00:12 +0000 (19:00 +0100)]
build-sys: minor fixes found with cppcheck
Lennart Poettering [Wed, 25 Dec 2013 17:34:44 +0000 (18:34 +0100)]
build-sys: the pure/const warning options are probably too much as default, but let's make it available via "autogen.sh a"
Dave Reisner [Wed, 25 Dec 2013 17:58:37 +0000 (12:58 -0500)]
completion: don't offer completions for journalctl -b
Since this is a shortopt with an optional argument, assume the user
knows what they're doing. The longopts --boot and --this-boot will
continue to offer boot IDs as completions.
Dave Reisner [Wed, 25 Dec 2013 17:24:19 +0000 (12:24 -0500)]
journalctl: remove unexpected behavior of journalctl -b
This flag shouldn't try and consume the following argument. It should
behave like every other flag which takes an optional argument when
parsed by getopt_long.
Lennart Poettering [Wed, 25 Dec 2013 17:26:51 +0000 (18:26 +0100)]
bus: add a bit of pure/const decorators
Lennart Poettering [Wed, 25 Dec 2013 17:05:48 +0000 (18:05 +0100)]
man: add missing sd_bus_message_get_cookie man page fie
Lennart Poettering [Wed, 25 Dec 2013 17:03:05 +0000 (18:03 +0100)]
man: document sd_bus_message_get_cookie()
Lennart Poettering [Wed, 25 Dec 2013 16:46:45 +0000 (17:46 +0100)]
bus: rename message "serial" to "cookie"
Even if the lower-leveld dbus1 protocol calls it "serial", let's expose
the word "cookie" for this instead, as this is what kdbus uses and since
it doesn't imply monotonicity the same way "serial" does.
Kay Sievers [Wed, 25 Dec 2013 15:42:50 +0000 (16:42 +0100)]
bus: conditionally set cookie_reply/timeout and update kdbus.h
Kay Sievers [Wed, 25 Dec 2013 04:45:43 +0000 (05:45 +0100)]
bus: update kdbus.h
Kay Sievers [Wed, 25 Dec 2013 04:02:58 +0000 (05:02 +0100)]
bus: set cookie_reply and update kdbus.h