1
0
mirror of https://github.com/systemd/systemd synced 2026-03-15 17:44:49 +01:00

Compare commits

...

9 Commits

Author SHA1 Message Date
Luca Boccassi
c644e9e6e6
mkosi: fix debian/ubuntu/suse builds
Follow-up for 072e72424b2e6da1c96489ef6996f49fabd46474
2026-01-24 16:12:09 +01:00
Luca Boccassi
c4fd3043ff mkosi: workaround autovt removal in SUSE spec
Follow-up for 072e72424b2e6da1c96489ef6996f49fabd46474
2026-01-24 13:24:58 +00:00
Luca Boccassi
acd5fd0a6d mkosi: update debian commit reference to 6f4d90be5cb4075954f0a36653105e586a9a1fa9
* 6f4d90be5c Do not install autovt@ for upstream builds
* 8cc28a6b82 Install new files for upstream build
* 0d15255073 Use deb-systemd-invoke to reexec instead of manual calls
* db04e5fa0b Use dh_installsystemd to handle journald and networkd
* d8756a4c82 Use dh_installsystemd more to manage units
* 40b23b0d5d d/tests: drop tests-in-lxd
* 5821c5a350 d/control: have systemd-boot depend on efibootmgr for amd64 and arm64 only

Follow-up for 072e72424b2e6da1c96489ef6996f49fabd46474
2026-01-24 13:19:56 +00:00
Zbigniew Jędrzejewski-Szmek
072e72424b units/getty@.service: use [Install]Alias= instead of static alias
In Fedora, kmsconvt@.service is starting to be used instead of getty@.service
to have nicer font handling. This means that we need the autovt@.service alias
point to the new unit. So far the alias was done through a static symlink
because there was little reason to change it. Let's use [Install] instead so
the decision which implementation to use can be made after installation.

