From a24e3938e8611146595bd2302cc7d47666132ba2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 2 Feb 2022 15:20:30 +0100 Subject: [PATCH] udevadm: don't claim a sysattr was write only just because we get EPERM on read it might be totally inaccessible, hence weaken our language a bit and just say "not readable", thus making not claim whether it is writable or not. Follow-up for 3a90bef55a5a71a03629a762470b0f9014cd8453 --- src/udev/udevadm-info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 5ae33e101a..992764b80c 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -16,6 +16,7 @@ #include "device-private.h" #include "device-util.h" #include "dirent-util.h" +#include "errno-util.h" #include "fd-util.h" #include "sort-util.h" #include "static-destruct.h" @@ -117,8 +118,8 @@ static int print_all_attributes(sd_device *device, bool is_parent) { if (len > 0) continue; - } else if (r == -EPERM) - value = "(write-only)"; + } else if (ERRNO_IS_PRIVILEGE(r)) + value = "(not readable)"; else continue; -- 2.25.1