RedHatInsights / insights-client

insights-client
Other
27 stars 49 forks source link

fix: use system temporary directory when running as non-root #267

Closed ptoscano closed 4 months ago

ptoscano commented 4 months ago

The temporary directory chosen to work properly with SELinux is /var/lib/insights, which can be accessed only by root.

insights-client is basically not usable as non-root, and it will fail with Insights client must be run as root.. The only exception here is insights-client --version, which is run only in the client without loading the core; the exception is that the client will still verify the available eggs using GPG by default.

Hence, use the default temporary directory when running as non-root: this way the available eggs can be validated, and the client will either

Followup of commit dd6293d608f61a44e562a1fda44cad82cf667e7d.