chiark / gitweb /
elogind.git
7 years agonetworkd: update manager_save() to use fflush_and_check() to simplify things a bit
Lennart Poettering [Tue, 12 Aug 2014 09:55:06 +0000 (11:55 +0200)]
networkd: update manager_save() to use fflush_and_check() to simplify things a bit

7 years agoresolved: initialize counter
Thomas Hindoe Paaboel Andersen [Tue, 12 Aug 2014 02:42:33 +0000 (04:42 +0200)]
resolved: initialize counter

introduced in: a407657425a3e47fd2b559cd3bc800f791303f63

7 years agonetworkd: fix build
Lennart Poettering [Tue, 12 Aug 2014 00:33:37 +0000 (02:33 +0200)]
networkd: fix build

7 years agosd-network: move sd-network API into libsystemd proper
Lennart Poettering [Tue, 12 Aug 2014 00:12:05 +0000 (02:12 +0200)]
sd-network: move sd-network API into libsystemd proper

In contrast to the DHCP/IPv4LL/ICMP6 APIs sd-network is not a protocol
implementation but a client API for networkd, hence move it into
libsystemd proper.

7 years agosd-network: remove client-side dhcp API
Lennart Poettering [Tue, 12 Aug 2014 00:04:17 +0000 (02:04 +0200)]
sd-network: remove client-side dhcp API

The networkd should abstract the difference between DHCP supplied and
configured data, and hence the DHCP lease concept should not exposed on
the client side.

Should we want to support arbitrary DHCP fields one day, we can add a
new sd_network_get_link_dhcp_field() call or so.

7 years agonetworkd: add minimal client tool "networkd" to query network status
Lennart Poettering [Mon, 11 Aug 2014 23:41:42 +0000 (01:41 +0200)]
networkd: add minimal client tool "networkd" to query network status

In the long run this should become a full fledged client to networkd
(but not before networkd learns bus support). For now, just pull
interesting data out of networkd, udev, and rtnl and present it to the
user, in a simple but useful output.

7 years agoudev: modernize net_id builtin a bit
Lennart Poettering [Mon, 11 Aug 2014 23:43:23 +0000 (01:43 +0200)]
udev: modernize net_id builtin a bit

7 years agosd-network: rename the per-ifindex calls to sd_network_get_link_xxx()
Lennart Poettering [Mon, 11 Aug 2014 20:56:52 +0000 (22:56 +0200)]
sd-network: rename the per-ifindex calls to sd_network_get_link_xxx()

This way we can introduce system-wide versions of these calls that are
called the same way, but without the "link" in the name.

7 years agonetworkd: monopolize in_addr utility functions in shared/in-addr-util.h
Lennart Poettering [Mon, 11 Aug 2014 20:44:51 +0000 (22:44 +0200)]
networkd: monopolize in_addr utility functions in shared/in-addr-util.h

Primarily, this means we get rid of net_parse_inaddr(), and replace it
everywhere with in_addr_from_string() and in_addr_from_string_auto().
These functions do not clobber the callers arguments on failure, which
is more close to our usual coding style.

7 years agotimesyncd: when we don't know anything about the network state, assume we are online
Lennart Poettering [Mon, 11 Aug 2014 20:04:05 +0000 (22:04 +0200)]
timesyncd: when we don't know anything about the network state, assume we are online

This should provide better compatibility with systems that lack networkd

7 years agobuild-sys: add missing makefile symlinks
Lennart Poettering [Mon, 11 Aug 2014 18:15:14 +0000 (20:15 +0200)]
build-sys: add missing makefile symlinks

7 years agoman: drop any reference to "syslog" as log target
Lennart Poettering [Mon, 11 Aug 2014 18:14:27 +0000 (20:14 +0200)]
man: drop any reference to "syslog" as log target

7 years agoudev: never bypass our own logging framework and call vsyslog() directly from udev...
Lennart Poettering [Mon, 11 Aug 2014 18:13:38 +0000 (20:13 +0200)]
udev: never bypass our own logging framework and call vsyslog() directly from udev tools

7 years agolog: never ever log to syslog from PID 1, log to the journal again
Lennart Poettering [Mon, 11 Aug 2014 18:08:08 +0000 (20:08 +0200)]
log: never ever log to syslog from PID 1, log to the journal again

We don't support journal-less systems anyway, so let's avoid the
confusion.

7 years agoman: improve documentation for StandardOutput= and StandardInput=
Lennart Poettering [Mon, 11 Aug 2014 17:28:53 +0000 (19:28 +0200)]
man: improve documentation for StandardOutput= and StandardInput=

