Commit Graph

44764 Commits

Author SHA1 Message Date
Lennart Poettering 77a3cec0c7 man: document the new tmpfiles --root= behaviour regarding users 2020-05-07 16:35:20 +02:00
Lennart Poettering 7dc6477dc9 sysusers/tmpfiles: use --root=/ as way to force offline operation (i.e. without NSS) 2020-05-07 16:35:20 +02:00
Lennart Poettering a3451c2c4c tmpfiles: optionally, read /etc/passwd + /etc/group without NSS
There are two libc APIs for accessing the user database: NSS/getpwuid(),
and fgetpwent(). if we run in --root= mode (i.e. "offline" mode), let's
use the latter. Otherwise the former. This means tmpfiles can use the
database included in the root environment for chowning, which is a lot
more appropriate.

Fixes: #14806
2020-05-07 16:35:20 +02:00
Zbigniew Jędrzejewski-Szmek 6dbf40256b man: put all pages which mention a specifier in the index
I wasn't 100% convinced that this is the right thing to do, hence the separate
commit. But e.g. for paths we index all mentions, so I think it's reasonable to
do the same here.
2020-05-07 16:30:10 +02:00
Zbigniew Jędrzejewski-Szmek 6552874506 man: fix indentation in sysusers.d.xml 2020-05-07 16:30:10 +02:00
Lennart Poettering 6a49603e08 update TODO 2020-05-07 16:13:07 +02:00
Lennart Poettering c0440512e6 docs: document the new offline discard logic 2020-05-07 16:13:07 +02:00
Lennart Poettering 28a7f10620 homework: run fitrim or fallocate on logout based on the new user record property 2020-05-07 16:13:07 +02:00
Lennart Poettering cba116991d homectl: add option for controlling new luksOfflineDiscard user record field 2020-05-07 16:13:07 +02:00
Lennart Poettering 5e86c82acd user-record: add new field for requesting LUKS discard on logout
We make this entirely independent of the regular discard field, i.e. the
one that controls discard behaviour when the home directory is online.
Not all combinations make a ridiculous amount of sense, but most do.
Specifically:

online-discard = yes, offline-discard = yes
       → Discard when activating explicitly, and during runtime using
       the "discard" mount option, and discard explicitly when logging
       out again.

online-discard = no, offline-discard = yes
       → The new default: when logging in allocate the full backing
       store, and use no discard while active. When loging out discard
       everything. This provides nice behaviour: we take minimal storage
       when offline but provide allocation guarantees while online.

online-discard = no, offline-discard = no
       → Never, ever discard, always operate with fully allocated
       backing store. The extra safe mode.
2020-05-07 16:13:07 +02:00
Lennart Poettering c06bcd4d68 homed: allow overriding homework path via env var
Let's make debugging a bit easier: when invoking homed from the build
tree it's now possible to make sure homed invokes the build tree's
homework binary by setting an env var.
2020-05-07 15:48:59 +02:00
Lennart Poettering 1f7c6f906b update TODO 2020-05-07 15:46:00 +02:00
Lennart Poettering 6d68a0b3dd man: document homed key management
Fixes: #15235
2020-05-07 15:46:00 +02:00
Zbigniew Jędrzejewski-Szmek 0d525a3e93 man: add specifiers section to directives index
The hack with getparent().txt is not very pretty, but the whole
thing seems to work well enough. It is useful to figure out whihc
specifiers are supported where.
2020-05-07 14:59:24 +02:00
Zbigniew Jędrzejewski-Szmek 282230882c tools: move directive index template to separate file
In the beginning, it was rather short, and reasonable to include inline.
Now it is long and unwieldy, let's split it out.

While at it, let's reindent and wrap using our current standards.
2020-05-07 14:40:10 +02:00
Lennart Poettering fb29cdbef2 tree-wide: make sure our control buffers are properly aligned
We always need to make them unions with a "struct cmsghdr" in them, so
that things properly aligned. Otherwise we might end up at an unaligned
address and the counting goes all wrong, possibly making the kernel
refuse our buffers.

Also, let's make sure we initialize the control buffers to zero when
sending, but leave them uninitialized when reading.

