1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

16449 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
de292aa1dd resolve-host: make arg_type an int
We are using it also to store _DNS_TYPE_INVALID, so it should be signed.
2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek
7263f72499 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.
2014-08-03 22:02:32 -04:00
Zbigniew Jędrzejewski-Szmek
fd00a08821 build-sys: use a common rule for some gperf commands 2014-08-03 21:46:08 -04:00
Zbigniew Jędrzejewski-Szmek
23432a1c24 resolved: align last rr column 2014-08-03 21:46:08 -04:00
Zbigniew Jędrzejewski-Szmek
1d749d044b tty-ask-password-agent: modernization 2014-08-03 21:46:07 -04:00
Zbigniew Jędrzejewski-Szmek
601185b43d 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.
2014-08-03 21:46:07 -04:00
Thomas Hindoe Paaboel Andersen
75cd513ef8 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.
2014-08-03 23:01:57 +02:00
Thomas Hindoe Paaboel Andersen
621ac3d2cc sd-dhcp-server: avoid returning garbage value
Force renewing with a pool size of 0 would return the uninitialized r.
2014-08-03 20:42:59 +02:00
Thomas Hindoe Paaboel Andersen
c15fb62a73 sd-dhcp-server: check if r < 0 2014-08-03 20:42:59 +02:00
Thomas Hindoe Paaboel Andersen
be63641349 resolve-host: use correct format specifier 2014-08-03 13:19:24 +02:00
Thomas Hindoe Paaboel Andersen
e850d8e1ac resolved: remove unused variables 2014-08-03 13:19:19 +02:00
Dan Dedrick
23f25b1496 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.
2014-08-03 01:32:08 -04:00
Zbigniew Jędrzejewski-Szmek
4212a3375e nspawn: fix truncation of machine names in interface names
Based on patch by Michael Marineau <michael.marineau@coreos.com>:

When deriving the network interface name from machine name strncpy was
not properly null terminating the string and the maximum string size as
returned by strlen() is actually IFNAMSIZ-1, not IFNAMSIZ.
2014-08-03 01:29:51 -04:00
Karel Zak
9a6f36c08f bootchart: ask for --rel when failed to initialize graph start time
We always read system uptime before log start time. So the uptime
should be always smaller number, except it includes system suspend
time. It seems better to ask for --rel and exit() than try to be
smart and try to recovery from this situation or generate huge
messy graphs.
2014-08-03 01:12:53 -04:00
Karel Zak
c358d728e7 bootchart: don't parse /proc/uptime, use CLOCK_BOOTTIME
* systemd-bootchart always parses /proc/uptime, although the
  information is unnecessary when --rel specified

* use /proc/uptime is overkill, since Linux 2.6.39 we have
  clock_gettime(CLOCK_BOOTTIME, ...). The backend on kernel side is
  get_monotonic_boottime() in both cases.

* main() uses "if (graph_start <= 0.0)" to detect that /proc is
  available.

  This is fragile solution as graph_start is always smaller than zero
  on all systems after suspend/resume (e.g. laptops), because in this
  case the system uptime includes suspend time and uptime is always
  greater number than monotonic time. For example right now difference
  between uptime and monotonic time is 37 hours on my laptop.

  Note that main() calls log_uptime() (to parse /proc/uptime) for each
  sample when it believes that /proc is not available. So on my laptop
  systemd-boochars spends all live with /proc/uptime parsing +
  nanosleep(), try

    strace  /usr/lib/systemd/systemd-bootchart

  to see the never ending loop.

  This patch uses access("/proc/vmstat", F_OK) to detect procfs.
2014-08-03 01:12:53 -04:00
Zbigniew Jędrzejewski-Szmek
799a8f39d8 journal-remote: rename KEY_FILE to avoid confict with <linux/input.h> 2014-08-03 01:12:30 -04:00
Umut Tezduyar Lindskog
e72f054eb5 ldconfig: dont run it if ldconfig is not installed 2014-08-03 00:33:01 -04:00
Zbigniew Jędrzejewski-Szmek
7bed7f0e3b Move BTRFS_IOC_DEVICES_READY to missing.h 2014-08-03 00:28:12 -04:00
Simon McVittie
dced15575f util.h: include missing.h, for struct file_handle
This breaks udev-builtin-btrfs.c, which reinvents some of missing.h,
so use missing.h there too.

[zj: removed #include "config.h" and wrapped #include <linux/btrfs.h>
     in ifdef HAVE_LINUX_BTRFS_H as discussed on the mailing list.]
2014-08-03 00:28:12 -04:00
Zbigniew Jędrzejewski-Szmek
0943f4b7b2 build-sys: fix conftest.c to work on arm
All tests for compiler support were failing with:

