clearlinux / clr-installer

Clear Linux* OS Installer
GNU General Public License v3.0
92 stars 42 forks source link

Exit code is not non-zero when running as non-root #687

Closed gtkramer closed 4 years ago

gtkramer commented 4 years ago

Describe the bug clr-installer requires root privileges to perform an install. However, when run as a regular user, clr-installer notifies the user of this but then exits cleanly with a code of 0.

To Reproduce Steps to reproduce the behavior: As a non-root user, run the following:

$ clr-installer --config <any config>
clr-installer MUST run as 'root' user to install! (user=1000)

The exit code is zero.

Expected behavior When running the above as a non-root zero, the exit code should be non-zero.

Screenshots N/A

Environment (please complete the following information):

Additional context N/A

lebensterben commented 4 years ago

It should exit with 126 for permission related problem, or just use exit code 1.

mdhorn commented 4 years ago

@gtkramer This was by design originally to ensure the code followed the standard existing flow, but without the stack trace. I'm open to changing it.

mdhorn commented 4 years ago

Released in 2.4.3 in Clear Linux OS 32750 or higher.