mirror of
https://github.com/systemd/systemd
synced 2026-03-15 17:44:49 +01:00
Compare commits
9 Commits
afc5d175a2
...
c644e9e6e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c644e9e6e6 | ||
|
|
c4fd3043ff | ||
|
|
acd5fd0a6d | ||
|
|
072e72424b | ||
|
|
a2bf4b5da9 | ||
|
|
c5761f352b | ||
|
|
0f22a0918d | ||
|
|
1efc263433 | ||
|
|
3f74a81f65 |
@ -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"
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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, ¤t_owner_uid);
|
DirectoryOwnership owned_by = validate_directory_fd(directory_fd, directory_path, peer_uid, ¤t_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[] = {
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -45,7 +45,6 @@ units = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'file' : 'getty@.service.in',
|
'file' : 'getty@.service.in',
|
||||||
'symlinks' : ['autovt@.service'],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'file' : 'graphical.target',
|
'file' : 'graphical.target',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user