Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils: find_executable honors local dir paths #134

Merged
merged 1 commit into from
Oct 19, 2019

Conversation

giuseppe
Copy link
Member

when the executable path has the form ./PATH, make sure the current
working directory is used as a prefix.

Closes: #133

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

cleanup_free char *tmp = NULL;
char path[PATH_MAX + 1];
int last_error = ENOENT;
char *it, *end;
int ret;

if (executable_path[0] == '.')
Copy link
Member

Choose a reason for hiding this comment

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

Should you check to make sure len(executable_path) >0?

Copy link
Member Author

@giuseppe giuseppe Oct 16, 2019

Choose a reason for hiding this comment

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

in that case executable_path[0] would be '\0'

Copy link
Member

Choose a reason for hiding this comment

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

What about if executable_path == null

Copy link
Member Author

Choose a reason for hiding this comment

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

that should not happen as the only caller checks for it, but in any case to be safer I've added a new check now

when the executable path has the form ./PATH, make sure the current
working directory is used as a prefix.

Closes: containers#133

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member Author

tests are green

@rhatdan
Copy link
Member

rhatdan commented Oct 19, 2019

LGTM

@rhatdan rhatdan merged commit 5582793 into containers:master Oct 19, 2019
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.

bitwardenrs/server:alpine fails to run with crun on FC31 but works with runc on FC30
2 participants