-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Remove PATH from default env vars for launchctl #1907
Conversation
my suggestion is for the client to ship the service its path and for the path to augment its path with the client's path. |
Actually this does fix it... I'm not sure why I thought the PATH was invalid We should double check though... maybe we should add a debug log statement which outputs the path (if there isn't already) Otherwise ship |
Actually I'm not sure... I might have set my PATH system wide via launchctl:
|
Hold off for a sec, we need to fully understand this more :) |
Based on our testing, it looks like launchctl doesn't use the user's path. It will use a default one, or whatever was set by We can go forward with @maxtaco suggestion. |
var clientAdditions []string | ||
NextDir: | ||
for _, dir := range strings.Split(arg.Path, ":") { | ||
for _, x := range pathenv { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know this is a rush job, but i'm dying inside! can you use a map so it's not n^2? Thanks!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How long is your path :) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know i know, but it's less code to use a map!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Looks good, had a small question ! |
So service can augment its path with the client's path and successfully find things like `gpg` that are outside launchctl default path of /usr/bin:/bin:/usr/sbin:/sbin
5981c17
to
4e3779d
Compare
libhttpserver: Get mime types right for even more filetypes
r? @gabriel
cc: @maxtaco