From 1abf290f839f766400a64ddd8b853709489c8aa5 Mon Sep 17 00:00:00 2001 From: Dan Travison Date: Fri, 24 Aug 2018 15:20:22 -0700 Subject: [PATCH] Add symbolic links for `libssl` and `libcrypto` to Debian 9 builds to make remoting work. (#7609) 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 --- build.psm1 | 17 ++++++++++++++--- tools/packaging/packaging.psm1 | 8 ++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index 6fdfd550ad..a6cd889533 100644 --- a/build.psm1 +++ b/build.psm1 @@ -597,16 +597,27 @@ Fix steps: Pop-Location } - if ($Environment.IsRedHatFamily) { + if ($Environment.IsRedHatFamily -or $Environment.IsDebian9) { # add two symbolic links to system shared libraries that libmi.so is dependent on to handle # platform specific changes. This is the only set of platforms needed for this currently # as Ubuntu has these specific library files in the platform and macOS builds for itself # against the correct versions. + + 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" + } + else { #IsRedHatFamily + $sslTarget = "/lib64/libssl.so.10" + $cryptoTarget = "/lib64/libcrypto.so.10" + } + if ( ! (test-path "$publishPath/libssl.so.1.0.0")) { - $null = New-Item -Force -ItemType SymbolicLink -Target "/lib64/libssl.so.10" -Path "$publishPath/libssl.so.1.0.0" -ErrorAction Stop + $null = New-Item -Force -ItemType SymbolicLink -Target $sslTarget -Path "$publishPath/libssl.so.1.0.0" -ErrorAction Stop } if ( ! (test-path "$publishPath/libcrypto.so.1.0.0")) { - $null = New-Item -Force -ItemType SymbolicLink -Target "/lib64/libcrypto.so.10" -Path "$publishPath/libcrypto.so.1.0.0" -ErrorAction Stop + $null = New-Item -Force -ItemType SymbolicLink -Target $cryptoTarget -Path "$publishPath/libcrypto.so.1.0.0" -ErrorAction Stop } } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index fca58bf242..0f1adc723a 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1102,6 +1102,14 @@ 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) { + # 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. + New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2" -Path "$Staging/libssl.so.1.0.0" >$null + New-Item -Force -ItemType SymbolicLink -Target "/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2" -Path "$Staging/libcrypto.so.1.0.0" >$null + } } return [PSCustomObject] @{