You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is a problem with .sqlite in /var/db/pkg, then e.g. pkg upgrade pkg just silently exits without any error message (just $?=1), even with -dddd. Tracing problem with gdb found the cause:
I think this behavior is intentional(?), as pkgdb_check_access() only returns error codes, and doesn't print standard error messages. This issue also exists in some other commands as well (see #2211).
A simple "fix" can be done by adding a warning message (using warn(3) or perror(3)) whenever faccessat(3) fails.
I'm not sure, if it's required in most cases, as you can always check for returned errors. Although I agree, having a clear error message is much better than just relying on returned values.
Well, this can't be intentional, because it creates UX from hell for the user. And even if the user is not just user but sysadmin, then bare faccessat: Operation not permitted is stil not enough - yopu want to know which file caused the problem. So that it can be fixed without consulting pkg sources. Because user do not call routines to check for error codes, user calls e.g. pkg upgrade.
So. The only debatable thing here is where to insert reporting to user, and by which function - this is what pkg maintainers know better than bugreporter.
Adding it in pkgdb_check_access() function is just fine. However, before any PR, it will be better to get some attention from maintainers with this issue.
If there is a problem with
.sqlite
in/var/db/pkg
, then e.g.pkg upgrade pkg
just silently exits without any error message (just$?=1
), even with-dddd
. Tracing problem withgdb
found the cause:And there is no sufficient checks for
errno
later.How to reproduce, most easy way:
Solution is to add
perror()
(or whatever better style forpkg
) later in this function inelse
branch for all unknownerrno
's.The text was updated successfully, but these errors were encountered: