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 3a90bef55a
This commit is contained in:
Lennart Poettering
2022-02-03 07:32:54 +09:00
committed by Yu Watanabe
parent 3a17ffa68e
commit a24e3938e8
+3 -2
View File
@@ -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;