https://bugzilla.redhat.com/show_bug.cgi?id=2429626
https://fedoraproject.org/wiki/Changes/UseKmsconVTConsole
2026-01-24 13:19:08 +01:00
Lennart Poettering
a2bf4b5da9
tivial journal fixlets (#40448) 2026-01-24 13:18:31 +01:00
Lennart Poettering
c5761f352b mountfsd: improve logging 2026-01-24 13:18:15 +01:00
Mike Yuan
0f22a0918d run: remove unused enum values for getopt_long() 2026-01-24 13:18:00 +01:00
Lennart Poettering
1efc263433 journal: do not use typecasts for range checks 2026-01-23 22:51:29 +01:00
Lennart Poettering
3f74a81f65 journal: some whitespace fixes 2026-01-23 22:51:29 +01:00
8 changed files with 27 additions and 16 deletions

View File

@ -18,8 +18,10 @@ TS="${SOURCE_DATE_EPOCH:-$(date +%s)}"
# The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we # The openSUSE filelists hardcode the manpage compression extension. This causes rpmbuild errors since we
# disable manpage compression as the files cannot be found. Fix the issue by removing the compression # disable manpage compression as the files cannot be found. Fix the issue by removing the compression
# extension. # extension.
# TODO: remove autovt@ removal when the upstream spec is updated
while read -r filelist; do while read -r filelist; do
sed -E \ sed -E \
-e '/autovt@/d' \
-e 's/\.gz$//' \ -e 's/\.gz$//' \
"$filelist" >"/tmp/$(basename "$filelist")" "$filelist" >"/tmp/$(basename "$filelist")"
mount --bind "/tmp/$(basename "$filelist")" "$filelist" mount --bind "/tmp/$(basename "$filelist")" "$filelist"

View File

@ -9,5 +9,5 @@ Environment=
GIT_URL=https://salsa.debian.org/systemd-team/systemd.git GIT_URL=https://salsa.debian.org/systemd-team/systemd.git
GIT_SUBDIR=debian GIT_SUBDIR=debian
GIT_BRANCH=debian/master GIT_BRANCH=debian/master
GIT_COMMIT=93a222266c23ff73720f4de009a027d3556baee4 GIT_COMMIT=6f4d90be5cb4075954f0a36653105e586a9a1fa9
PKG_SUBDIR=debian PKG_SUBDIR=debian

View File

@ -12,6 +12,8 @@
static int do_rotate(JournalFile **f, MMapCache *m, JournalFileFlags file_flags) { static int do_rotate(JournalFile **f, MMapCache *m, JournalFileFlags file_flags) {
int r; int r;
assert(f);
r = journal_file_rotate(f, m, file_flags, UINT64_MAX, NULL); r = journal_file_rotate(f, m, file_flags, UINT64_MAX, NULL);
if (r < 0) { if (r < 0) {
if (*f) if (*f)
@ -95,9 +97,11 @@ int writer_write(Writer *w,
if (journal_file_rotate_suggested(w->journal, 0, LOG_DEBUG)) { if (journal_file_rotate_suggested(w->journal, 0, LOG_DEBUG)) {
log_info("%s: Journal header limits reached or header out-of-date, rotating", log_info("%s: Journal header limits reached or header out-of-date, rotating",
w->journal->path); w->journal->path);
r = do_rotate(&w->journal, w->mmap, file_flags); r = do_rotate(&w->journal, w->mmap, file_flags);
if (r < 0) if (r < 0)
return r; return r;
r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true); r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true);
if (r < 0) if (r < 0)
return r; return r;
@ -117,15 +121,16 @@ int writer_write(Writer *w,
if (w->server) if (w->server)
w->server->event_count += 1; w->server->event_count += 1;
return 0; return 0;
} else if (r == -EBADMSG) }
if (r == -EBADMSG)
return r; return r;
log_debug_errno(r, "%s: Write failed, rotating: %m", w->journal->path); log_debug_errno(r, "%s: Write failed, rotating: %m", w->journal->path);
r = do_rotate(&w->journal, w->mmap, file_flags); r = do_rotate(&w->journal, w->mmap, file_flags);
if (r < 0) if (r < 0)
return r; return r;
else
log_debug("%s: Successfully rotated journal", w->journal->path); log_debug("%s: Successfully rotated journal", w->journal->path);
r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true); r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true);
if (r < 0) if (r < 0)
return r; return r;

View File

@ -1940,8 +1940,10 @@ static int maybe_decompress_payload(
assert(f); assert(f);
/* We can't read objects larger than 4G on a 32-bit machine */ /* We can't read objects larger than 4G on a 32-bit machine */
if ((uint64_t) (size_t) size != size) #if __SIZEOF_SIZE_T__ == 4
if (size > UINT32_MAX)
return -E2BIG; return -E2BIG;
#endif
if (compression != COMPRESSION_NONE) { if (compression != COMPRESSION_NONE) {
#if HAVE_COMPRESSION #if HAVE_COMPRESSION

View File

@ -779,6 +779,7 @@ static JSON_DISPATCH_ENUM_DEFINE(dispatch_mount_directory_mode, MountMapMode, mo
static DirectoryOwnership validate_directory_fd( static DirectoryOwnership validate_directory_fd(
int fd, int fd,
const char *path, /* purely for logging purposes */
uid_t peer_uid, uid_t peer_uid,
uid_t *ret_current_owner_uid) { uid_t *ret_current_owner_uid) {
@ -813,14 +814,14 @@ static DirectoryOwnership validate_directory_fd(
if (st.st_uid == 0) { if (st.st_uid == 0) {
*ret_current_owner_uid = st.st_uid; *ret_current_owner_uid = st.st_uid;
if (peer_uid == 0) { if (peer_uid == 0) {
log_debug("Directory file descriptor points to root owned directory, who is also the peer."); log_debug("Directory file descriptor points to root owned directory (%s), who is also the peer.", strna(path));
return DIRECTORY_IS_ROOT_PEER_OWNED; return DIRECTORY_IS_ROOT_PEER_OWNED;
} }
log_debug("Directory file descriptor points to root owned directory."); log_debug("Directory file descriptor points to root owned directory (%s).", strna(path));
return DIRECTORY_IS_ROOT_OWNED; return DIRECTORY_IS_ROOT_OWNED;
} }
if (st.st_uid == peer_uid) { if (st.st_uid == peer_uid) {
log_debug("Directory file descriptor points to peer owned directory."); log_debug("Directory file descriptor points to peer owned directory (%s).", strna(path));
*ret_current_owner_uid = st.st_uid; *ret_current_owner_uid = st.st_uid;
return DIRECTORY_IS_PEER_OWNED; return DIRECTORY_IS_PEER_OWNED;
} }
@ -841,7 +842,7 @@ static DirectoryOwnership validate_directory_fd(
/* If the peer is root, then it doesn't matter if we find a parent owned by root, let's shortcut things. */ /* If the peer is root, then it doesn't matter if we find a parent owned by root, let's shortcut things. */
if (peer_uid == 0) { if (peer_uid == 0) {
log_debug("Directory file descriptor is owned by foreign UID range, and peer is root."); log_debug("Directory referenced by file descriptor is owned by foreign UID range, and peer is root.");
*ret_current_owner_uid = st.st_uid; *ret_current_owner_uid = st.st_uid;
return DIRECTORY_IS_FOREIGN_OWNED; return DIRECTORY_IS_FOREIGN_OWNED;
} }
@ -924,8 +925,12 @@ static int vl_method_mount_directory(
if (r < 0) if (r < 0)
return log_debug_errno(r, "Failed to get client UID: %m"); return log_debug_errno(r, "Failed to get client UID: %m");
/* Get path of the fd, to improve logging */
_cleanup_free_ char *directory_path = NULL;
(void) fd_get_path(directory_fd, &directory_path);
uid_t current_owner_uid; uid_t current_owner_uid;
DirectoryOwnership owned_by = validate_directory_fd(directory_fd, peer_uid, &current_owner_uid); DirectoryOwnership owned_by = validate_directory_fd(directory_fd, directory_path, peer_uid, &current_owner_uid);
if (owned_by == -EREMOTEIO) if (owned_by == -EREMOTEIO)
return sd_varlink_errorbo(link, "io.systemd.MountFileSystem.BadFileDescriptorFlags", SD_JSON_BUILD_PAIR_STRING("parameter", "directoryFileDescriptor")); return sd_varlink_errorbo(link, "io.systemd.MountFileSystem.BadFileDescriptorFlags", SD_JSON_BUILD_PAIR_STRING("parameter", "directoryFileDescriptor"));
if (owned_by < 0) if (owned_by < 0)
@ -941,9 +946,6 @@ static int vl_method_mount_directory(
assert(p.mode > 0); assert(p.mode > 0);
} }
_cleanup_free_ char *directory_path = NULL;
(void) fd_get_path(directory_fd, &directory_path);
log_debug("Mounting '%s' with mapping mode: %s", strna(directory_path), mount_map_mode_to_string(p.mode)); log_debug("Mounting '%s' with mapping mode: %s", strna(directory_path), mount_map_mode_to_string(p.mode));
const char *polkit_details[] = { const char *polkit_details[] = {

View File

@ -335,7 +335,6 @@ static int parse_argv(int argc, char *argv[]) {
ARG_WAIT, ARG_WAIT,
ARG_WORKING_DIRECTORY, ARG_WORKING_DIRECTORY,
ARG_ROOT_DIRECTORY, ARG_ROOT_DIRECTORY,
ARG_SHELL,
ARG_JOB_MODE, ARG_JOB_MODE,
ARG_IGNORE_FAILURE, ARG_IGNORE_FAILURE,
ARG_BACKGROUND, ARG_BACKGROUND,
@ -919,7 +918,6 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) {
enum { enum {
ARG_NO_ASK_PASSWORD = 0x100, ARG_NO_ASK_PASSWORD = 0x100,
ARG_HOST,
ARG_MACHINE, ARG_MACHINE,
ARG_UNIT, ARG_UNIT,
ARG_PROPERTY, ARG_PROPERTY,

View File

@ -47,6 +47,7 @@ KillMode=process
{% endif %} {% endif %}
IgnoreSIGPIPE=no IgnoreSIGPIPE=no
SendSIGHUP=yes SendSIGHUP=yes
ImportCredential=tty.virtual.%I.agetty.*:agetty. ImportCredential=tty.virtual.%I.agetty.*:agetty.
ImportCredential=tty.virtual.%I.login.*:login. ImportCredential=tty.virtual.%I.login.*:login.
ImportCredential=agetty.* ImportCredential=agetty.*
@ -58,5 +59,7 @@ ImportCredential=shell.*
UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION UnsetEnvironment=LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
[Install] [Install]
Alias=autovt@.service
WantedBy=getty.target WantedBy=getty.target
DefaultInstance=tty1 DefaultInstance=tty1

View File

@ -45,7 +45,6 @@ units = [
}, },
{ {
'file' : 'getty@.service.in', 'file' : 'getty@.service.in',
'symlinks' : ['autovt@.service'],
}, },
{ {
'file' : 'graphical.target', 'file' : 'graphical.target',