/usr/bin/ld: /tmp/ccwnVc2A.o: relocation R_ARM_MOVW_ABS_NC against `a' can not be used when making a shared object; recompile with -fPIC
2014-08-03 00:28:12 -04:00
Tom Gundersen
ac9c87dbc4 Revert "libudev: use get_*_creds from shared rather than util_lookup_*"
This reverts commit a56ba6158b.

The commit was pushed in error.
2014-08-01 22:33:20 +02:00
Lennart Poettering
7b4c2ee75f resolved: always drop multicast membership before adding one
This is apparently necessary on some devices, such as veth.
2014-08-01 20:27:27 +02:00
Lennart Poettering
747c0ff564 resolved: IPV6_UNICAST_IF may fail if we already are bound to a device, like we are for link-local addresses 2014-08-01 19:25:06 +02:00
Lennart Poettering
9198814968 missing: add missing bonding definitions 2014-08-01 18:55:56 +02:00
Lennart Poettering
035d56dc32 update TODO 2014-08-01 18:10:01 +02:00
Lennart Poettering
2c27fbca2d resolved: flush cache each time we change to a different DNS server 2014-08-01 18:10:01 +02:00
Lennart Poettering
5cb36f41f0 resolved: read the system /etc/resolv.conf unless we wrote it ourselves
This way we integrate nicely with foreign network management stacks,
such as NM.
2014-08-01 18:10:01 +02:00
Tom Gundersen
afe7fd56f5 networkd: track the MTU of each link
And inform the DHCPv4 clients about it.
2014-08-01 16:34:50 +02:00
Tom Gundersen
324f818781 sd-dhcp-client: allow the max dhcp message size to be set to the MTU of the link 2014-08-01 16:34:50 +02:00
Tom Gundersen
c18126e8da TODO 2014-08-01 16:34:50 +02:00
Tom Gundersen
a56ba6158b libudev: use get_*_creds from shared rather than util_lookup_* 2014-08-01 16:34:50 +02:00
Lennart Poettering
39d8db043b resolved: rename resolved.h to resolved-manager.h
After all it pretty much exlcusively containers definitions about the
"Manager" object, hence let's call this the most obvious way.
2014-08-01 16:14:59 +02:00
Lennart Poettering
4e945a6f79 resolved: beef up DNS server configuration logic
We now maintain two lists of DNS servers: system servers and fallback
servers.

system servers are used in combination with any per-link servers.

fallback servers are only used if there are no system servers or
per-link servers configured.

The system server list is supposed to be populated from a foreign tool's
/etc/resolv.conf (not implemented yet).

Also adds a configuration switch for LLMNR, that allows configuring
whether LLMNR shall be used simply for resolving or also for responding.
2014-08-01 16:06:39 +02:00
Lennart Poettering
e70df46b97 nss: always explicitly reset all error variables
glibc appears to be broken if we don't explicitly reset all error
variables, let's work around that.

https://bugzilla.redhat.com/show_bug.cgi?id=1125975
2014-08-01 16:06:39 +02:00
Tom Gundersen
9fecce8041 Revert "networkd: don't assume udev_device_new_from_device_id sets errno"
libudev now does set errno correctly, so we can indeed rely on this.

This reverts commit 2b49732c3d.
2014-08-01 11:56:13 +02:00
Tom Gundersen
aa0e72ea54 libudev: set errno when udev_device_new_from_* or udev_device_get_parent_* fail 2014-08-01 11:56:13 +02:00
Lennart Poettering
7cfb38b596 update TODO 2014-08-01 01:57:33 +02:00
Lennart Poettering
7c2a5e264c nss-resolve: fallback to the class NSS "dns" module if we cannot contact resolved
That way DNS resolution works both with and without resolved running.
2014-08-01 01:55:15 +02:00
Lennart Poettering
95dd6257a6 resolved: don't bother caching negative RRs when the SOA TTL is 0 anyway 2014-08-01 00:58:13 +02:00
Lennart Poettering
7be6885326 update TODO 2014-08-01 00:58:13 +02:00
Lennart Poettering
9a015429b3 resolved: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC when aging caches and timeing out transactions
That way the cache doens't get confused when the system is suspended.
2014-08-01 00:58:12 +02:00
Lennart Poettering
7da40fc108 resolved: fix negative caching of IDNA domains 2014-08-01 00:58:12 +02:00
Lennart Poettering
bdf10b5b4d resolved: handle IDNA domains
Make sure we format UTF-8 labels as IDNA when writing them to DNS
packets, and as native UTF-8 when writing them to mDNS or LLMNR packets.

When comparing or processing labels always consider native UTF-8 and
IDNA formats equivalent.
2014-08-01 00:58:12 +02:00
Zbigniew Jędrzejewski-Szmek
afbc4f267b resolved: fix serialization of LOC records, check correctness 2014-07-31 17:42:14 -04:00
Kay Sievers
e90b8642cd kdbus: update header 2014-07-31 23:08:44 +02:00
Kay Sievers
bd64a88fb0 hwdb: update 2014-07-31 23:07:44 +02:00
Lennart Poettering
eb60f9cd4e hostnamed: watch system hostname changes and update LLMNR RRs accordingly 2014-07-31 19:54:43 +02:00
Lennart Poettering
8581858257 resolved: fix deserialization of UTF8 host names 2014-07-31 19:54:24 +02:00
Lennart Poettering
7b9f7afcc0 resolved: accept UTF-8 hostnames from bus clients 2014-07-31 19:53:59 +02:00
Lennart Poettering
07bed172ed resolved: various fixes regarding encoding of UTF8 characters in DNS RRs 2014-07-31 19:51:11 +02:00