Commit Graph

42133 Commits

Author SHA1 Message Date
Yu Watanabe f4dad55b8b
Merge pull request #13899 from poettering/in-gid-tweak
user-util: tweak to in_gid()
2019-11-03 22:54:32 +09:00
Yu Watanabe 5e467d74ad
Merge pull request #13909 from poettering/env-copy-pid
Fixes for the "saved_env" copy logic
2019-11-03 22:46:42 +09:00
Justin Trudell 0ccdaa79ca nspawn: respect quiet on capabilities warning 2019-11-03 22:05:48 +09:00
Lennart Poettering fe573a798d fs-util: let's avoid unnecessary strerror()
strerror() is not thread safe. Let's avoid it where it is easy hence.

(Ideally we'd not use it at all anymore, but that's sometimes a bit
nasty, not in this case though, where it is very easy to avoid)

Follow-up for: 27c3112dcb
2019-11-03 22:04:39 +09:00
Yu Watanabe 8574039520
Merge pull request #13916 from ddstreet/test-network
test-network: minor changes to work better on Debian/Ubuntu autopkgtest
2019-11-03 21:42:15 +09:00
Lennart Poettering 43c3fb4680 nspawn: mangle slice name
It's user-facing, parsed from the command line and we typically mangle
in these cases, let's do so here too. (In particular as the identical
switch for systemd-run already does it.)
2019-11-03 21:32:56 +09:00
Zbigniew Jędrzejewski-Szmek 08e82b84ca basic/signal-util: drop unnecessary parens 2019-11-02 11:56:03 +01:00
Lennart Poettering df957acc66
Merge pull request #13905 from poettering/cpuset-fixes
fixes to the cpuset cgroup logic
2019-11-01 23:44:36 +01:00
Dan Streetman 426654d728 test-network: Remove/replace non-capturing group regex
The systemd-networkd-tests.py has some regex that uses non-capturing
groups, but there is no need to use that with assertRegex; the
groups aren't referenced so it doesn't matter if it's capturing or
non-capturing.  However, there are a few places where optional groups
should have been used instead, so this changes that.

Specifically, groups like this:
(?:whatever |)
should actually be:
(whatever )?

Additionally, this is specifically needed for these tests to run on
Debian systems, because this assertRegex:
'Link File: (?:/usr)/lib/systemd/network/99-default.link'
needs to be:
'Link File: (/usr)?/lib/systemd/network/99-default.link'
2019-11-01 12:32:49 -04:00
Dan Streetman 7471bcb06e test: check /usr/lib and /lib for systemd binaries
Fedora uses /usr/lib while Debian uses /lib; find the right location
2019-11-01 12:00:57 -04:00
Dan Streetman 856423f14d test/test-network/systemd-networkd-tests.py: suppress stderr for functionality checks 2019-11-01 12:00:53 -04:00
Kevin Kuehler b9dc511954 mkosi: Find hostname command on Arch Linux
exec-specifier.service: Executing: /usr/bin/sh -c 'test mkosi-7d5e81c7b81c42338d060a6b98edd44a = $(hostname)'
/usr/bin/sh: hostname: command not found
/usr/bin/sh: line 0: test: mkosi-7d5e81c7b81c42338d060a6b98edd44a: unary operator expected
Received SIGCHLD from PID 7389 (sh).
Child 7389 (sh) died (code=exited, status=2/INVALIDARGUMENT)

gettext provides the hostname binary, but puts it in
/usr/lib/gettext/hostname, which is not part of the default $PATH. Using
inetutils instead puts the binary in /usr/bin/hostname.
2019-11-01 13:34:41 +01:00
Lennart Poettering f14c9bafa8 update TODO 2019-11-01 13:07:58 +01:00
Lennart Poettering dfaf16ebed static-destruct: add missing closing '(' in comment 2019-11-01 11:31:20 +01:00
Lennart Poettering 0e06a03165 pid1: rework environment block copy logic
This reworks the logic introduced in
a5cede8c24 (#13693).

First of all, let's move this out of util.c, since only PID 1 really
needs this, and there's no real need to have it in util.c.

Then, fix freeing of the variable. It previously relied on
STATIC_DESTRUCTOR_REGISTER() which however relies on static_destruct()
to be called explicitly. Currently only the main-func.h macros do that,
and PID 1 does not. (It might be worth investigating whether to do that,
but it's not trivial.) Hence the freeing wasn't applied.

Finally, an OOM check was missing, add it in.
2019-11-01 11:30:59 +01:00
Lennart Poettering a897a7b837 cgroup: add missing OOM check, and shorten code a bit
cpu_set_to_range_string() can fail due to OOM. Handle that.

unit_write_settingf() exists, use it instead of formatting a string
beforehand.

cpu_set_add_all() can fail due to OOM. Let's avoid it if we don't have
to use it, just copy over the cpuset directly.
2019-11-01 10:22:03 +01:00
Lennart Poettering c259ac9aa2 cpuset: fix indentation and log about OOM we otherwise ignore 2019-11-01 10:21:53 +01:00
Lennart Poettering 85c3b27891 cgroup: add some basic OOM safety where it was missing 2019-11-01 10:21:35 +01:00
Zach Smith eccebf4b0d systemd-tmpfiles: deprecate F for f+ 2019-10-31 22:27:56 -07:00
Yu Watanabe 6878c02245 NEWS: mention NetworkEmulatorDuplicateRate= setting 2019-11-01 13:18:13 +09:00
Yu Watanabe aab64de281
Merge pull request #13888 from ssahani/qdisc
tc qdisc: netem add support to duplicate packets.
2019-11-01 11:44:10 +09:00
Susant Sahani 0cc9e972ff network: DHCP server remove duplicate free 2019-11-01 11:40:32 +09:00
Susant Sahani c0619079cc Fix CID 1406578: Resource leaks (RESOURCE_LEAK)
** CID 1406578:  Resource leaks  (RESOURCE_LEAK)
/src/libsystemd-network/sd-dhcp-server.c: 155 in sd_dhcp_raw_option_new()
2019-10-31 21:13:57 +01:00
Lennart Poettering eb2cfa81b0 test: add really basic in_gid() test 2019-10-31 21:00:00 +01:00
Lennart Poettering 6e0a388854 user-util: tweak to in_gid()
Let's make this robust towards parallel updates to group lists. This is
not going to happen IRL, but it makes me sleep better at night: let's
iterate a couple of times in case the list is updated while we are at
it.

Follow-up for: f5e0b942af
2019-10-31 20:59:27 +01:00
Anita Zhang 3ec56e53a2
Merge pull request #13895 from jsynacek/master
sd-dhcp: fix resource leak
2019-10-31 11:39:08 -07:00
Anita Zhang 28b05d1e6e
Merge pull request #13891 from yuwata/basic-drop-missing
tree-wide: drop missing.h
2019-10-31 11:35:58 -07:00
Anita Zhang 9e73d33128
Merge pull request #13892 from keur/mkosi_arch
Fix mkosi on Arch Linux
2019-10-31 11:22:37 -07:00
Jóhann B. Guðmundsson 294eeed144 Update to Fedora31 2019-10-31 16:13:08 +01:00
Jan Synacek 7050e89ee0 sd-dhcp: fix resource leak
CID#1406578
2019-10-31 14:37:46 +01:00
Susant Sahani 6edfb1f540 tc: qdisc remove some duplicate code 2019-10-31 10:36:28 +01:00
Susant Sahani b9c5aa3c65 qdisc: netem add support to duplicate packets.
using this option the chosen percent of packets is duplicated before
queuing them
2019-10-31 10:36:28 +01:00
Kevin Kuehler 9e05564006 Fix mkosi on Arch Linux
/* test compression */
XZ compression finished (38280 -> 11756 bytes, 30.7%)
sh: diff: command not found
Assertion 'system(cmd) == 0' failed at src/journal/test-compress.c:198,
function test_compress_stream(). Aborting.

The journal compression test shells out to diff, so include diffutils as
a BuildPackage on Arch.

Remaining fixes in https://github.com/systemd/mkosi/pull/377
2019-10-31 02:32:23 -07:00
Yu Watanabe f5947a5e92 tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
Zbigniew Jędrzejewski-Szmek 673d873a42
Merge pull request #13510 from medhefgo/boot
sd-boot: Be silent on regular boots
2019-10-31 09:21:13 +01:00
Yu Watanabe 9648956d1f test: move {test,fuzz}-fido-id-desc.c into src/udev/fido_id 2019-10-31 10:37:42 +09:00
Lennart Poettering 20bae8b94d meson: correct man page deps 2019-10-31 09:04:19 +09:00
Susant Sahani 564ca98484 networkd: dhcp server Support Vendor specific 43
Implementes https://tools.ietf.org/html/rfc2132

```
[DHCPServer]
SendRawOption=26:uint32:1400
SendRawOption=23:uint8:10

```
Frame 448: 350 bytes on wire (2800 bits), 350 bytes captured (2800 bits) on interface 0
Linux cooked capture
Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11
User Datagram Protocol, Src Port: 67, Dst Port: 68
Dynamic Host Configuration Protocol (ACK)
    Message type: Boot Reply (2)
    Hardware type: Ethernet (0x01)
    Hardware address length: 6
    Hops: 0
    Transaction ID: 0x71f8de9d
    Seconds elapsed: 0
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0
    Your (client) IP address: 192.168.5.11
    Next server IP address: 0.0.0.0
    Relay agent IP address: 0.0.0.0
    Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type (ACK)
        Length: 1
        DHCP: ACK (5)
    Option: (51) IP Address Lease Time
        Length: 4
        IP Address Lease Time: (3600s) 1 hour
    Option: (1) Subnet Mask (255.255.255.0)
        Length: 4
        Subnet Mask: 255.255.255.0
    Option: (3) Router
        Length: 4
        Router: 192.168.5.1
    Option: (6) Domain Name Server
        Length: 4
        Domain Name Server: 192.168.5.1
    Option: (42) Network Time Protocol Servers
        Length: 4
        Network Time Protocol Server: 192.168.5.1
    Option: (101) TCode
        Length: 13
        TZ TCode: Europe/Berlin
    Option: (43) Vendor-Specific Information
        Length: 9
        Value: 1701311a0431343030
    Option: (54) DHCP Server Identifier (192.168.5.1)
        Length: 4
        DHCP Server Identifier: 192.168.5.1
    Option: (255) End
        Option End: 255

```
2019-10-31 09:03:43 +09:00
Christian Rebischke 597f905c76 add other worthy news
I think we can mention that systemd-resolved is able to validate IP
address certificates and prefer TLS 1.3 before TLS 1.2 now.

Also the `machinectl reboot` command actually works now.

Signed-off-by: Christian Rebischke <chris@nullday.de>
2019-10-31 09:02:15 +09:00
Anita Zhang b219d193a2
Merge pull request #13884 from poettering/event-fd-close-fix
sd-event: don't invalidate source type on disconnect
2019-10-30 15:58:36 -07:00
Christian Rebischke 9d9010f2e9 add systemd logo to README.md
The logo in the readme is hosted by github as the systemd group avatar.

Signed-off-by: Christian Rebischke <chris@nullday.de>
2019-10-30 23:22:07 +01:00
Zbigniew Jędrzejewski-Szmek be75c86dc6 calendarspec: fix calculation of timespec iterations that fall onto a DST change
If we tested a candidate time that would fall onto the DST change, and we
realized that it is now a valid time ('cause the given "hour" is missing),
we would jump to to beginning of the next bigger time period, i.e. the next
day.

mktime_or_timegm() already tells us what the next valid time is, so let's reuse
this, and continue the calculations at this point. This should allow us to
correctly jump over DST changes, but also leap seconds and similar.  It should
be OK even multiple days were removed from calendar, similarly to the
Gregorian-Julian transition. By reusing the information from normalization, we
don't have to make assumptions what the next valid time is.

Fixes #13745.

$ TZ=Australia/Sydney faketime '2019-10-06 01:50' build/systemd-analyze calendar 0/1:0/1 --iterations 20 | grep Iter
       Iter. #2: Sun 2019-10-06 01:52:00 AEST
       Iter. #3: Sun 2019-10-06 01:53:00 AEST
       Iter. #4: Sun 2019-10-06 01:54:00 AEST
       Iter. #5: Sun 2019-10-06 01:55:00 AEST
       Iter. #6: Sun 2019-10-06 01:56:00 AEST
       Iter. #7: Sun 2019-10-06 01:57:00 AEST
       Iter. #8: Sun 2019-10-06 01:58:00 AEST
       Iter. #9: Sun 2019-10-06 01:59:00 AEST
      Iter. #10: Sun 2019-10-06 03:00:00 AEDT
      Iter. #11: Sun 2019-10-06 03:01:00 AEDT
      Iter. #12: Sun 2019-10-06 03:02:00 AEDT
      Iter. #13: Sun 2019-10-06 03:03:00 AEDT
      Iter. #14: Sun 2019-10-06 03:04:00 AEDT
      Iter. #15: Sun 2019-10-06 03:05:00 AEDT
      Iter. #16: Sun 2019-10-06 03:06:00 AEDT
      Iter. #17: Sun 2019-10-06 03:07:00 AEDT
      Iter. #18: Sun 2019-10-06 03:08:00 AEDT
      Iter. #19: Sun 2019-10-06 03:09:00 AEDT
      Iter. #20: Sun 2019-10-06 03:10:00 AEDT

$ TZ=Australia/Sydney faketime 2019-10-06 build/systemd-analyze calendar 2/4:30 --iterations=3
  Original form: 2/4:30
Normalized form: *-*-* 02/4:30:00
    Next elapse: Sun 2019-10-06 06:30:00 AEDT
       (in UTC): Sat 2019-10-05 19:30:00 UTC
       From now: 5h 29min left
       Iter. #2: Sun 2019-10-06 10:30:00 AEDT
       (in UTC): Sat 2019-10-05 23:30:00 UTC
       From now: 9h left
       Iter. #3: Sun 2019-10-06 14:30:00 AEDT
       (in UTC): Sun 2019-10-06 03:30:00 UTC
       From now: 13h left
2019-10-30 17:57:01 +01:00
Jan Janssen d9690d8fe9 sd-boot: Silence compiler warning when building with -O2 2019-10-30 17:47:55 +01:00
Jan Janssen 391719682b sd-boot: Don't loudly complain if RNG protocol isn't available
Fixes #13503
2019-10-30 17:47:50 +01:00
Lennart Poettering f598255951 sd-event: don't invalidate source type on disconnect
This fixes fd closing if fd ownership is requested.
2019-10-30 17:43:57 +01:00
Jan Janssen 9ea4d81c12 sd-boot: Only disable optimization on debug builds 2019-10-30 17:34:12 +01:00
Zbigniew Jędrzejewski-Szmek b7db8b7b13 NEWS: fix two typos 2019-10-30 15:58:53 +01:00
Lennart Poettering 81610e9609 analyze: fix minor memleak 2019-10-30 15:50:37 +01:00
Lennart Poettering ea334dc328 analyze: sort list of unknown syscalls kernel implements 2019-10-30 15:50:06 +01:00
Lennart Poettering 9e48626571 seccomp: add new Linux 5.3 syscalls to syscall filter lists
Many syscalls added and all fit nicely into existing groups, hence lets
add them there.
2019-10-30 15:42:49 +01:00