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
|
||||
# disable manpage compression as the files cannot be found. Fix the issue by removing the compression
|
||||
# extension.
|
||||
# TODO: remove autovt@ removal when the upstream spec is updated
|
||||
while read -r filelist; do
|
||||
sed -E \
|
||||
-e '/autovt@/d' \
|
||||
-e 's/\.gz$//' \
|
||||
"$filelist" >"/tmp/$(basename "$filelist")"
|
||||
mount --bind "/tmp/$(basename "$filelist")" "$filelist"
|
||||
|
||||
@ -9,5 +9,5 @@ Environment=
|
||||
GIT_URL=https://salsa.debian.org/systemd-team/systemd.git
|
||||
GIT_SUBDIR=debian
|
||||
GIT_BRANCH=debian/master
|
||||
GIT_COMMIT=93a222266c23ff73720f4de009a027d3556baee4
|
||||
GIT_COMMIT=6f4d90be5cb4075954f0a36653105e586a9a1fa9
|
||||
PKG_SUBDIR=debian
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
static int do_rotate(JournalFile **f, MMapCache *m, JournalFileFlags file_flags) {
|
||||
int r;
|
||||
|
||||
assert(f);
|
||||
|
||||
r = journal_file_rotate(f, m, file_flags, UINT64_MAX, NULL);
|
||||
if (r < 0) {
|
||||
if (*f)
|
||||
@ -95,9 +97,11 @@ int writer_write(Writer *w,
|
||||
if (journal_file_rotate_suggested(w->journal, 0, LOG_DEBUG)) {
|
||||
log_info("%s: Journal header limits reached or header out-of-date, rotating",
|
||||
w->journal->path);
|
||||
|
||||
r = do_rotate(&w->journal, w->mmap, file_flags);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = journal_directory_vacuum(w->output, w->metrics.max_use, w->metrics.n_max_files, 0, NULL, /* verbose= */ true);
|
||||
if (r < 0)
|
||||
return r;
|
||||
@ -117,15 +121,16 @@ int writer_write(Writer *w,
|
||||
if (w->server)
|
||||
w->server->event_count += 1;
|
||||
return 0;
|
||||
} else if (r == -EBADMSG)
|
||||
}
|
||||
if (r == -EBADMSG)
|
||||
return r;
|
||||
|
||||
log_debug_errno(r, "%s: Write failed, rotating: %m", w->journal->path);
|
||||
r = do_rotate(&w->journal, w->mmap, file_flags);
|
||||
if (r < 0)
|
||||
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);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@ -1940,8 +1940,10 @@ static int maybe_decompress_payload(
|
||||
assert(f);
|
||||
|
||||
/* 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;
|
||||
#endif
|
||||
|
||||
if (compression != COMPRESSION_NONE) {
|
||||
#if HAVE_COMPRESSION
|
||||
|
||||
@ -779,6 +779,7 @@ static JSON_DISPATCH_ENUM_DEFINE(dispatch_mount_directory_mode, MountMapMode, mo
|
||||
|
||||
static DirectoryOwnership validate_directory_fd(
|
||||
int fd,
|
||||
const char *path, /* purely for logging purposes */
|
||||
uid_t peer_uid,
|
||||
uid_t *ret_current_owner_uid) {
|
||||
|
||||
@ -813,14 +814,14 @@ static DirectoryOwnership validate_directory_fd(
|
||||
if (st.st_uid == 0) {
|
||||
*ret_current_owner_uid = st.st_uid;
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
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 (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;
|
||||
return DIRECTORY_IS_FOREIGN_OWNED;
|
||||
}
|
||||
@ -924,8 +925,12 @@ static int vl_method_mount_directory(
|
||||
if (r < 0)
|
||||
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;
|
||||
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)
|
||||
return sd_varlink_errorbo(link, "io.systemd.MountFileSystem.BadFileDescriptorFlags", SD_JSON_BUILD_PAIR_STRING("parameter", "directoryFileDescriptor"));
|
||||
if (owned_by < 0)
|
||||
@ -941,9 +946,6 @@ static int vl_method_mount_directory(
|
||||
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));
|
||||
|
||||
const char *polkit_details[] = {
|
||||
|
||||
@ -335,7 +335,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
ARG_WAIT,
|
||||
ARG_WORKING_DIRECTORY,
|
||||
ARG_ROOT_DIRECTORY,
|
||||
ARG_SHELL,
|
||||
ARG_JOB_MODE,
|
||||
ARG_IGNORE_FAILURE,
|
||||
ARG_BACKGROUND,
|
||||
@ -919,7 +918,6 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) {
|
||||
|
||||
enum {
|
||||
ARG_NO_ASK_PASSWORD = 0x100,
|
||||
ARG_HOST,
|
||||
ARG_MACHINE,
|
||||
ARG_UNIT,
|
||||
ARG_PROPERTY,
|
||||
|
||||
@ -47,6 +47,7 @@ KillMode=process
|
||||
{% endif %}
|
||||
IgnoreSIGPIPE=no
|
||||
SendSIGHUP=yes
|
||||
|
||||
ImportCredential=tty.virtual.%I.agetty.*:agetty.
|
||||
ImportCredential=tty.virtual.%I.login.*:login.
|
||||
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
|
||||
|
||||
[Install]
|
||||
Alias=autovt@.service
|
||||
|
||||
WantedBy=getty.target
|
||||
DefaultInstance=tty1
|
||||
|
||||
@ -45,7 +45,6 @@ units = [
|
||||
},
|
||||
{
|
||||
'file' : 'getty@.service.in',
|
||||
'symlinks' : ['autovt@.service'],
|
||||
},
|
||||
{
|
||||
'file' : 'graphical.target',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user