1
0
mirror of https://github.com/systemd/systemd synced 2026-03-15 01:24:51 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Antonio Alvarez Feijoo
b0b2a71d81 tar-util: do not error out if archive_read_next_header() returns ARCHIVE_WARN
archive_read_header(3) states that `archive_read_next_header()` returns
`ARCHIVE_WARN` if it succeeds but a non-critical error is found, so issue a
warning instead of stopping the untar process in this case.
2026-01-29 02:41:11 +09:00
Jeff Layton
eb2e91b981 pidfd/cgroup-util: use fully-sized filehandle buffers
The current code assumes that FILEID_KERNFS filehandles will never grow
in size. This is not a safe assumption and userland shouldn't be trying
to guess the size of the filehandle it'll get.

We have a macro for that: MAX_HANDLE_SZ.
2026-01-29 00:57:03 +09:00
Kai Lüke
2e14be9a84 bash-completion/vmspawn: insert missing space between options
Follow-up for 3b18a8795df525f1e10528f8c056f1e49a1d9bfe.
2026-01-28 19:48:48 +09:00
4 changed files with 8 additions and 4 deletions

View File

@ -36,7 +36,7 @@ _systemd_vmspawn() {
[BIND]='--bind --bind-ro'
[SSH_KEY]='--ssh-key'
[CONSOLE]='--console'
[ARG]='--cpus --ram --vsock-cid -M --machine --uuid--private-users --background --set-credential --load-credential'
[ARG]='--cpus --ram --vsock-cid -M --machine --uuid --private-users --background --set-credential --load-credential'
)
_init_completion || return
@ -56,6 +56,8 @@ _systemd_vmspawn() {
comps='dsa ecdsa ecdsa-sk ed25519 ed25519-sk rsa'
elif __contains_word "$prev" ${OPTS[CONSOLE]}; then
comps='interactive native gui'
elif __contains_word "$prev" ${OPTS[IMAGE_FORMAT]}; then
comps='raw qcow2'
elif __contains_word "$prev" ${OPTS[ARG]}; then
comps=''
else

View File

@ -38,7 +38,7 @@
/* The structure to pass to name_to_handle_at() on cgroupfs2 */
typedef union {
struct file_handle file_handle;
uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)];
uint8_t space[MAX_HANDLE_SZ];
} cg_file_handle;
#define CG_FILE_HANDLE_INIT \

View File

@ -239,7 +239,7 @@ int pidfd_get_inode_id_impl(int fd, uint64_t *ret) {
if (file_handle_supported) {
union {
struct file_handle file_handle;
uint8_t space[offsetof(struct file_handle, f_handle) + sizeof(uint64_t)];
uint8_t space[MAX_HANDLE_SZ];
} fh = {
.file_handle.handle_bytes = sizeof(uint64_t),
.file_handle.handle_type = FILEID_KERNFS,

View File

@ -739,13 +739,15 @@ int tar_x(int input_fd, int tree_fd, TarFlags flags) {
ar = sym_archive_read_next_header(a, &entry);
if (ar == ARCHIVE_EOF)
break;
if (ar != ARCHIVE_OK)
if (!IN_SET(ar, ARCHIVE_OK, ARCHIVE_WARN))
return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Failed to parse archive: %s", sym_archive_error_string(a));
const char *p = NULL;
r = archive_entry_pathname_safe(entry, &p);
if (r < 0)
return log_error_errno(r, "Invalid path name in entry, refusing.");
if (ar == ARCHIVE_WARN)
log_warning("Non-critical error found while parsing '%s' from the archive, ignoring: %s", p ?: ".", sym_archive_error_string(a));
if (!p) {
/* This is the root inode */