Both the alignment and the initialization thing is mentioned in the
cmsg(3) man page.
2020-05-07 14:39:44 +02:00
Lennart Poettering 0d9d333672 tree-wide: remove redundant assignments
We already initialize the fields a few lines up to the very same values,
hence remove this.
2020-05-07 14:39:44 +02:00
Lennart Poettering a258f4915a tree-wide: use CMSG_SPACE() (and not CMSG_LEN()) to allocate control buffers
We need to use the CMSG_SPACE() macro to size the control buffers, not
CMSG_LEN(). The former is rounded up to next alignment boundary, the
latter is not. The former should be used for allocations, the latter for
encoding how much of it is actually initialized. See cmsg(3) man page
for details about this.

Given how confusing this is, I guess we don't have to be too ashamed
here, in most cases we actually did get this right.
2020-05-07 14:39:44 +02:00
Zbigniew Jędrzejewski-Szmek c62e7d041f man: update rules
Forgotten in 4f07ddfa9b.
2020-05-07 14:05:17 +02:00
Zbigniew Jędrzejewski-Szmek 06689b8d11 meson: rename make-man-rules.py to update-man-rules.py
The name of the helper didn't match the name of the meson target, which was
always confusing me. With this change, we consistenly use "update" to
re-generate things which we otherwise keep in vc, and "make" for things
which are generated during each build.
2020-05-07 14:01:09 +02:00
Zbigniew Jędrzejewski-Szmek dd1e33c8dc meson: drop "meson-" prefix from various helper script filenames
In a few cases, the prefix was originally necessary because a different helper
script was used for automake, and a different one for meson. But now we use
meson exclusively, and the prefix isn't useful. This also synchronizes the
target name, file name, and variable name in meson.build. The targets exposed
by meson didn't have the prefix, so the user interface is unchanged.

