Explicit warning when root is needed to upgrade DB#1908
Explicit warning when root is needed to upgrade DB#1908tigergao99 wants to merge 1 commit intofreebsd:mainfrom
Conversation
|
Could this also check that pkg isn't running as root, otherwise it's possible that this may give a misleading error explanation (if the filesystem is read-only, for example). |
|
Thanks for the catch. Now using geteuid() to check if user is root. |
|
You should also check for "install as user" concept |
|
Context: |
|
This looks misplaced. The SQL can err for a thousand reasons, not being able to write to the database is just one. Also the repetition does not look nice. I believe the intention is to catch having a read-only database, which is a possible niche scenario, so not invalid per-se. IMO the best place for this code fragment is in the error-handler that is invoked by many of the SQLite function call sites. It is located in Would that be a possible way forward for you? |
Prints an explicit warning when errmsg has the substring "readonly".
Fixes #1771