7 years agologin: set_controller should fail if prepare_vt fails
Olivier Brunel [Fri, 8 Aug 2014 18:45:43 +0000 (20:45 +0200)]
login: set_controller should fail if prepare_vt fails

If controllers can expect logind to have "prepared" the VT (e.g. set it to
graphics mode, etc) then TakeControl() should fail if said preparation
failed (and session_restore_vt() was called).

(David: fixed up !CONFIG_VT case and errno-numbers)

7 years agofix a couple of more lazy "return -1"
Lennart Poettering [Mon, 11 Aug 2014 16:35:54 +0000 (18:35 +0200)]
fix a couple of more lazy "return -1"

Fix should strictly follow the rule to return negative errno-style
error codes from functions, hence let's fix more "return -1"-style
lazinesses.

7 years agojournal-remote: fix parsing of fd command line argument
Lennart Poettering [Mon, 11 Aug 2014 16:24:43 +0000 (18:24 +0200)]
journal-remote: fix parsing of fd command line argument

7 years agoinitctl: don't eat up error code
Lennart Poettering [Mon, 11 Aug 2014 16:24:28 +0000 (18:24 +0200)]
initctl: don't eat up error code

7 years agobootchart: use the bool type where appropriate
Lennart Poettering [Mon, 11 Aug 2014 16:24:08 +0000 (18:24 +0200)]
bootchart: use the bool type where appropriate

7 years agobootchart: it's not OK to return -1 from a main program
Lennart Poettering [Mon, 11 Aug 2014 16:23:47 +0000 (18:23 +0200)]
bootchart: it's not OK to return -1 from a main program

7 years agoman: document that we look for both the instance's and the template's .d/ directory...
Lennart Poettering [Mon, 11 Aug 2014 14:41:05 +0000 (16:41 +0200)]
man: document that we look for both the instance's and the template's .d/ directory when looking for unit file drop-ins.

7 years agoutil: avoid considering dpkg temporary files relevant for anything
Lennart Poettering [Mon, 11 Aug 2014 13:32:09 +0000 (15:32 +0200)]
util: avoid considering dpkg temporary files relevant for anything

https://bugs.freedesktop.org/show_bug.cgi?id=82453

7 years agotimesyncd: always use CLOCK_BOOTTIME if we can
Lennart Poettering [Sun, 10 Aug 2014 21:40:48 +0000 (23:40 +0200)]
timesyncd: always use CLOCK_BOOTTIME if we can

After all we want to compare a monotonically increasing clock with the
remote clock, hence we shouldn't ignore system suspend periods.

7 years agoman: update resolved man pages a bit
Lennart Poettering [Sun, 10 Aug 2014 21:40:18 +0000 (23:40 +0200)]
man: update resolved man pages a bit

7 years agoman: extend timesycnd man page a bit
Lennart Poettering [Sun, 10 Aug 2014 21:36:41 +0000 (23:36 +0200)]
man: extend timesycnd man page a bit

7 years agoresolved: when picking a new hostname make sure two hosts pick different ones
Lennart Poettering [Sun, 10 Aug 2014 21:10:08 +0000 (23:10 +0200)]
resolved: when picking a new hostname make sure two hosts pick different ones

This way we can avoid always picking the same replacement hostnames when
picking one.

7 years agoresolved: actually, the peer with the lower IP address wins conflicts
Lennart Poettering [Sun, 10 Aug 2014 20:48:16 +0000 (22:48 +0200)]
resolved: actually, the peer with the lower IP address wins conflicts

7 years agoresolved: make sure we don't mark the wrong zone RRs conflicting
Lennart Poettering [Sun, 10 Aug 2014 20:28:12 +0000 (22:28 +0200)]
resolved: make sure we don't mark the wrong zone RRs conflicting

7 years agoresolved: be a bit more communicative about conflicts
Lennart Poettering [Wed, 6 Aug 2014 15:21:00 +0000 (17:21 +0200)]
resolved: be a bit more communicative about conflicts

7 years agoupdate TODO
Lennart Poettering [Wed, 6 Aug 2014 15:00:14 +0000 (17:00 +0200)]
update TODO

7 years agoresolved: verify all RRs when we come back from suspend
Lennart Poettering [Wed, 6 Aug 2014 14:59:48 +0000 (16:59 +0200)]
resolved: verify all RRs when we come back from suspend

