Skip to content

Conversation

@and3rson
Copy link

Currently there's a bug that leads to crash when there's no file ~/.config/lighthouse/cmd.py:

Couldn't execute file: Permission denied
Failed to spawn piped process.

This pull request fixes it by checking if file exists and falling back to the default one within /usr/share/lighthouse

@and3rson
Copy link
Author

Any updates? :)

Copy link
Owner

@emgram769 emgram769 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

char *exec_file = settings.cmd;
char *exec_file;
if(access(settings.cmd, F_OK) == -1) {
exec_file = "/usr/share/lighthouse/cmd.py";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't particularly informative/portable. perhaps mimic lines 716-718? something like this:

fprintf(stderr, "No 'cmd' set, please edit your lighthouserc or run lighthouse-install");
exit_code = 1;
return exit_code;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants