1
0
mirror of https://github.com/systemd/systemd synced 2026-03-18 02:54:47 +01:00

Compare commits

..

No commits in common. "165c23c6b2f762db916bee1ccb843abf0f5ea887" and "7f7a50dd157b3bfb4282c3cc3a56671121eabe24" have entirely different histories.

5 changed files with 41 additions and 136 deletions

34
NEWS
View File

@ -84,8 +84,7 @@ CHANGES WITH 249 in spe:
* portablectl gained a new switch --extension= for enabling portable
service images with extensions that follow the extension image
concept introduced with v248, and thus allows layering multiple
images when setting up the root filesystem of the service.
concept introduced with v248.
* systemd-coredump will now extract ELF build-id information from
processes dumping core and include it in the coredump report.
@ -417,37 +416,6 @@ CHANGES WITH 249 in spe:
https://systemd.io/ARCHITECTURE
* Units using ConditionNeedsUpdate= will no longer be activated in
the initrd.
* It is now possible to list a template unit in WantedBy= or RequiredBy=
of another template unit, which will be triggered using the same
instance name.
* A new MemoryAvailable property is available for units. If the unit,
or the slice(s) it is part of, have a memory limit set via MemoryMax=/
MemoryHigh=, MemoryAvailable will indicate how much more memory the
unit can claim before hitting the limit(s).
* systemd-coredump will now try to stay below the cgroup memory limit
placed on itself or one of the slices it runs under, if the storage
area for core files (/var/lib/systemd/coredump/) is placed on a tmpfs,
since files written on such filesystems count toward the cgroup memory
limit. If there is not enough available memory in such cases to store
the core file uncompressed, systemd-coredump will skip to compressed
storage directly (if enabled) and it will avoid analyzing the core file
to print backtrace and metadata in the journal.
* tmpfiles.d gained a new '=' modifier to check if the type of a path
matches the configured expectations, and remove it if not.
* tmpfiles.d's 'Age' now accepts an 'age-by' argument, which allows to
specify which of the several available filesystem timestamp to look
at when deciding whether a path has aged enough to be cleaned.
* Journal files, which are allocated in fixed incremenets, are now
truncated when rotated/archived to remove unused space from their tails.
* …
Contributions from: …

View File

@ -89,41 +89,6 @@
# pragma GCC diagnostic ignored "-Waddress-of-packed-member"
#endif
static int journal_file_tail_end(JournalFile *f, uint64_t *ret_offset) {
Object *tail;
uint64_t p;
int r;
assert(f);
assert(f->header);
assert(ret_offset);
p = le64toh(f->header->tail_object_offset);
if (p == 0)
p = le64toh(f->header->header_size);
else {
uint64_t sz;
r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &tail);
if (r < 0)
return r;
sz = le64toh(READ_NOW(tail->object.size));
if (sz > UINT64_MAX - sizeof(uint64_t) + 1)
return -EBADMSG;
sz = ALIGN64(sz);
if (p > UINT64_MAX - sz)
return -EBADMSG;
p += sz;
}
*ret_offset = p;
return 0;
}
/* This may be called from a separate thread to prevent blocking the caller for the duration of fsync().
* As a result we use atomic operations on f->offline_state for inter-thread communications with
* journal_file_set_offline() and journal_file_set_online(). */
@ -157,25 +122,6 @@ static void journal_file_set_offline_internal(JournalFile *f) {
f->header->state = f->archive ? STATE_ARCHIVED : STATE_OFFLINE;
(void) fsync(f->fd);
if (f->archive) {
uint64_t p;
int r;
/* truncate excess from the end of archives */
r = journal_file_tail_end(f, &p);
if (r < 0)
log_debug_errno(r, "Failed to determine end of tail object, ignoring: %m");
else {
/* arena_size can't exceed the file size, ensure it's updated before truncating */
f->header->arena_size = htole64(p - le64toh(f->header->header_size));
(void) fsync(f->fd);
if (ftruncate(f->fd, p) < 0)
log_debug_errno(errno, "Failed to truncate archive at end of tail object, ignoring: %m");
}
}
break;
case OFFLINE_OFFLINING:
@ -1108,7 +1054,7 @@ int journal_file_append_object(
int r;
uint64_t p;
Object *o;
Object *tail, *o;
void *t;
assert(f);
@ -1120,10 +1066,27 @@ int journal_file_append_object(
if (r < 0)
return r;
r = journal_file_tail_end(f, &p);
p = le64toh(f->header->tail_object_offset);
if (p == 0)
p = le64toh(f->header->header_size);
else {
uint64_t sz;
r = journal_file_move_to_object(f, OBJECT_UNUSED, p, &tail);
if (r < 0)
return r;
sz = le64toh(READ_NOW(tail->object.size));
if (sz > UINT64_MAX - sizeof(uint64_t) + 1)
return -EBADMSG;
sz = ALIGN64(sz);
if (p > UINT64_MAX - sz)
return -EBADMSG;
p += sz;
}
r = journal_file_allocate(f, p, size);
if (r < 0)
return r;

View File

@ -805,30 +805,30 @@ void dns_server_unlink_all(DnsServer *first) {
dns_server_unlink_all(next);
}
bool dns_server_unlink_marked(DnsServer *server) {
bool changed = false;
while (server) {
bool dns_server_unlink_marked(DnsServer *first) {
DnsServer *next;
bool changed;
next = server->servers_next;
if (!first)
return false;
if (server->marked) {
dns_server_unlink(server);
next = first->servers_next;
if (first->marked) {
changed = true;
}
dns_server_unlink(first);
} else
changed = false;
server = next;
}
return changed;
return changed || dns_server_unlink_marked(next);
}
void dns_server_mark_all(DnsServer *server) {
while (server) {
server->marked = true;
server = server->servers_next;
}
void dns_server_mark_all(DnsServer *first) {
if (!first)
return;
first->marked = true;
dns_server_mark_all(first->servers_next);
}
DnsServer *dns_server_find(DnsServer *first, int family, const union in_addr_union *in_addr, uint16_t port, int ifindex, const char *name) {

View File

@ -224,7 +224,7 @@ tests += [
[['src/test/test-os-util.c']],
[['src/test/test-libcrypt-util.c'],
[], [libcrypt], [], '', 'timeout=120'],
[], [], [], '', 'timeout=120'],
[['src/test/test-escape.c']],

View File

@ -10,29 +10,6 @@
#include "tests.h"
#include "libcrypt-util.h"
static void test_crypt_preferred_method(void) {
log_info("/* %s */", __func__);
log_info("crypt_preferred_method: %s",
#if HAVE_CRYPT_PREFERRED_METHOD
crypt_preferred_method()
#else
"(not available)"
#endif
);
}
static void test_make_salt(void) {
log_info("/* %s */", __func__);
for (int i = 0; i < 10; i++) {
_cleanup_free_ char *t;
assert_se(make_salt(&t) == 0);
log_info("%s", t);
}
}
static int test_hash_password(void) {
log_info("/* %s */", __func__);
@ -116,9 +93,6 @@ int main(int argc, char *argv[]) {
return log_tests_skipped("crypt_r() causes a buffer overflow on ppc64el, see https://github.com/systemd/systemd/pull/16981#issuecomment-691203787");
#endif
test_crypt_preferred_method();
test_make_salt();
if (!test_hash_password())
return log_tests_skipped("crypt doesn't support yescrypt or sha512crypt");