From: Lennart Poettering Date: Mon, 29 Aug 2022 13:11:15 +0000 (+0200) Subject: homed: don't use stat() data from an unrelated inode X-Git-Tag: v252-rc1~299 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bede0a0aad902796027de7fa644750971236d54;p=thirdparty%2Fsystemd.git homed: don't use stat() data from an unrelated inode This doesn't really change anything, since we know the stat data used here also contains S_IFBLK, but it's frickin' confusing. --- diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index edf310f16d7..68a5ac9c2e3 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -3122,7 +3122,7 @@ int home_resize_luks( log_info("Operating on partition device %s, using parent device.", ip); - opened_image_fd = r = device_open_from_devnum(st.st_mode, parent, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK, &whole_disk); + opened_image_fd = r = device_open_from_devnum(S_IFBLK, parent, O_RDWR|O_CLOEXEC|O_NOCTTY|O_NONBLOCK, &whole_disk); if (r < 0) return log_error_errno(r, "Failed to open whole block device for %s: %m", ip);