(The prefix is retained in the few tools that are used for meson itself,
e.g. meosn-vcs-tag.sh, meson-make-symlink.sh, etc.)
2020-05-07 13:57:48 +02:00
Zbigniew Jędrzejewski-Szmek 1f63c72d2e man: suffix pam options with "=" where arg is required too 2020-05-07 13:28:39 +02:00
Zbigniew Jędrzejewski-Szmek 6bae4b905c Revert "Add Kensington SlimBlade Trackball"
This reverts commit 8049c79b65.
2020-05-07 13:11:41 +02:00
Daan De Meyer d402edb764 resolved: Fix build error due to missing include. 2020-05-07 03:05:50 -07:00
gaurav 48a3b5c6db
netlink socket correct check (#15720) 2020-05-07 09:55:31 +02:00
Lennart Poettering f5b7d681c7 homectl: show disk free in percent in 'inspect' 2020-05-07 09:52:56 +02:00
Zbigniew Jędrzejewski-Szmek 354722dde4
Merge pull request #15733 from benjarobin/fix_warn_ndebug
Allow to build without any warning with NDEBUG defined + Bugfix
2020-05-07 09:47:19 +02:00
Benjamin Robin 08f468567d tree-wide: Workaround -Wnonnull GCC bug
See issue #6119
2020-05-07 09:43:28 +02:00
Lennart Poettering ba876a4c8d homed: open up home dir Acquire operation to unpriv clients
Apparently unpriv clients expect to be able to auth via PAM. Kinda
sucks. But it is what it is. Hence open this up.

This shouldn't be too bad in effect since clients after all need to
provide security creds for unlocking the home dir, in order to misuse
this.

Fixes: #15072
2020-05-07 09:43:02 +02:00
Daan De Meyer be28f72d6a resolved: Break include cycles 2020-05-07 09:00:48 +02:00
Benjamin Robin 0454681395 meson: Do not drop warnings (unused variable) when NDEBUG is defined
This is no longer needed, since there is now no warning with NDEBUG
defined
2020-05-06 23:03:25 +02:00
Benjamin Robin 683d0bc041 resize-fs: Use xsprintf instead of snprintf 2020-05-06 23:03:25 +02:00
Benjamin Robin 060d9c61b6 test: Use assert_se() where variables are only checked by assert
Allow to build without any warning with NDEBUG defined
2020-05-06 23:03:25 +02:00
Benjamin Robin f391597c67 tree-wide: Fix, replace assert() by assert_se() when there is side effect 2020-05-06 23:03:25 +02:00
Benjamin Robin 0a0e594a26 tree-wide: Mark as _unused_ variables that are only used in assert()
Allow to build without any warning with NDEBUG defined
2020-05-06 23:03:25 +02:00
Zbigniew Jędrzejewski-Szmek 96249bf8d6
Merge pull request #15735 from poettering/pam-snippet-update
Slightly update our shipped and suggested PAM snippets, so that pam_systemd_home.so is more likely to just work
2020-05-06 22:45:29 +02:00
Zbigniew Jędrzejewski-Szmek a06df2a4bd
Merge pull request #15727 from poettering/systemctl-list-sockets-tweak
systemctl: some table output tweaks
2020-05-06 22:38:25 +02:00
Lennart Poettering 4ad5bf7865 man: bring example PAM snippet of pam_systemd and pam_systemd_home back in sync
Let's make it the same snippet, just highlight different lines.
2020-05-06 22:30:43 +02:00
Lennart Poettering c6472bb019 man: highlight relevant lines in pam_systemd_home.so example PAM snippet
let's do this like we do in the NSS module man pages.
2020-05-06 22:30:27 +02:00
Lennart Poettering bd685faa1a login: include pam_systemd_home.so in the default PAM snippet we ship for user@.service
Let's make sure systemd-homed works out-of-the box as well as possible.
2020-05-06 22:30:07 +02:00
Balint Reczey e48471b948 test: Skip test-boot-timestamps on permission denied
In containers even root can be denied to access the needed files.
2020-05-06 22:01:50 +02:00
Bastien Nocera 259f0dfbec hwdb: Force "mouse" type on Logitech Ultrathin Touch Mouse
Closes: #15657
2020-05-06 21:09:29 +02:00
Zbigniew Jędrzejewski-Szmek e57ac1b017 tree-wide: use _cleanup_set_free_ where appropriate
If we already have the helper defined, let's use it instead of open-coding.
2020-05-06 17:08:17 +02:00
Zbigniew Jędrzejewski-Szmek 2f063186d5 shared/logs-show: constify Set *fields 2020-05-06 17:03:00 +02:00
Zbigniew Jędrzejewski-Szmek 476a63e9c0 sd-device: get rid of device_enumerator_clear_match_parent
This helper wasn't helping all that much. It seems better to verify args
first, and only then start modifying the state.
2020-05-06 17:02:10 +02:00
Zbigniew Jędrzejewski-Szmek 2204f018cd sd-device: optimize addition of already present matches
Our hashmap and set helpers return a different code whenever an entry
already exists, so let's use this to avoid unsetting scan_uptodate when
not necessary.

Thus, the return convention for
sd_device_enumerator_add_match_subsystem,
sd_device_enumerator_add_match_sysattr,
sd_device_enumerator_add_match_property,
sd_device_enumerator_add_match_sysname,
sd_device_enumerator_add_match_tag,
device_enumerator_add_match_parent_incremental,
sd_device_enumerator_add_match_parent,
sd_device_enumerator_allow_uninitialized,
device_enumerator_add_match_is_initialized
is that "1" is returned if action was taken, and "0" on noop.
2020-05-06 17:01:33 +02:00
Zbigniew Jędrzejewski-Szmek eb1c1dc029 sd-device: use hashmap_put_strdup() 2020-05-06 17:00:45 +02:00
Zbigniew Jędrzejewski-Szmek 25b3e2a835 basic/hashmap: allow NULL values in strdup hashmaps and add test 2020-05-06 16:56:42 +02:00
Zbigniew Jędrzejewski-Szmek c73bb51364 sd-device: use string hash ops in device enumerator
There should be no functional change, except that when the same string is
added more than once, we skip the duplicate entries.
2020-05-06 16:55:50 +02:00
Zbigniew Jędrzejewski-Szmek de747a0008 test-set: make test-set not link to libshared and test test_set_put_strdup*()
The sets are such basic functionality that it is convenient to be able to
build test-set without all the machinery in shared, and to test it without
the mempool to validate memory accesses easier.
2020-05-06 16:55:07 +02:00