summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | run: port over to new pty_open_peer() callLennart Poettering2024-10-301-25/+25
| | | |
| * | | terminal-util: add pty_open_peer() helperLennart Poettering2024-10-303-3/+82
| | | | | | | | | | | | | | | | | | | | This opens a pty peer in one go, and uses the new race-free TIOCGPTPEER ioctl() to do so – if it is available.
| * | | terminal-util: various minor modernizationsLennart Poettering2024-10-301-44/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various fixes: 1. Adds O_CLOEXEC for two socketpair()s where we forgot it. 2. Uses FORK_WAIT instead of manual wait_for_terminate_and_check() invocations. 3. Prefix opaque NULL/0 arguments with comments what they are. 4. Add a banch of assert()s, and change flag validation in open_terminal() to be assert() (since flags mistakes are programming errors, not runtime errors).
* | | | tweaks to ANSI sequence (OSC) handling (#34964)Luca Boccassi2024-11-016-20/+65
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #34604 Prompted by that I realized we do not correctly recognize both "ST" sequences we want to recognize, fix that.
| * | | | string-util: also check for 0x1b 0x5c ST when stripping ANSI from stringsLennart Poettering2024-10-312-3/+31
| | | | |
| * | | | terminal-util: define ANSI_OSC as macro for the OSC terminal sequence prefixLennart Poettering2024-10-314-7/+12
| | | | |
| * | | | ptyfwd: document why we only honour two of the three kinds of STLennart Poettering2024-10-311-5/+10
| | | | |
| * | | | tree-wide: prefer generating 0x1B 0x5C as ANSI sequence "ST"Lennart Poettering2024-10-314-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSC sequences can be closed with one of three terminators: 1. ASCII code 7, aka BEL, aka ^G, aka \x07, aka \a 2. ASCII code 156, aka \x9c 2. Pair of ASCII code 27 followed by ASCII code 92, aka \x1b\x5c Of these, in some corner case scenarios BEL makes problem (see #34604). Hence switch away from that wherever we use it, and prefer the \x1b\x5c instead. That's preferable over \x9c, since the latter is also a valid UTF-8 codepoint. See discussion here for example: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#the-escape-sequence Fixes: #34604
| * | | | string-util: it's called OSC sequence, not CSO sequenceLennart Poettering2024-10-311-6/+6
| | | | |
* | | | | Homed update policy: user changing own settings (#31153)Luca Boccassi2024-11-019-18/+428
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework of #30109 to deal with changes in #30840 and discussed changes to behavior Depends on and includes #30840 Fixes https://github.com/systemd/systemd/issues/34268
| * | | | | test: Test user record selfModifiable behaviorAdrian Vovk2024-11-012-0/+102
| | | | | |
| * | | | | homed: Allow user to change parts of their recordAdrian Vovk2024-11-016-18/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows an unprivileged user that is active at the console to change the fields that are in the selfModifiable allowlists (introduced in a previous commit) without authenticating as a system administrator. Administrators can disable this behavior per-user by setting the relevant selfModifiable allowlists, or system-wide by changing the policy of the org.freedesktop.home1.update-home-by-owner Polkit action.
| * | | | | user-record: Introduce selfModifiable fieldsAdrian Vovk2024-11-013-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows the system administrator to configure what fields the user is allowed to edit about themself, along with hard-coded defaults.
* | | | | | network: update tunnel or vxlan with Local=dhcp4 and friends (#34957)Luca Boccassi2024-11-0110-2/+75
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes #24854.
| * | | | | | network: update tunnel or vxlan interface if the local address is changedYu Watanabe2024-10-3110-2/+75
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a tunnel or vxlan is configured with Local=dhcp4 or so, then the local address needs to be changed when it is changed. Fixes #24854.
* | | | / / core: add read-only flag for exec directoriesLuca Boccassi2024-11-018-53/+149
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an exec directory is shared between services, this allows one of the service to be the producer of files, and the other the consumer, without letting the consumer modify the shared files. This will be especially useful in conjunction with id-mapped exec directories so that fully sandboxed services can share directories in one direction, safely.
* | | | | coredump: make check that all argv[] meta data fields are passed strictLennart Poettering2024-10-311-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, if some field is not supplied we might end up parsing a NULL string later. Let's catch that early.
* | | | | coredump: use memory_startswith() when looking at a data blobLennart Poettering2024-10-311-1/+1
| | | | |
* | | | | iovw: normalize destructorsLennart Poettering2024-10-312-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of passing a boolean picking the destruction method just have different functions. That's much nicer in context of _cleanup_, and how we usually do things.
* | | | | iovw: add simpler iovw_done() destructorLennart Poettering2024-10-312-2/+6
| | | | |
* | | | | coredump: move to _cleanup_ for destroying iovw objectLennart Poettering2024-10-312-43/+25
| | | | |
* | | | | coredump: parse rlimit field at same place as other fieldsLennart Poettering2024-10-311-7/+8
| | | | |
* | | | | coredump: parse signal number at the same time as parsing other fieldsLennart Poettering2024-10-313-31/+40
| | | | |
* | | | | coredump: rename save_context() → context_parse_iovw()Lennart Poettering2024-10-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The function doesn't "save" anything, it just parses iovw into the individual fields, hence name the function accordingly.
* | | | | coredump: acquire some process fields via pidrefLennart Poettering2024-10-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use pidref to acquire some fields. This just makes use of the pidref helpers we already have. We acquire a lot of other data via classic pids still, but for that we first have to write race-free pidref getters, hence leave that for another time.
* | | | | coredump: rework protocol between coredump pattern handler and processing ↵Lennart Poettering2024-10-311-77/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | service In 68511cebe58977ea68ae4f57c6462e979efd1cff the ability to pass the coredump's mount namespace fd from the coredump patter handler was added to systemd-coredump. For this the protocol was augmented, in attempt to provide both forward and backward compatibility. The protocol as of v256: one or more datagrams with journal log fields about the coredump are sent via an SOCK_SEQPACKET connection. It is finished with a zero length datagram which carries the coredump fd (this last datagram is called "sentinel" sometimes). The protocol after 68511cebe58977ea68ae4f57c6462e979efd1cff is extended so that after the sentinal a 2nd sentinel is sent, with a pair of fds: the coredump fd *again* and a mount fd (acquired via open_tree()) of the container's mount tree. It's a bit ugly to send the coredump fd a 2nd time, but what's more important the implementation didn't work: since on SOCK_SEQPACKET a zero sized datagram cannot be distinguished from EOF (which is a Linux API design mistake), an early EOF would be misunderstood as a zero size datagram lacking any fd, which resulted in protocol termination. Moreover, I think if we touch the protocol we should make the move to pidfs at the same time. All of the above is what this protocol rework addresses. 1. A pidfd is now sent as well 2. The protocol is now payload, followed by the coredump fd datagram (as before). But now followed by a second empty datagram with a pidfd, and a third empty datagram with the mount tree fd. Of this the latter two or last are optional. Thus, it's now a stream of payload datagrams with one, two or three fd-laden datagrams as sentinel. If we read the 2nd or 3rd sentinel without an attached fd we assume this is actually an EOF (whether it actually is one or not doesn't matter here). This should provide nice up and down compatibility. 3. The mount_tree_fd is moved into the Context object. The pidfd is placed there too, as a PidRef. Thus the data we pass around is now the coredump fd plus the context, which is simpler and makes a lot more semantical sense I think. 4. The "first" boolean is replaced by an explicit state engine enum Fixes: #34130
* | | | | coredump: correct debug log messageLennart Poettering2024-10-311-1/+1
| | | | |
* | | | | coredump: minor modernizationsLennart Poettering2024-10-311-10/+17
| | | | |
* | | | | coredump: rename pid → leader_pidLennart Poettering2024-10-311-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's rename this local variable, since we are not operating on the coredump process here after all, but on the leader of the namespace the coredump process in, which is quite different, hence let's make this very clear via the name.
* | | | | sd-varlink: suppress one log message when callback already successfully ↵Yu Watanabe2024-10-311-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enqueued an error response Follow-up for d2ebf5cc1d59e29139f06efaa3a9b2c184cdaa25. The detailed error response is already logged, hence not necessary to log again with the errno converted from the error response, which typically less informative, e.g. === varlink-26-26: Setting state idle-server varlink-26-26: Received message: {"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{"service":""}} varlink-26-26: Changing state idle-server → processing-method varlink-26-26: Sending message: {"error":"io.systemd.UserDatabase.BadService","parameters":{}} varlink-26-26: Changing state processing-method → processed-method varlink-26-26: Callback for io.systemd.UserDatabase.GetUserRecord returned error: Invalid request descriptor varlink-26-26: Changing state processed-method → idle-server varlink-26-26: Got POLLHUP from socket. ===
* | | | | Rework sysupdate meson options (#34832)Luca Boccassi2024-10-311-3/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | systemd-sysupdated is still unstable and we'd like to make breaking changes to it even after the v257 release, so we document it as such and disable building it by default in release builds. The distro can still opt-in, and we still build it in developer mode so it has CI coverage
| * | | | | meson: add separate option for sysupdated, disable in release buildsZbigniew Jędrzejewski-Szmek2024-10-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a build-time option to enable/disable sysupdated separately from sysupdate. 'auto' translated to enabled by default in developer builds.
* | | | | | Drop trailing NUL in .sbat/.sdmagic sections (#34950)Lennart Poettering2024-10-313-8/+16
|\ \ \ \ \ \
| * | | | | | boot: stop appending NUL to .sdmagic and .sbat sectionsZbigniew Jędrzejewski-Szmek2024-10-312-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those text sections had a trailing NUL byte. It's debatable whether this is a good idea or not. Correctly written consumers will look at the section size so they wouldn't need this. Shim doesn't use a trailing NUL, so let's follow suit. Fixes https://github.com/systemd/systemd/issues/33731. 898e9edc469f87fdb6018128bac29eef0a5fe698 reworked this code, but didn't actually change the logic. We have always been appending the trailing zero by using a NUL-terminated string as the section contents. (I checked this with v253.18 from before the elf2efi rework.) .sdmagic contains a string like "#### LoaderInfo: systemd-boot 257~devel ####", which changes with each version, so previous versions would compare unequal anyway, so we don't need to worry about backwards compatibility.
| * | | | | | test-sbat: separate the two sbat sectionsZbigniew Jędrzejewski-Szmek2024-10-301-5/+14
| |/ / / / /
* | | | | | logind/systemctl: one follow-up for DesignatedMaintenanceWindow (#34966)Lennart Poettering2024-10-314-17/+18
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes https://github.com/systemd/systemd/issues/33429
| * | | | | | bus-common-errors: use more appropriate errno for ↵Mike Yuan2024-10-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUS_ERROR_DESIGNATED_MAINTENANCE_TIME_NOT_SCHEDULED Fixes #33429
| * | | | | | systemctl: don't fall back to immediate shutdown silently if we cannot ↵Mike Yuan2024-10-311-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | schedule one The previous behavior of systemctl --when= seems absurd, i.e. if we fail to schedule shutdown in the future it's performed immediately. Let's instead hard fail, which also removes the need of specializing on certain errnos (preparation for later commits).
| * | | | | | logind-dbus: return appropriate errno for unexpected errorsMike Yuan2024-10-311-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up for 0e10c3d8724b0a5d07871c9de71565ac91dd55b7
| * | | | | | systemctl: use the retval of must_be_root()Mike Yuan2024-10-311-4/+3
| | |_|/ / / | |/| | | |
* | | | | | machine: several follow-ups for recent change (#34882)Lennart Poettering2024-10-317-53/+86
|\ \ \ \ \ \ | | | | | | | | | | | | | | Follow-ups for #34761.
| * | | | | | machine: lookup_machine_by_name_or_pidref() returns negative errno on failureYu Watanabe2024-10-312-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively reverts d2c1451b7398f13439b694450a23def3cf31c8db. After the commit d2ebf5cc1d59e29139f06efaa3a9b2c184cdaa25, sd_varlink_error() returns negative errno, hence the function always return negative errno on failure.
| * | | | | | machine: use JSON_BUILD_PAIR_STRV_ENV_PAIR_NON_EMPTY()Yu Watanabe2024-10-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use JSON_BUILD_PAIR_UNSIGNED_NOT_EQUAL().
| * | | | | | sd-json: introduce JSON_BUILD_PAIR_STRV_ENV_PAIR_NON_EMPTY() macroYu Watanabe2024-10-312-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is similar to JSON_BUILD_PAIR_STRV_NON_EMPTY, but takes the list of environment variables.
| * | | | | | sd-json: use strv_env_get_merged()Yu Watanabe2024-10-311-12/+4
| | | | | | |
| * | | | | | env-util: introduce strv_env_get_merged()Yu Watanabe2024-10-313-0/+40
| | | | | | |
| * | | | | | env-util: replace 'char **' with 'char**'Yu Watanabe2024-10-312-4/+4
| | | | | | |
| * | | | | | machined: ACQUIRE_METADATA_NO is zeroYu Watanabe2024-10-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-ups for a94fbcaa35dc63f32fbf86d25f63f6ac40a0d8b0 and 9de215219c8783e3239af27baf62275730ab51a8.
| * | | | | | machine: use sd_json_variant_append_arraybo() and ↵Yu Watanabe2024-10-311-24/+17
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | JSON_BUILD_PAIR_VARIANT_NON_NULL() Follow-up for 45755275e5ae747bf79e6c7bdd9a055711ebc71f.
* | | | | | sd-json: don't accidentally convert between unsigned/signed when parsing signalLennart Poettering2024-10-311-4/+3
| | | | | |