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

Add symbolic links for libssl and libcrypto to Debian 9 builds. #7609

Merged
merged 5 commits into from Aug 24, 2018
Merged

Add symbolic links for libssl and libcrypto to Debian 9 builds. #7609

merged 5 commits into from Aug 24, 2018

Conversation

dantraMSFT
Copy link
Contributor

PR Summary

On Debian 9, libmi cannot resolve libssl and libcrypto. This change adds symbolic links to packaging and build to the $PSHOME directory to resolve the issue.

The fix was verified interactively connecting to office 365, importing the session, and ensuring Get-MailBox and Get-User succeed.

Fix #7598

PR Checklist

build.psm1 Outdated
# add two symbolic links to system shared libraries that libmi.so is dependent on to handle
# platform specific changes. This appears to be a change in Debian 9; Debian 8 did not need these
# symlinks.
if (!(Test-Path -Path "$publishPath/libssl.so.1.0.0"))
Copy link
Member

Choose a reason for hiding this comment

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

The code for this is very similar to the code for RedHatFamily. Can we combine logic like this:

if($Environment.IsRedHatFamily -or $Environment.IsDebian9){
if($Environment.IsRedHatFamily) {
    $sslTarget = "/lib64/libssl.so.10"
    $cryptoTarget = "/lib64/libcrypto.so.10"
} elseif ($Enviroment.IsDebian9) {
 …..
}
   if(-not (Test-Path …) {
   }

  if(-not (Test-Path …) {
  }
}


Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

build.psm1 Outdated
@@ -610,6 +610,22 @@ Fix steps:
}
}

if ($Environment.IsDebian9)
{
Copy link
Member

Choose a reason for hiding this comment

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

Please follow the pattern of { being on the same line as if

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -1102,6 +1102,15 @@ function New-AfterScripts
$AfterRemoveScript = [io.path]::GetTempFileName()
$packagingStrings.UbuntuAfterInstallScript -f "$Link" | Out-File -FilePath $AfterInstallScript -Encoding ascii
$packagingStrings.UbuntuAfterRemoveScript -f "$Link" | Out-File -FilePath $AfterRemoveScript -Encoding ascii

if ($Environment.IsDebian9)
Copy link
Member

Choose a reason for hiding this comment

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

Please follow pattern for having { to be on the same line as if

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

if ($Environment.IsDebian9){
# NOTE: Debian 8 doesn't need these symlinks
$sslTarget = "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2"
$cryptoTarget = "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suspect it's because they are loading explicitly by version; libmi doesn't have version detection logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adityapatwardhan: I've addressed your feedback.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean that a root problem in libmi? if so it seems better to make a correction there than to receive surprises with each new linux distributive.

@TravisEz13
Copy link
Member

@adityapatwardhan can you update your review?

@TravisEz13 TravisEz13 merged commit 1abf290 into PowerShell:master Aug 24, 2018
@TravisEz13 TravisEz13 added this to the v6.1.0 milestone Aug 28, 2018
@dantraMSFT dantraMSFT deleted the dantra/issue7598 branch August 31, 2018 20:44
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.

New-PSSession on Linux to office365.com fails on Debian 9 due to missing symlinks for libssl and libcrypto
4 participants