summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #25836 from DaanDeMeyer/resetDaan De Meyer2023-04-011-4/+58
|\ | | | | firstboot: Add --reset option
| * firstboot: Add --reset optionDaan De Meyer2023-04-011-0/+54
| | | | | | | | | | | | This can be used to prepare an image for firstboot by removing all files that systemd knows about that contain machine specific information.
| * firstboot: Do not dereference symlinksDaan De Meyer2023-04-011-4/+4
| | | | | | | | | | | | | | | | Let's always operate on paths without resolving the final component. If the path is a symlink, it could point to a vendor default in /usr, in which case we definitely do not want to modify the vendor defaults. To avoid this from happening, we replace the symlink with our own file instead of modifying the file the symlink points at.
* | ukify: Strip symbol/string table for old stubsJan Janssen2023-04-011-0/+13
|/
* Revert "Revert "test: add more testcases for rm_rf()""Yu Watanabe2023-03-311-8/+56
| | | | This reverts commit 8c81a618103cafc715e0a1a521e9f1bd34e3e207.
* rm-rf: also chmod() directory if it cannot be openedYu Watanabe2023-03-311-21/+135
| | | | | | | | Otherwise, directory with zero access mode cannot be removed. This is a revised version of 808c8b25eece33c503430151641f5f77676af38c, - dropped O_NOFOLLOW from fd_reopen() - fixed error handling on opening path in rm_rf().
* core: always calculate the next restart intervalMike Yuan2023-03-313-22/+21
| | | | | | | | | | Follow-up for #26902 and #26971 Let's always calculate the next restart interval since that's more useful. For that, we add 1 to s->n_restarts unconditionally, and change RestartUSecCurrent property to RestartUSecNext.
* Merge pull request #27075 from mrc0mmand/test-tweaksLuca Boccassi2023-03-312-3/+33
|\ | | | | test: a couple of coverage-related test tweaks
| * test: make make_addresses() actually return the addressesFrantisek Sumsal2023-03-301-1/+3
| | | | | | | | | | I noticed missing coverage in the reports and turns out this has been broken since forever (i.e. 2016 - 9f7672b3bc), whoopsie.
| * coverage: add a wrapper for execveat()Frantisek Sumsal2023-03-301-2/+30
| | | | | | | | | | | | | | | | | | | | | | gcov provides wrappers for the exec*() calls but there's none for execveat(), which means we lose all coverage prior to the call. To mitigate this, let's add a simple execveat() wrapper in gcov's style[0], which dumps and resets the coverage data when needed. This applies only when we're built with -Dfexecve=true. [0] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libgcc/libgcov-interface.c;h=b2ee930864183b78c8826255183ca86e15e21ded;hb=HEAD
* | bootctl: clean up handling of files with no version informationZbigniew Jędrzejewski-Szmek2023-03-303-31/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_file_version() would return: - various negative errors if the file could not be accessed or if it was not a regular file - 0/NULL if the file was too small - -ESRCH or -EINVAL if the file did not contain the marker - -ENOMEM or permissions errors - 1 if the marker was found bootctl status iterates over /EFI/{systemd,BOOT}/*.efi and checks if the files contain a systemd-boot version tag. Resource or permission errors should be fatal, but lack of version information should be silently ignored. OTOH, when updating or installing bootloader files, the version is expected to be present. get_file_version() is changed to return -ESRCH if the version is unavailable, and other errnos for permission or resource errors. The logging is reworked to always display an error if encountered, but also to log the status at debug level what the result of the version inquiry is. This makes it figure out what is going on: /efi/EFI/systemd/systemd-bootx64.efi: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38" /efi/EFI/BOOT/BOOTfbx64.efi: EFI binary has no LoaderInfo marker. /efi/EFI/BOOT/BOOTIA32.EFI: EFI binary has no LoaderInfo marker. /efi/EFI/BOOT/BOOTX64.EFI: EFI binary LoaderInfo marker: "systemd-boot 253-6.fc38" Replaces #27034. Fixes https://github.com/NixOS/nixpkgs/issues/223579.
* | Revert "rm-rf: also chmod() directory if it cannot be opened"Luca Boccassi2023-03-301-131/+18
| | | | | | | | This reverts commit 808c8b25eece33c503430151641f5f77676af38c.
* | Revert "test: add more testcases for rm_rf()"Luca Boccassi2023-03-301-56/+8
| | | | | | | | This reverts commit 0278b1c80101cc0d857c1becd0c3a51b2eb14a44.
* | pid1: fully disable coredumping to $PWDZbigniew Jędrzejewski-Szmek2023-03-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have three states: - ENABLE_COREDUMP and systemd-coredump is installed, - ENABLE_COREDUMP but systemd-coredump is not installed, - !ENABLE_COREDUMP. In the last case we would not do any coredumping-related setup in pid1, which means that coredumps would go to to the working directory of the process, but actually limits are set to 0. This is inherited by children of pid1. As discussed extensively in https://github.com/systemd/systemd/pull/26607, this default is bad: dumps are written to arbitrary directories and not cleaned up. Nevertheless, the kernel cannot really fix it. It doesn't know where to write, and it doesn't know when that place would become available. It is only the userspace that can tell this to the kernel. So the only sensible change in the kernel would be to default to '|/bin/false', i.e. do what we do now. In the middle case, we disabled writing of coredumps via a pattern, but raise the RLIMIT_CORE. We need to raise the limit because we can't raise it later after processes have been forked off. This means we behave correctly, but allow coredumping to be enabled at a later point without a reboot. This patch makes the last case behave like the middle case. This means that even if systemd is compiled with systemd-coredump, it still does the usual setup. If users want to restore the kernel default, they need to provide two drop-in files: for sysctl.d, with 'kernel.core_pattern=core' for systemd.conf, with 'DefaultLimitCORE=0'. The general idea is that pid1 does the safe thing. A distro may want to use something different than the systemd-coredump machinery, and then that would could packaged together with the drop-ins to change the configuration. Alternative-for: #26607
* | basic: update the Arch tuples for LoongArchXiaotian Wu2023-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | After this commit[1], LoongArch now uses these Multiarch specs: - Double float: loongarch64-linux-gnu - Single float: loongarch64-linux-gnuf32 - Soft float: loongarch64-linux-gnusf You can visit here[2] to view the full documentation. [1]: https://github.com/loongson/LoongArch-Documentation/commit/55dbaadaaa90b5f5d08a74d96b866af42c8c3c82 [2]: https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html
* | Merge pull request #26883 from yuwata/rm-rfZbigniew Jędrzejewski-Szmek2023-03-302-32/+193
|\ \ | | | | | | rm-rf: also chmod directory if cannot be opened
| * | test: add more testcases for rm_rf()Yu Watanabe2023-03-251-8/+56
| | |
| * | rm-rf: also chmod() directory if it cannot be openedYu Watanabe2023-03-251-18/+131
| | | | | | | | | | | | Otherwise, directory with zero access mode cannot be removed.
| * | rm-rf: mask file mode with 07777 when passed to chmod()Yu Watanabe2023-03-251-4/+4
| | | | | | | | | | | | No functional change hopefully, just for safety.
| * | rm-rf: fix errno handlingYu Watanabe2023-03-251-4/+4
| | |
* | | tmpfiles: Try to take a BSD lock on files as wellDaan De Meyer2023-03-301-0/+10
| | | | | | | | | | | | | | | | | | Similar to what we do for directories, just before we remove a file, let's try to take a BSD lock on it. If that fails, skip removing the file.
* | | Merge pull request #27064 from DaanDeMeyer/chase-fixesDaan De Meyer2023-03-302-105/+26
|\ \ \ | | | | | | | | Chase fixes
| * | | chase: Simplify chase_and_open() and chase_and_openat()Daan De Meyer2023-03-301-14/+12
| | | | | | | | | | | | | | | | | | | | xopenat() now calls fd_reopen() if an empty path is specified, so let's make use of that to simplify the chase open helpers.
| * | | fs-util: Strip O_NOFOLLOW in xopenat() when calling fd_reopen()Daan De Meyer2023-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | We definitely want to follow symlinks when calling fd_reopen() so let's strip O_NOFOLLOW when we call it from xopenat().
| * | | chase: Fix error code checkDaan De Meyer2023-03-301-2/+2
| | | |
| * | | chase: Fix formattingDaan De Meyer2023-03-301-90/+13
| | | |
* | | | Merge pull request #27063 from yuwata/chase-gracefulDaan De Meyer2023-03-301-3/+17
|\ \ \ \ | | | | | | | | | | chase: gracefully drop CHASE_AT_RESOLVE_IN_ROOT when AT_FDCWD is specified
| * | | | chase: add CHASE_AT_RESOLVE_IN_ROOT only when it is necessaryYu Watanabe2023-03-301-3/+3
| | | | |
| * | | | chase: drop CHASE_AT_RESOLVE_IN_ROOT when AT_FDCWD or root dir fd is specifiedYu Watanabe2023-03-301-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | If we get AT_FDCWD or root dir fd, we always resolve symlinks relative to the host's root. Hence, the flag is meaningless.
* | | | | Merge pull request #27041 from poettering/fdstore-dumpDaan De Meyer2023-03-3024-75/+509
|\ \ \ \ \ | | | | | | | | | | | | add ability to show contents of service fdstore + teach systemd-notify passing fds into the fdstore
| * | | | | notify: add support for sending fds with notification messagesLennart Poettering2023-03-291-4/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This exposes the fd passing we support via sd_pid_notify_with_fds() also via the command line tool systemd-notify.
| * | | | | fdset: add new fdset_consume() helperLennart Poettering2023-03-293-3/+15
| | | | | |
| * | | | | fdset: add new helper to convert an fdset to an arrayLennart Poettering2023-03-292-11/+32
| | | | | |
| * | | | | fdset: minor modernizationsLennart Poettering2023-03-291-56/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's use more _cleanup_ expressions. Various other modernizations. No actual code changes, except for maybe a conversion to use heap memory when generating an array of fds, instead of stack as before. Given that fdstores are typically user controlled, that should be a wise idea.
| * | | | | analyze: add new fdstore verbLennart Poettering2023-03-294-3/+122
| | | | | |
| * | | | | pid1: add DumpFileDescriptorStore() bus call that returns fdstore content infoLennart Poettering2023-03-296-0/+97
| | | | | |
| * | | | | format-table: add new cell type for displaying major/minor devnumsLennart Poettering2023-03-292-0/+38
| | | | | |
| * | | | | format-table: add inode type cell typeLennart Poettering2023-03-292-1/+14
| | | | | |
| * | | | | fd-util: add helper for converting O_RDONLY/WRONLY/RDWR to stringsLennart Poettering2023-03-292-0/+15
| | | | | |
| * | | | | devnum-util: add new devnum_is_zero() helperLennart Poettering2023-03-294-3/+7
| | | | | |
| * | | | | stat-util: add inode_type_to_string() helper for showing mode_t inode type ↵Lennart Poettering2023-03-292-0/+25
| | |_|_|/ | |/| | | | | | | | | | | | | as string
* | | | | test-kernel-install: several cleanupsYu Watanabe2023-03-301-10/+15
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | - allow to run without $PROJECT_BUILD_ROOT, - drop unnecessary export for bootctl, - enable -x option to show commands, - use 'test ! -e' to check the nonexistence of files, - show more debugging logs.
* | | | Merge pull request #27062 from yuwata/chase-trivialDaan De Meyer2023-03-301-4/+4
|\ \ \ \ | | | | | | | | | | chase: trivial cleanups
| * | | | chase: fix indentationYu Watanabe2023-03-301-3/+3
| | | | |
| * | | | chase: fix commentYu Watanabe2023-03-301-1/+1
| | | | |
* | | | | service: drop redundant unit_ref_unset() callLennart Poettering2023-03-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The immediately preceeding service_close_socket_fd() call does that internally anyway. No need to do this again right after.
* | | | | Merge pull request #27060 from yuwata/fd-get-pathDaan De Meyer2023-03-302-0/+122
|\ \ \ \ \ | |_|_|/ / |/| | | | fd-util: make fd_get_path() support AT_FDCWD
| * | | | fd-util: make fd_get_path() support AT_FDCWDYu Watanabe2023-03-302-0/+10
| | | | |
| * | | | test: add tests for fd_get_path()Yu Watanabe2023-03-301-0/+112
| |/ / /
* | | | test: split-out tests for chase() and friends to test-chase.cYu Watanabe2023-03-303-591/+616
| | | |