7 years agoresolved: destroy outstanding queries if the clients that initiated them die
Lennart Poettering [Wed, 6 Aug 2014 14:32:55 +0000 (16:32 +0200)]
resolved: destroy outstanding queries if the clients that initiated them die

7 years agoresolved: properly pass aborted transaction result back to clients
Lennart Poettering [Wed, 6 Aug 2014 14:32:17 +0000 (16:32 +0200)]
resolved: properly pass aborted transaction result back to clients

7 years agoresolved: implement full LLMNR conflict detection logic
Lennart Poettering [Wed, 6 Aug 2014 14:15:35 +0000 (16:15 +0200)]
resolved: implement full LLMNR conflict detection logic

7 years agoresolved: properly check return value of dns_resource_record_equal()
Lennart Poettering [Wed, 6 Aug 2014 14:14:53 +0000 (16:14 +0200)]
resolved: properly check return value of dns_resource_record_equal()

7 years agosd-bus: sync kdbus.h (ABI break)
Daniel Mack [Sun, 10 Aug 2014 19:46:24 +0000 (21:46 +0200)]
sd-bus: sync kdbus.h (ABI break)

7 years agoAdded arch tuple for PPC64LE
Harald Hoyer [Fri, 8 Aug 2014 14:54:13 +0000 (16:54 +0200)]
Added arch tuple for PPC64LE

Thanks to Brent Baude <bbaude@redhat.com>, who checked with the debian
guys, that this is correct and provided the patch.

7 years agoudev: link_setup - respect kernel name assign policy
Tom Gundersen [Tue, 15 Jul 2014 15:57:43 +0000 (17:57 +0200)]
udev: link_setup - respect kernel name assign policy

Newer kernels export meta-information about the origin of an ifname. Respect this
from the ifname rename logic. We do not rename any interfaces that was originally
named by userspace, nor once which have already been renamed from userspace.

Moreover, we optionally do not (the default) rename interfaces which the kernel
claims to have named in a predictable way.

7 years agocore: loopback-setup - only up the loopback device
Tom Gundersen [Fri, 8 Aug 2014 10:12:31 +0000 (12:12 +0200)]
core: loopback-setup - only up the loopback device

The kernel will set up the IP addresses for us, so don't duplicate that
in userspace.

7 years agohwdb: update format description and document reloading
Zbigniew Jędrzejewski-Szmek [Fri, 8 Aug 2014 01:48:57 +0000 (21:48 -0400)]
hwdb: update format description and document reloading

https://bugs.freedesktop.org/show_bug.cgi?id=82311

7 years agoman: correct references to DefaultTimeout*Sec
Zbigniew Jędrzejewski-Szmek [Fri, 8 Aug 2014 00:46:34 +0000 (20:46 -0400)]
man: correct references to DefaultTimeout*Sec

Noticed by thp on #systemd.

7 years agocore: warn when merged units have conflicting dependencies
Zbigniew Jędrzejewski-Szmek [Fri, 8 Aug 2014 00:46:49 +0000 (20:46 -0400)]
core: warn when merged units have conflicting dependencies

A unit should not Conflict with itself. It also does not make
much sense for a unit to be After or Before itself, or to
trigger itself in some way.

If one of those dependency types is encountered, warn, instead
of dropping it silently like other dependency types.

% build/systemd-analyze verify test/loopy3.service
...
Dependency Conflicts dropped when merging unit loopy4.service into loopy3.service
Dependency ConflictedBy dropped when merging unit loopy4.service into loopy3.service

7 years agocore: do not add dependencies to self
Zbigniew Jędrzejewski-Szmek [Fri, 8 Aug 2014 00:42:58 +0000 (20:42 -0400)]
core: do not add dependencies to self

Adds a pair of files which cause a segfault (also with
systemd-analyze verify).

https://bugzilla.redhat.com/show_bug.cgi?id=1124843

7 years agobus-proxy: service_name_is_valid will never be < 0
Thomas Hindoe Paaboel Andersen [Mon, 4 Aug 2014 21:44:57 +0000 (23:44 +0200)]
bus-proxy: service_name_is_valid will never be < 0

7 years agoupdate TODO
Lennart Poettering [Tue, 5 Aug 2014 15:02:39 +0000 (17:02 +0200)]
update TODO

7 years agoresolved: don't abort if a transaction is aborted because its scope is removed
Lennart Poettering [Tue, 5 Aug 2014 15:02:23 +0000 (17:02 +0200)]
resolved: don't abort if a transaction is aborted because its scope is removed

