$ equery check sudo Traceback (most recent call last): File "/usr/lib/python-exec/python2.7/equery", line 38, in <module> equery.main(sys.argv) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/__init__.py", line 357, in main loaded_module.main(module_args) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/check.py", line 288, in main check(matches) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/check.py", line 80, in __call__ check_results = self._run_checks(pkg.parsed_contents()) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/check.py", line 118, in _run_checks obj_errs = self._verify_obj(files, cfile, real_cfile, errs) File "/usr/lib64/python2.7/site-packages/gentoolkit/equery/check.py", line 148, in _verify_obj cur_checksum = checksum.perform_md5(real_cfile, calc_prelink=1) File "/usr/lib64/python2.7/site-packages/portage/checksum.py", line 188, in perform_md5 return perform_checksum(x, "MD5", calc_prelink)[0] File "/usr/lib64/python2.7/site-packages/portage/checksum.py", line 390, in perform_checksum myhash, mysize = hashfunc_map[hashname](myfilename) File "/usr/lib64/python2.7/site-packages/portage/checksum.py", line 53, in __call__ with _open_file(filename) as f: File "/usr/lib64/python2.7/site-packages/portage/checksum.py", line 30, in _open_file raise portage.exception.PermissionDenied(func_call) portage.exception.PermissionDenied: open('/etc/sudoers') I think it should not crash or exit with error when it can not read some file due to permissions, instead it should just skip it and show something like this: * Checking app-admin/sudo-1.8.8 ... !!! /etc/sudoers permission denied, you need to be root for checking this file
Created attachment 391810 [details, diff] gentoolkit-0.3.0.9-equery-494134.patch A year later and I still hit the issue in gentoolkit-0.3.0.9-r2. A quick look into the source reveals that there is actually code to handle the case, but it expects the wrong exception type. The attached patch fixes that and also avoids a crash for other errors.
Thank you, Patch applied, testing. will be in the next release.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c1c66b84d3e14b887b7b460111664e62238172fb commit c1c66b84d3e14b887b7b460111664e62238172fb Author: Alexander Miller <alex.miller@gmx.de> AuthorDate: 2022-07-10 15:55:25 +0000 Commit: Brian Dolbec <dolsen@gentoo.org> CommitDate: 2022-07-10 15:55:25 +0000 equery check: Fix exception handling for Insufficient permissions A quick look into the source reveals that there is actually code to handle the case, but it expects the wrong exception type. This patch fixes that and also avoids a crash for other errors. Bug: https://bugs.gentoo.org/494134 Signed-off-by: Brian Dolbec <dolsen@gentoo.org> pym/gentoolkit/equery/check.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)