Commit Graph

45082 Commits

Author SHA1 Message Date
Lennart Poettering 42ba8d25ad update TODO 2020-05-29 18:32:38 +02:00
Lennart Poettering 5fc20ede0f
Merge pull request #15954 from keszybz/unit-file-leak
Fix leak in unit path cache and another small optimization
2020-05-29 16:02:53 +02:00
Evgeny Vereshchagin ceae629564 README: add a Fossies codespell badge
I keep forgetting where the report is. Hopefully the badge will
make it easier to find it. I also fixed several typos codespell
found along the way.
2020-05-29 15:06:16 +02:00
Yu Watanabe 433e14fda7 network: fix memleaks
Fixes #15951.
2020-05-29 14:49:40 +02:00
Yu Watanabe 7c5f97f5e3 network: clean up doubled white space 2020-05-29 14:49:18 +02:00
Lennart Poettering 4737345173 update NEWS 2020-05-29 10:48:58 +02:00
Susant Sahani 9efa8a3cff network: DHCPv6 Assign delegated prefix to LAN interface
In DHCPv6-PD environment, where WAN interface requests IPv6 via DHCPv6,
receives the address as well as delegated prefixes, with LAN interfaces
serving those delegated prefixes in their router advertisement messages.
The LAN interfaces on the router themselves do not have
the IPv6 addresses assigned by networkd from the prefix it
serves on that interface. Now this patch enables it.
2020-05-29 16:20:37 +09:00
Susant Sahani 5c95a9134a sd-network: Rectify Advertise Message Processing by a Client
We need to fix RCC 2215 behaviour with rfc7550 errata
and https://tools.ietf.org/html/rfc8415.

[RFC3315] specifies that a client must ignore an Advertise message if
   a server will not assign any addresses to a client, and [RFC3633]
   specifies that a client must ignore an Advertise message if a server
   returns the NoPrefixAvail status to a requesting router.  Thus, a
   client requesting both IA_NA and IA_PD, with a server that only
   offers either addresses or delegated prefixes, is not supported by
   the current protocol specifications.

   Solution: a client SHOULD accept Advertise messages, even when not
   all IA option types are being offered.  And, in this case, the client
   SHOULD include the not offered IA option types in its Request.  A
   client SHOULD only ignore an Advertise message when none of the
   requested IA options include offered addresses or delegated prefixes.
   Note that ignored messages MUST still be processed for SOL_MAX_RT and
   INF_MAX_RT options as specified in [RFC7083].

   Replace Section 17.1.3 of RFC 3315: (existing errata)

     The client MUST ignore any Advertise message that includes a Status
     Code option containing the value NoAddrsAvail, with the exception
     that the client MAY display the associated status message(s) to the
     user.

   With the following text (which addresses the existing erratum
   [Err2471] and includes the changes made by [RFC7083]):

     The client MUST ignore any Advertise message that contains no
     addresses (IAADDR options encapsulated in IA_NA or IA_TA options)
     and no delegated prefixes (IAPREFIX options encapsulated in IA_PD
     options; see RFC 3633) with the exception that the client:

       - MUST process an included SOL_MAX_RT option (RFC 7083) and
       - MUST process an included INF_MAX_RT option (RFC 7083).

     A client can display any associated status message(s) to the user
     or activity log.

     The client ignoring this Advertise message MUST NOT restart the
     Solicit retransmission timer.
2020-05-29 16:17:36 +09:00
Yu Watanabe fac729f811
Merge pull request #15911 from poettering/unit-name-tighten
pid1: improve logging when we encounter a path that is too long to be converted into a mount unit name
2020-05-29 15:55:38 +09:00
Lennart Poettering f6dbcebdc2 sd-device: check netlink netns matches host netns before using monitor
Tracking down #15931 confused the hell out of me, since running homed in
gdb from the command line worked fine, but doing so as a service failed.
Let's make this more debuggable and check if we live in the host netns
when allocating a new udev monitor.

This is just debug stuff, so that if things don't work, a quick debug
run will reveal what is going on.

That said, while we are at it, also fix unexpected closing of passed in
fd when failing.
2020-05-29 15:28:10 +09:00
Yu Watanabe 8abbd9a4d9
Merge pull request #15944 from poettering/sd-path-fixups
sd-path: some fixups
2020-05-29 15:23:37 +09:00
Yu Watanabe 27cd09442f
Merge pull request #15942 from poettering/pass-pktinfo
disable PassCredentials= on networkd netlink socket, enable NETLINK_PKTINFO instead
2020-05-29 15:23:15 +09:00
Yu Watanabe cfbee85ce2
Merge pull request #15956 from poettering/news-v246
start of a NEWS file for v246 and minor assorted fixes
2020-05-29 15:10:47 +09:00
Yu Watanabe 63ef9d31fd
Merge pull request #15930 from poettering/udev-no-lock-warn
udev: when the BSD lock on a block device is taken, don't complain
2020-05-29 10:39:14 +09:00
Yu Watanabe 63b00fa77d
Merge pull request #15619 from ddstreet/ignore_carrier_loss_default
Set IgnoreCarrierLoss= default to value of ConfigureWithoutCarrier=
2020-05-29 10:04:00 +09:00
Lennart Poettering bfafec253c update TODO 2020-05-28 23:54:35 +02:00
Lennart Poettering ccdf03b9c7 sd-path: drop "-dir" and "-path" suffixes from path enums
Clean up the naming of the sd-path enums. Previously, the more recently
added fields where named in the form SD_PATH_xyz_DIR and
SD_PATH_xyz_PATH, while the older fields where called just SD_PATH_xyz
and SD_PATH_SEARCH_xyz. Let's clean this up, to come to a more unified
way how we name this stuff.

I opted to stick to the old naming, i.e. dropthe suffixes. It's a bit of
a bike-shedding question of course, but I think there's a good reason to
avoid the additional DIR and PATH suffixes: the enum prefix contains
"PATH" anyway (i.e. "SD_PATH_"), so including PATH twice in each name is
redundant. Moreover, the key difference between the enums with the "dir"
and the "path" in the name is that the latter are *seach* paths, and I
think this is better emphasized by sticking to the "SEARCH" in the name.

Moreover dropping the suffixes makes the identifiers a lot shorter, in
particular in the "systemd-path" list output. And that's always good.

This means the naming pkgconfig file and in sd-path slightly deviate
(though the mapping is very simple), but I think that's OK, given that
this is developer facing and not user facing.
2020-05-28 23:54:35 +02:00
Lennart Poettering 4a56315a99 path: use ROOTPREFIX properly
ROOTPREFIX doesn't include the trailing /, hence add it in where needed.

Also, given that sysctl.d/, binfmt.d/, sysusers.d/ are generally
accessed before /var/ is up they should use ROOTPREFIX rather than
PREFIX. Fix that.
2020-05-28 23:52:34 +02:00
Lennart Poettering 6527b019fc xdg-autostart: fix two coverity found issues
Fixes: CID#1429003
Fixes: CID#1429004
2020-05-28 23:38:38 +02:00
Lennart Poettering 871dc8d644 homed: enable userdb too if homed is requested
Strictly speaking you can run homed without userdb. But it doesn't
really make much sense: they go hand in hand and implement the same
concepts, just for different sets of users. Let's hence disable both
automatically by default if homed is requested.

(We don't do the reverse: opting into userdbd shouldn't mean that you
are OK with homed.)

And of course, users can always deviate from our defaults easily, and
turn off userbd again right-away if they don't like it, and things will
generally work.
2020-05-28 23:38:29 +02:00
Lennart Poettering a745117dba udev: catch genuine_random_bytes() failures
Fixes: CID#1428926
2020-05-28 23:38:25 +02:00
Lennart Poettering 70d8586365 libsystemd: properly export new sd_notify_barrier() API call
Follow-up for: 4f07ddfa9b
2020-05-28 23:38:21 +02:00
Lennart Poettering 5a7cf2e9d8 hwdb: whitespace fix 2020-05-28 23:38:17 +02:00
Lennart Poettering b0d0e0ef98 start NEWS file for v246 2020-05-28 23:37:43 +02:00
Lennart Poettering 08b8f29a25 tree-wide: remove spurious whitespace 2020-05-28 19:23:47 +02:00
Zbigniew Jędrzejewski-Szmek a4ac27c1af manager: free the jobs hashmap after we have no jobs
After a larger transaction, e.g. after bootup, we're left with an empty hashmap
with hundreds of buckets. Long-term, it'd be better to size hashmaps down when
they are less than 1/4 full, but even if we implement that, jobs hashmap is
likely to be empty almost always, so it seems useful to deallocate it once the
jobs count reaches 0.
2020-05-28 18:54:20 +02:00
Zbigniew Jędrzejewski-Szmek f6173cb955 core: define UnitDependency iterators in loops
Reduced scope of variables is always nice.
2020-05-28 18:53:35 +02:00
Zbigniew Jędrzejewski-Szmek 3fb2326f3e shared/unit-file: make sure the old hashmaps and sets are freed upon replacement
Possibly fixes #15220. (There might be another leak. I'm still investigating.)