7 years agoresolved: add 100ms initial jitter to all LLMNR requests
Lennart Poettering [Tue, 5 Aug 2014 15:01:33 +0000 (17:01 +0200)]
resolved: add 100ms initial jitter to all LLMNR requests

7 years agoresolved: enforce ratelimit on LLMNR traffic
Lennart Poettering [Tue, 5 Aug 2014 14:34:45 +0000 (16:34 +0200)]
resolved: enforce ratelimit on LLMNR traffic

7 years agokeymap: Fix HP Pavillon DV7
Martin Pitt [Tue, 5 Aug 2014 10:29:27 +0000 (12:29 +0200)]
keymap: Fix HP Pavillon DV7

Properly disable scan code 94 instead of producing KEY_0.

https://launchpad.net/bugs/1322770

7 years agoudev-builtin-keyboard: Allow numeric key codes
Martin Pitt [Tue, 5 Aug 2014 08:40:46 +0000 (10:40 +0200)]
udev-builtin-keyboard: Allow numeric key codes

Like with the old udev rules, allow hwdb entries to specify numeric key codes.
Based on a patch from Mircea Miron.

https://launchpad.net/bugs/1247584

7 years agoresolved: don't consider tentative addresses relevant
Lennart Poettering [Tue, 5 Aug 2014 02:18:23 +0000 (04:18 +0200)]
resolved: don't consider tentative addresses relevant

7 years agoresolved: fix a message typo
Lennart Poettering [Tue, 5 Aug 2014 02:18:01 +0000 (04:18 +0200)]
resolved: fix a message typo

7 years agoresolved: stop the prober when we detect a conflict in LLMNR
Lennart Poettering [Tue, 5 Aug 2014 02:17:45 +0000 (04:17 +0200)]
resolved: stop the prober when we detect a conflict in LLMNR

7 years agoresolved: don't override zone item state after starting the probe
Lennart Poettering [Tue, 5 Aug 2014 02:16:26 +0000 (04:16 +0200)]
resolved: don't override zone item state after starting the probe

After all, the probe might be finished immeidately (due to resources,
...), and we shouldn't then set the state back to probing.

7 years agoresolved: when sending fails, don't try connecting to the next DNS server if we actua...
Lennart Poettering [Tue, 5 Aug 2014 02:15:45 +0000 (04:15 +0200)]
resolved: when sending fails, don't try connecting to the next DNS server if we actually use LLMNR as protocol

7 years agojournald: remove redundant newlines
Lennart Poettering [Tue, 5 Aug 2014 02:13:37 +0000 (04:13 +0200)]
journald: remove redundant newlines

7 years agojournald: properly sum up entry size counter
Lennart Poettering [Tue, 5 Aug 2014 01:37:56 +0000 (03:37 +0200)]
journald: properly sum up entry size counter

We should read the entry size before moving to the next iovec, not
after.

7 years agoresolved: never reuse transactions for probing that are already completed based on...
Lennart Poettering [Mon, 4 Aug 2014 23:51:40 +0000 (01:51 +0200)]
resolved: never reuse transactions for probing that are already completed based on cached data

7 years agoresolved: bypass local cache when we issue a transaction for verification purposes
Lennart Poettering [Mon, 4 Aug 2014 23:42:15 +0000 (01:42 +0200)]
resolved: bypass local cache when we issue a transaction for verification purposes

7 years agoresolved: if there's already an RR established that has the same name of an RR to...
Lennart Poettering [Mon, 4 Aug 2014 23:38:13 +0000 (01:38 +0200)]
resolved: if there's already an RR established that has the same name of an RR to be established, skip probing the name

After all, what has been probed once, doesn't need to be probed again.

7 years agosysusers: isempty will never be < 0
Thomas Hindoe Paaboel Andersen [Mon, 4 Aug 2014 21:21:06 +0000 (23:21 +0200)]
sysusers: isempty will never be < 0

looks like a typo from  1b99214789101976d6bbf75c351279584b071998

7 years agotest: use fabs on doubles
Thomas Hindoe Paaboel Andersen [Mon, 4 Aug 2014 21:13:31 +0000 (23:13 +0200)]
test: use fabs on doubles

7 years agoresolved: actually read the initial state data from networkd when we initialize
Lennart Poettering [Mon, 4 Aug 2014 21:08:49 +0000 (23:08 +0200)]
resolved: actually read the initial state data from networkd when we initialize

7 years agoman: bring resolved.conf up-to-date
Lennart Poettering [Mon, 4 Aug 2014 21:08:31 +0000 (23:08 +0200)]
man: bring resolved.conf up-to-date

