From: "Mike Gilbert" <floppym@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/files/
Date: Sat, 8 Jun 2019 20:44:17 +0000 (UTC) [thread overview]
Message-ID: <1560026502.284c3c0b7d130ca73ed214365c8ecc2cba30ac6e.floppym@gentoo> (raw)
commit: 284c3c0b7d130ca73ed214365c8ecc2cba30ac6e
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 8 20:41:42 2019 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jun 8 20:41:42 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=284c3c0b
sys-apps/systemd: more fixes for gcc 9
Closes: https://bugs.gentoo.org/685534
Package-Manager: Portage-2.3.67_p4, Repoman-2.3.13_p3
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
sys-apps/systemd/files/242-gcc-9.patch | 128 +++++++++++++++++++++++++++++++++
1 file changed, 128 insertions(+)
diff --git a/sys-apps/systemd/files/242-gcc-9.patch b/sys-apps/systemd/files/242-gcc-9.patch
index e12d6571823..e9f690a65be 100644
--- a/sys-apps/systemd/files/242-gcc-9.patch
+++ b/sys-apps/systemd/files/242-gcc-9.patch
@@ -33,3 +33,131 @@ index 533193ac932..6fc82940033 100644
else
log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled));
+From bcb846f30f9ca8f42e79d109706aee9f2032261b Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Wed, 22 May 2019 10:31:01 -0400
+Subject: [PATCH] shared/machine-image: avoid passing NULL to log_debug_errno
+
+Fixes: https://github.com/systemd/systemd/issues/12534
+---
+ src/shared/machine-image.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
+index 6b9d8fb97a6..6a6d952b424 100644
+--- a/src/shared/machine-image.c
++++ b/src/shared/machine-image.c
+@@ -201,11 +201,13 @@ static int image_make(
+ Image **ret) {
+
+ _cleanup_free_ char *pretty_buffer = NULL;
++ _cleanup_free_ char *cwd = NULL;
+ struct stat stbuf;
+ bool read_only;
+ int r;
+
+ assert(dfd >= 0 || dfd == AT_FDCWD);
++ assert(path || dfd == AT_FDCWD);
+ assert(filename);
+
+ /* We explicitly *do* follow symlinks here, since we want to allow symlinking trees, raw files and block
+@@ -221,6 +223,9 @@ static int image_make(
+ st = &stbuf;
+ }
+
++ if (!path)
++ safe_getcwd(&cwd);
++
+ read_only =
+ (path && path_startswith(path, "/usr")) ||
+ (faccessat(dfd, filename, W_OK, AT_EACCESS) < 0 && errno == EROFS);
+@@ -359,7 +364,7 @@ static int image_make(
+
+ block_fd = openat(dfd, filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY);
+ if (block_fd < 0)
+- log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path, filename);
++ log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path ?: strnull(cwd), filename);
+ else {
+ /* Refresh stat data after opening the node */
+ if (fstat(block_fd, &stbuf) < 0)
+@@ -373,13 +378,13 @@ static int image_make(
+ int state = 0;
+
+ if (ioctl(block_fd, BLKROGET, &state) < 0)
+- log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path, filename);
++ log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename);
+ else if (state)
+ read_only = true;
+ }
+
+ if (ioctl(block_fd, BLKGETSIZE64, &size) < 0)
+- log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path, filename);
++ log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename);
+
+ block_fd = safe_close(block_fd);
+ }
+From 2570578d908a8e010828fa1f88826b1c45d534ff Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Fri, 24 May 2019 10:54:09 +0200
+Subject: [PATCH] machine-image: openat() doesn't operate on the cwd if the
+ first argument is specified
+
+A fix-up for bcb846f30f9ca8f42e79d109706aee9f2032261b.
+---
+ src/shared/machine-image.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
+index 6a6d952b424..55e5f08f91e 100644
+--- a/src/shared/machine-image.c
++++ b/src/shared/machine-image.c
+@@ -200,8 +200,7 @@ static int image_make(
+ const struct stat *st,
+ Image **ret) {
+
+- _cleanup_free_ char *pretty_buffer = NULL;
+- _cleanup_free_ char *cwd = NULL;
++ _cleanup_free_ char *pretty_buffer = NULL, *parent = NULL;
+ struct stat stbuf;
+ bool read_only;
+ int r;
+@@ -223,8 +222,12 @@ static int image_make(
+ st = &stbuf;
+ }
+
+- if (!path)
+- safe_getcwd(&cwd);
++ if (!path) {
++ if (dfd == AT_FDCWD)
++ (void) safe_getcwd(&parent);
++ else
++ (void) fd_get_path(dfd, &parent);
++ }
+
+ read_only =
+ (path && path_startswith(path, "/usr")) ||
+@@ -364,7 +367,7 @@ static int image_make(
+
+ block_fd = openat(dfd, filename, O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_NOCTTY);
+ if (block_fd < 0)
+- log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path ?: strnull(cwd), filename);
++ log_debug_errno(errno, "Failed to open block device %s/%s, ignoring: %m", path ?: strnull(parent), filename);
+ else {
+ /* Refresh stat data after opening the node */
+ if (fstat(block_fd, &stbuf) < 0)
+@@ -378,13 +381,13 @@ static int image_make(
+ int state = 0;
+
+ if (ioctl(block_fd, BLKROGET, &state) < 0)
+- log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename);
++ log_debug_errno(errno, "Failed to issue BLKROGET on device %s/%s, ignoring: %m", path ?: strnull(parent), filename);
+ else if (state)
+ read_only = true;
+ }
+
+ if (ioctl(block_fd, BLKGETSIZE64, &size) < 0)
+- log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path ?: strnull(cwd), filename);
++ log_debug_errno(errno, "Failed to issue BLKGETSIZE64 on device %s/%s, ignoring: %m", path ?: strnull(parent), filename);
+
+ block_fd = safe_close(block_fd);
+ }
next reply other threads:[~2019-06-08 20:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-08 20:44 Mike Gilbert [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-20 8:01 [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/files/ Joonas Niilola
2024-06-17 22:36 Conrad Kostecki
2024-04-18 15:19 Mike Gilbert
2023-10-01 7:34 Sam James
2023-08-13 17:32 Mike Gilbert
2023-05-06 17:55 Mike Gilbert
2023-04-22 18:16 Mike Gilbert
2023-01-01 18:16 Conrad Kostecki
2022-10-19 18:13 Mike Gilbert
2022-08-04 18:39 Mike Gilbert
2022-07-19 17:10 Conrad Kostecki
2020-03-06 19:20 Mike Gilbert
2019-08-02 20:41 Mike Gilbert
2019-07-10 19:18 Mike Gilbert
2018-06-04 15:09 Mike Gilbert
2018-06-04 15:09 Mike Gilbert
2018-05-27 16:11 Aaron Bauman
2018-04-03 18:23 Mike Gilbert
2018-02-13 22:15 Mike Gilbert
2017-12-07 0:18 Mike Gilbert
2017-10-18 18:39 Mike Gilbert
2017-08-29 22:21 Mike Gilbert
2016-11-04 1:06 Mike Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1560026502.284c3c0b7d130ca73ed214365c8ecc2cba30ac6e.floppym@gentoo \
--to=floppym@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox