From b7cac52779d52eff6ed03103922ffe1208a7baa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Dec 2016 13:01:22 -0500 Subject: [PATCH 1/6] build-sys: define arm as secondary architecture for arm64 Completely unstested. Fixes #4862. --- src/basic/architecture.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/basic/architecture.h b/src/basic/architecture.h index 5a77c31932..b329df2f6d 100644 --- a/src/basic/architecture.h +++ b/src/basic/architecture.h @@ -150,6 +150,7 @@ int uname_architecture(void); # else # define native_architecture() ARCHITECTURE_ARM64 # define LIB_ARCH_TUPLE "aarch64-linux-gnu" +# define SECONDARY_ARCHITECTURE ARCHITECTURE_ARM # endif #elif defined(__arm__) # if __BYTE_ORDER == __BIG_ENDIAN From 4f8b86e307ca88d842d1d57f38a89efd95fd74d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Dec 2016 13:35:47 -0500 Subject: [PATCH 2/6] dissect: assume GPT_ROOT_SECONDARY_VERITY is defined when GPT_ROOT_SECONDARY is We define those macros, and there's no reason to have one without the other. --- src/shared/dissect-image.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 257af78781..d3ba9b9dde 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -372,9 +372,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, Dissecte designator = PARTITION_ROOT; architecture = native_architecture(); rw = !(flags & GPT_FLAG_READ_ONLY); - } -#ifdef GPT_ROOT_NATIVE_VERITY - else if (sd_id128_equal(type_id, GPT_ROOT_NATIVE_VERITY)) { + } else if (sd_id128_equal(type_id, GPT_ROOT_NATIVE_VERITY)) { m->can_verity = true; @@ -388,7 +386,6 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, Dissecte rw = false; } #endif -#endif #ifdef GPT_ROOT_SECONDARY else if (sd_id128_equal(type_id, GPT_ROOT_SECONDARY)) { @@ -399,9 +396,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, Dissecte designator = PARTITION_ROOT_SECONDARY; architecture = SECONDARY_ARCHITECTURE; rw = !(flags & GPT_FLAG_READ_ONLY); - } -#ifdef GPT_ROOT_SECONDARY_VERITY - else if (sd_id128_equal(type_id, GPT_ROOT_SECONDARY_VERITY)) { + } else if (sd_id128_equal(type_id, GPT_ROOT_SECONDARY_VERITY)) { m->can_verity = true; @@ -414,7 +409,6 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, Dissecte architecture = SECONDARY_ARCHITECTURE; rw = false; } -#endif #endif else if (sd_id128_equal(type_id, GPT_SWAP)) { designator = PARTITION_SWAP; From 691b90d4652be373502da3ef6f4d4e2abab6a988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Dec 2016 13:52:49 -0500 Subject: [PATCH 3/6] journal: fix warning about LZ4_compress_limitedOutput --- src/journal/compress.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/journal/compress.c b/src/journal/compress.c index ba734b5561..818a720ba8 100644 --- a/src/journal/compress.c +++ b/src/journal/compress.c @@ -112,7 +112,11 @@ int compress_blob_lz4(const void *src, uint64_t src_size, if (src_size < 9) return -ENOBUFS; +#if LZ4_VERSION_NUMBER >= 10700 + r = LZ4_compress_default(src, (char*)dst + 8, src_size, (int) dst_alloc_size - 8); +#else r = LZ4_compress_limitedOutput(src, (char*)dst + 8, src_size, (int) dst_alloc_size - 8); +#endif if (r <= 0) return -ENOBUFS; From 2dc95d98e1db5cb2281d56f1151699abc443b55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Dec 2016 13:55:13 -0500 Subject: [PATCH 4/6] shared/firewall-util: remove warning about net/if.h workaround This is already fixed upstream, so warning is not useful. Let's keep the workaround until the fix has percolated downstream. --- src/shared/firewall-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/firewall-util.c b/src/shared/firewall-util.c index f73108eaa3..9c29b0afca 100644 --- a/src/shared/firewall-util.c +++ b/src/shared/firewall-util.c @@ -17,8 +17,9 @@ along with systemd; If not, see . ***/ -#warning "Temporary work-around for broken glibc vs. linux kernel header definitions" -#warning "This really should be removed sooner rather than later, when this is fixed upstream" +/* Temporary work-around for broken glibc vs. linux kernel header definitions + * This is already fixed upstream, remove this when distributions have updated. + */ #define _NET_IF_H 1 #include From 007f48bb89c0aca356054aca304ba36e5acc72eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Dec 2016 23:07:46 -0500 Subject: [PATCH 5/6] pid1: remove unnecessary counter The loop must terminate after at most three iterations anyway. --- src/core/load-fragment.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 6b36b2fc3a..687cd1dd31 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -606,7 +606,6 @@ int config_parse_exec( _cleanup_strv_free_ char **n = NULL; size_t nlen = 0, nbufsize = 0; const char *f; - int i; semicolon = false; @@ -615,7 +614,7 @@ int config_parse_exec( return 0; f = firstword; - for (i = 0; i < 3; i++) { + for (;;) { /* We accept an absolute path as first argument. * If it's prefixed with - and the path doesn't exist, * we ignore it instead of erroring out; From 330785f5caf426afa9d93e8eb7dcc7a72d7ea3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 10 Dec 2016 23:20:42 -0500 Subject: [PATCH 6/6] basic/extract-word,man: clarify "correction" of invalid escapes Our warning message was misleading, because we wouldn't "correct" anything, we'd just ignore unkown escapes. Update the message. Also, print just the extracted word (which contains the offending sequences) in the message, instead of the whole line. Fixes #4697. --- man/systemd.service.xml | 20 ++++++++------------ src/basic/extract-word.c | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 67c68d2f8b..b244a7e970 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -918,18 +918,14 @@ must be passed as separate words). Lone semicolons may be escaped as \;. - Each command line is split on whitespace, with the first - item being the command to execute, and the subsequent items being - the arguments. Double quotes ("...") and single quotes ('...') may - be used, in which case everything until the next matching quote - becomes part of the same argument. C-style escapes are also - supported. The table below contains the list of allowed escape - patterns. Only patterns which match the syntax in the table are - allowed; others will result in an error, and must be escaped by - doubling the backslash. Quotes themselves are removed after - parsing and escape sequences substituted. In addition, a trailing - backslash (\) may be used to merge lines. - + Each command line is split on whitespace, with the first item being the command to + execute, and the subsequent items being the arguments. Double quotes ("...") and single quotes + ('...') may be used, in which case everything until the next matching quote becomes part of the + same argument. Quotes themselves are removed. C-style escapes are also supported. The table + below contains the list of known escape patterns. Only escape patterns which match the syntax in + the table are allowed; other patterns may be added in the future and unknown patterns will + result in a warning. In particular, any backslashes should be doubled. Finally, a trailing + backslash (\) may be used to merge lines. This syntax is intended to be very similar to shell syntax, but only the meta-characters and expansions described in the diff --git a/src/basic/extract-word.c b/src/basic/extract-word.c index dbe64a9a58..f8cac3e911 100644 --- a/src/basic/extract-word.c +++ b/src/basic/extract-word.c @@ -227,8 +227,8 @@ int extract_first_word_and_warn( *p = save; r = extract_first_word(p, ret, separators, flags|EXTRACT_CUNESCAPE_RELAX); if (r >= 0) { - /* It worked this time, hence it must have been an invalid escape sequence we could correct. */ - log_syntax(unit, LOG_WARNING, filename, line, EINVAL, "Invalid escape sequences in line, correcting: \"%s\"", rvalue); + /* It worked this time, hence it must have been an invalid escape sequence. */ + log_syntax(unit, LOG_WARNING, filename, line, EINVAL, "Ignoring unknown escape sequences: \"%s\"", *ret); return r; }