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

Compare commits

..

No commits in common. "c644e9e6e61a2eff65f0f440462eb493891e0a2c" and "afc5d175a23a4f4a41b1edb92d89bd5ea740901d" have entirely different histories.

8 changed files with 16 additions and 27 deletions

View File

@ -18,10 +18,8 @@ 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=6f4d90be5cb4075954f0a36653105e586a9a1fa9 GIT_COMMIT=93a222266c23ff73720f4de009a027d3556baee4
PKG_SUBDIR=debian PKG_SUBDIR=debian

View File

@ -12,8 +12,6 @@
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)
@ -97,11 +95,9 @@ 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;
@ -121,16 +117,15 @@ 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,10 +1940,8 @@ 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 __SIZEOF_SIZE_T__ == 4 if ((uint64_t) (size_t) size != size)
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,7 +779,6 @@ 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) {
@ -814,14 +813,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 (%s), who is also the peer.", strna(path)); log_debug("Directory file descriptor points to root owned directory, who is also the peer.");
return DIRECTORY_IS_ROOT_PEER_OWNED; return DIRECTORY_IS_ROOT_PEER_OWNED;
} }
log_debug("Directory file descriptor points to root owned directory (%s).", strna(path)); log_debug("Directory file descriptor points to root owned directory.");
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 (%s).", strna(path)); log_debug("Directory file descriptor points to peer owned directory.");
*ret_current_owner_uid = st.st_uid; *ret_current_owner_uid = st.st_uid;
return DIRECTORY_IS_PEER_OWNED; return DIRECTORY_IS_PEER_OWNED;
} }
@ -842,7 +841,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 referenced by file descriptor is owned by foreign UID range, and peer is root."); log_debug("Directory 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;
} }
@ -925,12 +924,8 @@ 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, directory_path, peer_uid, &current_owner_uid); DirectoryOwnership owned_by = validate_directory_fd(directory_fd, 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)
@ -946,6 +941,9 @@ 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,6 +335,7 @@ 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,
@ -918,6 +919,7 @@ 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,7 +47,6 @@ 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.*
@ -59,7 +58,5 @@ 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,6 +45,7 @@ units = [
}, },
{ {
'file' : 'getty@.service.in', 'file' : 'getty@.service.in',
'symlinks' : ['autovt@.service'],
}, },
{ {
'file' : 'graphical.target', 'file' : 'graphical.target',