7 years agoupdate TODO
Lennart Poettering [Mon, 4 Aug 2014 21:08:13 +0000 (23:08 +0200)]
update TODO

7 years agoresolved: read the per-interface LLMNR setting from networkd and act on it
Lennart Poettering [Mon, 4 Aug 2014 21:08:03 +0000 (23:08 +0200)]
resolved: read the per-interface LLMNR setting from networkd and act on it

7 years agosd-network: when the LLMNR setting is not known for an interface consider that as...
Lennart Poettering [Mon, 4 Aug 2014 21:06:05 +0000 (23:06 +0200)]
sd-network: when the LLMNR setting is not known for an interface consider that as ENODATA

ENODATA should be returned whenever we have no idea about something. A
missing LLMNR setting can only really happen during upgrades, in whichc
ase we really have no idea, so let's turn this into another ENODATA
case.

7 years agosd-network: actually open the state file in sd_network_get_llmnr()
Lennart Poettering [Mon, 4 Aug 2014 21:05:26 +0000 (23:05 +0200)]
sd-network: actually open the state file in sd_network_get_llmnr()

7 years agosd-dhcp-server: always send out ROUTER and SUBNET_MASK
Tom Gundersen [Mon, 4 Aug 2014 18:57:02 +0000 (20:57 +0200)]
sd-dhcp-server: always send out ROUTER and SUBNET_MASK

For now we simply take these values from the server's address.

7 years agoupdate TODO
Lennart Poettering [Mon, 4 Aug 2014 18:01:00 +0000 (20:01 +0200)]
update TODO

7 years agoresolved: fix order in which we destroy manager resources
Lennart Poettering [Mon, 4 Aug 2014 17:59:05 +0000 (19:59 +0200)]
resolved: fix order in which we destroy manager resources

7 years agoresolved: when there's already somebody listening on the LLMNR ports, simple disable...
Lennart Poettering [Mon, 4 Aug 2014 17:48:03 +0000 (19:48 +0200)]
resolved: when there's already somebody listening on the LLMNR ports, simple disable LLMNR and warn, but continue

This allows us to run resolved inside an nspawn container that shares
the network namespace with the host, if there's already an instance
running.

7 years agonspawn: make sure that when --network-veth is used both the host and the container...
Lennart Poettering [Mon, 4 Aug 2014 17:15:07 +0000 (19:15 +0200)]
nspawn: make sure that when --network-veth is used both the host and the container side get fixed MAC addresses

7 years agomachined: fix address API signatures
Lennart Poettering [Mon, 4 Aug 2014 17:05:06 +0000 (19:05 +0200)]
machined: fix address API signatures

7 years agomachine: make sure unpriviliged "machinectl status" can show the machine's OS version
Lennart Poettering [Mon, 4 Aug 2014 16:57:37 +0000 (18:57 +0200)]
machine: make sure unpriviliged "machinectl status" can show the machine's OS version

7 years agoudev: path_id - suppress ID_PATH for devices with an unknown parent device type
Kay Sievers [Mon, 4 Aug 2014 16:15:34 +0000 (18:15 +0200)]
udev: path_id - suppress ID_PATH for devices with an unknown parent device type

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1321816

7 years agonetworkd: add and expose per-link LLMNR config option
Tom Gundersen [Sun, 3 Aug 2014 16:45:07 +0000 (18:45 +0200)]
networkd: add and expose per-link LLMNR config option

7 years agoresolve-host: properly align long arguments in help text
Lennart Poettering [Mon, 4 Aug 2014 14:25:14 +0000 (16:25 +0200)]
resolve-host: properly align long arguments in help text

7 years agobus: always explicitly close bus from main programs
Lennart Poettering [Mon, 4 Aug 2014 14:22:09 +0000 (16:22 +0200)]
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.

7 years agoCorrect references to ProtectSystem and ProtectHome in documentation
Ansgar Burchardt [Mon, 28 Jul 2014 16:57:30 +0000 (18:57 +0200)]
Correct references to ProtectSystem and ProtectHome in documentation

7 years agoterminal: avoid warning about signed-unsigned comparison
Zbigniew Jędrzejewski-Szmek [Mon, 4 Aug 2014 03:40:00 +0000 (23:40 -0400)]
terminal: avoid warning about signed-unsigned comparison

7 years agoresolve-host: fix missed search&replace
Zbigniew Jędrzejewski-Szmek [Mon, 4 Aug 2014 03:41:45 +0000 (23:41 -0400)]
resolve-host: fix missed search&replace

