summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2021-11-25 04:15:54 +1000
committerGitHub <noreply@github.com>2021-11-24 10:15:54 -0800
commit02716851dbedd5f0d6f8abc853e9b891144486e4 (patch)
tree60e98fc48872606048738e3e2cbb4f9c1e3b6212
parent4079bc948bfc32cdbaee2ae2789eb5c81f2f3840 (diff)
downloadansible-02716851dbedd5f0d6f8abc853e9b891144486e4.tar.gz
LinkUtil - ignore LIB env var (#76184) (#76203)
(cherry picked from commit db2aee558bd58269b380c6643fb87bee2c00ee47)
-rw-r--r--changelogs/fragments/win_LinkUtil-ignore-LIB.yml2
-rw-r--r--lib/ansible/module_utils/powershell/Ansible.ModuleUtils.LinkUtil.psm13
2 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/fragments/win_LinkUtil-ignore-LIB.yml b/changelogs/fragments/win_LinkUtil-ignore-LIB.yml
new file mode 100644
index 0000000000..1f20b2e87c
--- /dev/null
+++ b/changelogs/fragments/win_LinkUtil-ignore-LIB.yml
@@ -0,0 +1,2 @@
+bugfixes:
+- Ansible.ModuleUtils.LinkUtil - Ignore the ``LIB`` environment variable when loading the ``LinkUtil`` code
diff --git a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.LinkUtil.psm1 b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.LinkUtil.psm1
index 78aa4eacdd..839dd028bc 100644
--- a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.LinkUtil.psm1
+++ b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.LinkUtil.psm1
@@ -394,6 +394,7 @@ namespace Ansible
# FUTURE: find a better way to get the _ansible_remote_tmp variable
$original_tmp = $env:TMP
+ $original_lib = $env:LIB
$remote_tmp = $original_tmp
$module_params = Get-Variable -Name complex_args -ErrorAction SilentlyContinue
@@ -405,8 +406,10 @@ namespace Ansible
}
$env:TMP = $remote_tmp
+ $env:LIB = $null
Add-Type -TypeDefinition $link_util
$env:TMP = $original_tmp
+ $env:LIB = $original_lib
# enable the SeBackupPrivilege if it is disabled
$state = Get-AnsiblePrivilege -Name SeBackupPrivilege