-
Notifications
You must be signed in to change notification settings - Fork 234
Fix issue with stat format on Linux #698
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,13 +222,20 @@ function Set-NamedPipeMode { | |
[string] | ||
$PipeFile | ||
) | ||
|
||
if ($IsWindows) { | ||
return | ||
} | ||
|
||
chmod $DEFAULT_USER_MODE $PipeFile | ||
|
||
if ($IsLinux) { | ||
$mode = stat -c "%A" $PipeFile | ||
$mode = stat -c "%a" $PipeFile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could have sworn I tested on linux before shipping this... in any case, my bad and good find. |
||
} | ||
else { | ||
elseif ($IsMacOS) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function gets called only if they're on MacOS or Linux. So the "if Windows" check above and this elseif change isn't really needed. On the other hand, if we wanted to make it more robust, we could keep the Windows check in and remove the MacOS & Linux checks on line 328 and 334. |
||
$mode = stat -f "%A" $PipeFile | ||
} | ||
|
||
if ($mode -ne $DEFAULT_USER_MODE) { | ||
ExitWithError "Permissions to the pipe file were not set properly. Expected: $DEFAULT_USER_MODE Actual: $mode for file: $PipeFile" | ||
} | ||
|
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.
Wish there was a comment here to explain why this doesn't apply to Windows.