7 years agoFix misuse of uint64_t as size_t
Zbigniew Jędrzejewski-Szmek [Mon, 4 Aug 2014 02:50:00 +0000 (22:50 -0400)]
Fix misuse of uint64_t as size_t

They have different size on 32 bit, so they are really not interchangable.

7 years agoutil.h: fix typo
Zbigniew Jędrzejewski-Szmek [Mon, 4 Aug 2014 02:11:34 +0000 (22:11 -0400)]
util.h: fix typo

7 years agoresolved: RRSIG records
Zbigniew Jędrzejewski-Szmek [Sun, 3 Aug 2014 22:17:22 +0000 (18:17 -0400)]
resolved: RRSIG records

7 years agoresolved: add identifiers for dnssec algorithms
Zbigniew Jędrzejewski-Szmek [Sun, 3 Aug 2014 20:44:49 +0000 (16:44 -0400)]
resolved: add identifiers for dnssec algorithms

7 years agoresolved: DNSKEY records
Zbigniew Jędrzejewski-Szmek [Sun, 3 Aug 2014 20:05:41 +0000 (16:05 -0400)]
resolved: DNSKEY records

7 years agoresolve-host: make arg_type an int
Zbigniew Jędrzejewski-Szmek [Sun, 3 Aug 2014 18:02:04 +0000 (14:02 -0400)]
resolve-host: make arg_type an int

We are using it also to store _DNS_TYPE_INVALID, so it should be signed.

7 years agoresolve: add more record types and convert to gperf table
Zbigniew Jędrzejewski-Szmek [Fri, 1 Aug 2014 23:37:16 +0000 (19:37 -0400)]
resolve: add more record types and convert to gperf table

We are unlikely to evert support most of them, but we can at least
display the types properly.

The list is taken from the IANA list.

The table of number->name mappings is converted to a switch
statement. gcc does a nice job of optimizing lookup (when optimization
is enabled).

systemd-resolve-host -t is now case insensitive.

7 years agobuild-sys: use a common rule for some gperf commands
Zbigniew Jędrzejewski-Szmek [Fri, 1 Aug 2014 23:36:48 +0000 (19:36 -0400)]
build-sys: use a common rule for some gperf commands

7 years agoresolved: align last rr column
Zbigniew Jędrzejewski-Szmek [Fri, 1 Aug 2014 23:36:33 +0000 (19:36 -0400)]
resolved: align last rr column

7 years agotty-ask-password-agent: modernization
Zbigniew Jędrzejewski-Szmek [Sun, 3 Aug 2014 16:52:03 +0000 (12:52 -0400)]
tty-ask-password-agent: modernization

7 years agoUnify parse_argv style
Zbigniew Jędrzejewski-Szmek [Sat, 2 Aug 2014 15:12:21 +0000 (11:12 -0400)]
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.

7 years agoresolved: avoid possible dereference of null pointer
Thomas Hindoe Paaboel Andersen [Sun, 3 Aug 2014 20:41:25 +0000 (22:41 +0200)]
resolved: avoid possible dereference of null pointer

In dns_scope_make_reply_packet the structs q, answer, and soa can be
null. We should check for null before reading their fields.

7 years agosd-dhcp-server: avoid returning garbage value
Thomas Hindoe Paaboel Andersen [Sun, 3 Aug 2014 17:45:20 +0000 (19:45 +0200)]
sd-dhcp-server: avoid returning garbage value

Force renewing with a pool size of 0 would return the uninitialized r.

7 years agosd-dhcp-server: check if r < 0
Thomas Hindoe Paaboel Andersen [Sun, 3 Aug 2014 17:30:38 +0000 (19:30 +0200)]
sd-dhcp-server: check if r < 0

7 years agoresolve-host: use correct format specifier
Thomas Hindoe Paaboel Andersen [Sun, 3 Aug 2014 07:39:30 +0000 (09:39 +0200)]
resolve-host: use correct format specifier

7 years agoresolved: remove unused variables
Thomas Hindoe Paaboel Andersen [Sat, 2 Aug 2014 21:38:01 +0000 (23:38 +0200)]
resolved: remove unused variables

7 years agoswitch-root: umount the old root correctly
Dan Dedrick [Tue, 29 Jul 2014 19:31:23 +0000 (15:31 -0400)]
switch-root: umount the old root correctly

The unmount occurs after the pivot_root, so the path used to unmount
should take into account the new root directory. This will allow the
umount to actually succeed.