From 48d837cd92c4b3452adace8db59383273bc5a65d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 23 Sep 2020 18:18:03 +0200 Subject: [PATCH] fs-util: use strna() on returned strings of fd_get_path() if we don't check its return value Let's make sure to use strna() on the strings returned by fd_get_path() where we knowingly ignore any failures. We got this right in most cases, but two were missing. --- src/basic/fs-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 477848f2a0..fb74501105 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -765,7 +765,7 @@ static int log_unsafe_transition(int a, int b, const char *path, unsigned flags) return log_warning_errno(SYNTHETIC_ERRNO(ENOLINK), "Detected unsafe path transition %s %s %s during canonicalization of %s.", - n1, special_glyph(SPECIAL_GLYPH_ARROW), n2, path); + strna(n1), special_glyph(SPECIAL_GLYPH_ARROW), strna(n2), path); } static int log_autofs_mount_point(int fd, const char *path, unsigned flags) { @@ -778,7 +778,7 @@ static int log_autofs_mount_point(int fd, const char *path, unsigned flags) { return log_warning_errno(SYNTHETIC_ERRNO(EREMOTE), "Detected autofs mount point %s during canonicalization of %s.", - n1, path); + strna(n1), path); } int chase_symlinks(const char *path, const char *original_root, unsigned flags, char **ret_path, int *ret_fd) {