提交 75b0bfd2 编写于 作者: J Jakub Kicinski 提交者: Daniel Borkmann

Revert "selftests: bpf: Don't try to read files without read permission"

This reverts commit 5bc60de5 ("selftests: bpf: Don't try to read
files without read permission").

Quoted commit does not work at all, and was never tested.
Script requires root permissions (and tests for them)
and os.access() will always return true for root.

The correct fix is needed in the bpf tree, so let's just
revert and save ourselves the merge conflict.
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NAlexei Starovoitov <ast@kernel.org>
Cc: Jiri Pirko <jiri@resnulli.us>
Link: https://lore.kernel.org/bpf/20191101005127.1355-1-jakub.kicinski@netronome.com
上级 06087114
...@@ -312,7 +312,7 @@ class DebugfsDir: ...@@ -312,7 +312,7 @@ class DebugfsDir:
if f == "ports": if f == "ports":
continue continue
p = os.path.join(path, f) p = os.path.join(path, f)
if os.path.isfile(p) and os.access(p, os.R_OK): if os.path.isfile(p):
_, out = cmd('cat %s/%s' % (path, f)) _, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip() dfs[f] = out.strip()
elif os.path.isdir(p): elif os.path.isdir(p):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册