The leak would occur when the path cache was rebuilt. So in normal circumstances
it wouldn't be too bad, since usually the path cache is not rebuilt too often. But
the case in #15220, where new unit files are created in a loop and started, the leak
occurs once for each unit file:

$ for i in {1..300}; do cp ~/.config/systemd/user/test0001.service ~/.config/systemd/user/test$(printf %04d $i).service; systemctl --user start test$(printf %04d $i).service;done
2020-05-28 18:51:52 +02:00
Zbigniew Jędrzejewski-Szmek db868d45f9 core: make unit_set_invocation_id static
No functional change.
2020-05-28 18:47:01 +02:00
Lennart Poettering 60daebdec2
Merge pull request #15882 from poettering/pam-sudo-fixes-part4
More pam_systemd fixes split out of #15742
2020-05-28 00:27:51 +02:00
Lennart Poettering 38344f1a79
Merge pull request #15893 from DaanDeMeyer/firstboot-overwrite
systemd-firstboot: Add --force, --delete-root-password and --root-password-is-hashed options
2020-05-27 22:51:02 +02:00
Lennart Poettering e0d70f7691 pam_systemd: set legacy D-Bus path only if the runtime directory is validated 2020-05-27 22:47:30 +02:00
Lennart Poettering 6d06dfad85 pam_systemd: be more thorough when validating runtime paths 2020-05-27 22:47:15 +02:00
Lennart Poettering 08ab18618e resolved: tweak cmsg calculation
We ask for the TTL, then have enough space for it.

We probably can drop the extra cmsg space now, but let's figure that out
another time, since the extra cmsg space is used elsewhere in resolved
as well.
2020-05-27 22:40:59 +02:00
Lennart Poettering 43007b302e networkd: clean up NETLINK_PKTINFO vs. SO_PASSCRED confusion
We actually care for NETLINK_PKTINFO, not for SO_PASSCRED, hence when
allocating the netlink socket, configure things accordingly.

Tracked down by Benjamin Robin, see:

https://github.com/systemd/systemd/pull/15571#issuecomment-633213747
2020-05-27 22:40:56 +02:00
Lennart Poettering a3d19f5d99 core: add new PassPacketInfo= socket unit property 2020-05-27 22:40:38 +02:00
Lennart Poettering 35a3eb9bdc socket-util: add generic socket_pass_pktinfo() helper
The helper turns on the protocol specific "packet info" structure cmsg
for three relevant protocols we know.
2020-05-27 22:39:34 +02:00
Daan De Meyer a5925354bb firstboot: Add --kernel-command-line option 2020-05-27 18:54:26 +02:00
Daan De Meyer 676339a191 firstboot: Add --root-password-hashed option 2020-05-27 18:54:26 +02:00
Daan De Meyer 97a1a1103c Remove systemd-firstboot --force entry from TODO 2020-05-27 18:54:26 +02:00
Daan De Meyer 4926ceaff3 firstboot: Add --delete-root-password option 2020-05-27 18:54:25 +02:00
Daan De Meyer b4909a3fd0 firstboot: Add --force option 2020-05-27 18:54:25 +02:00
Daan De Meyer 2da3dc69e7 fileio: Rename rename_and_apply_smack to rename_and_apply_smack_floor_label. 2020-05-27 18:54:25 +02:00
Daan De Meyer 90c81688ff fileio: Refactor sync_rights to take fds as arguments 2020-05-27 18:54:25 +02:00
Daan De Meyer 494735f3d0 sysusers: Move sync_rights and rename_and_apply_smack to basic 2020-05-27 18:54:25 +02:00
Daan De Meyer 1fbc95d388 firstboot: Don't check twice if /etc/shadow exists 2020-05-27 18:54:25 +02:00
Lennart Poettering bb2294e454
Merge pull request #15669 from andir/systemd-ipv6-pd-subnet-id
networkd: subnet id support for ipv6 prefix delegation
2020-05-27 18:47:26 +02:00
Lennart Poettering 6bce17455e
Merge pull request #15226 from benzea/benzea/xdg-autostart-generator
xdg-autostart-generator: a generator for XDG autostart files
2020-05-27 18:41:01 +02:00
Michael Biebl f978844eb6 man: fix conditional in homed.conf.xml 2020-05-27 16:59:42 +02:00
Lennart Poettering 5abee64ed4 udev: when the BSD lock on a block device is taken, don't complain
if someone implements https://systemd.io/BLOCK_DEVICE_LOCKING/ then we
shouldn't loudly complain about that.

This reverts back to the original behaviour from
3ebdb81ef088afd3b4c72b516beb5610f8c93a0d: when the lock is taken we
silently skip processing the device and sending out the messages for it.
2020-05-27 15:30:48 +02:00