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

use join for x-plat friendly root paths #4713

Merged
merged 1 commit into from Mar 7, 2018
Merged

use join for x-plat friendly root paths #4713

merged 1 commit into from Mar 7, 2018

Conversation

mwrock
Copy link
Contributor

@mwrock mwrock commented Mar 6, 2018

This ensures that SVC_ROOT and SVC_USER file path slashes are OS native. Specifically making them backslashes on Windows.

While almost all apps on windows handle forward slashes just as well as backslashes there are a few (like SQL Server 2016 (unlike 2017)) that may not understand forward slashes. This should fix those cases.

Related to habitat-sh/core#12

Signed-off-by: mwrock matt@mattwrock.com

Signed-off-by: mwrock <matt@mattwrock.com>
@thesentinels
Copy link
Contributor

Thanks for the pull request! Here is what will happen next:

  1. Your PR will be reviewed by the maintainers
  2. If everything looks good, one of them will approve it, and your PR will be merged.

Thank you for contributing!

@baumanj
Copy link
Contributor

baumanj commented Mar 6, 2018

Looks correct to me! I wonder if there are other places we need to address such as https://github.com/habitat-sh/habitat/blob/master/components/sup/src/manager/mod.rs#L80

Copy link
Contributor

@baumanj baumanj left a comment

Choose a reason for hiding this comment

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

If there are other places where we need a similar fix, can we add them to this review or file an issue to track them down? I don't want to hold up this fix and the approach looks sound.

@mwrock
Copy link
Contributor Author

mwrock commented Mar 6, 2018

yeah good call @baumanj . I'll see if I can scour them all up. I have a workaround in the affected plan to tide us over in the meantime.

@mwrock
Copy link
Contributor Author

mwrock commented Mar 6, 2018

I took a look and this is the only one in this repo that would affect what gets leaked out of the {{pkh.svc_*_path}} variables. The only other path that the supervisor exposes to templates is PKG_PATH which is defined in core and can be handled in the other PR.

There are certainly other paths with forward slashes constructed as the one you noted but all of those paths are consumed internally and can thus be used with confidence since we don't have arbitrary code that is prejudiced against forward slashes.

@mwrock
Copy link
Contributor Author

mwrock commented Mar 6, 2018

@thesentinels approve

@thesentinels
Copy link
Contributor

🤘 I am testing your branch against master before merging it. We do this to ensure that the master branch is never failing tests.

@thesentinels
Copy link
Contributor

:neckbeard: Travis CI has started testing this PR.

@thesentinels
Copy link
Contributor

💖 Travis CI reports this PR passed.

It always makes me feel nice when humans approve of one anothers work. I'm merging this PR now.

I just want you and the contributor to answer me one question:

gif-keyboard-3280869874741411265

@thesentinels thesentinels merged commit a306cb2 into master Mar 7, 2018
@thesentinels thesentinels deleted the backslash branch March 7, 2018 00:03
@baumanj
Copy link
Contributor

baumanj commented Mar 7, 2018

Thanks for taking the extra time and looking into the other possible places, @mwrock !

@christophermaier christophermaier added Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Platform: Windows Deals with Windows-specific behavior Type: Bug Issues that describe broken functionality and removed A-supervisor labels Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Platform: Windows Deals with Windows-specific behavior Type: Bug Issues that describe broken functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants