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

Incorrect file permissions in latest release https://github.com/PowerShell/PowerShell/releases/tag/v7.3.0 #18495

Closed
5 tasks done
theofficialgman opened this issue Nov 9, 2022 · 14 comments · Fixed by #18643
Closed
5 tasks done
Labels
Resolution-Fixed The issue is fixed.

Comments

@theofficialgman
Copy link

theofficialgman commented Nov 9, 2022

Prerequisites

Steps to reproduce

tarfiles contain incorrect file permissions. the executables are makred as rw and NOT executable. not an issue on previous releases (eg: they are executable on 7.2.7). this also affects nearly all other files in the tarfile (most of them have different permissions from before)

Expected behavior

executables are marked as executable

-rwxr-xr-x

Actual behavior

executables are not marked as executable and many files have different permissions

-rw-r--r--

Error details

No response

Environment data

Linux

Visuals

No response

@theofficialgman theofficialgman added the Needs-Triage The issue is new and needs to be triaged by a work group. label Nov 9, 2022
theofficialgman added a commit to Botspot/pi-apps that referenced this issue Nov 9, 2022
@237dmitry
Copy link

Could you give a concrete example. This problem was before version 7.2.6 inclusive, but then it was fixed. in 7.3.0 I did not find any UnixMode errors, it coincides with UnixFileMode.

Get-Item /opt/microsoft/powershell/7/pwsh |
Foreach-Object {
    $_.UnixMode
    [convert]::ToString([int]$_.UnixFileMode,8)
    stat -c "%a" $_
}

@theofficialgman
Copy link
Author

theofficialgman commented Nov 9, 2022

tar -xf the powershell tarfile from 7.2.7 and the one from 7.3.0. the differences are clear as day. all the file permissions have changed to be incorrect for their intended function and nothing has the executable bit set in 7.3.0

version=7.2.7
mkdir -p /tmp/powershell-$version
cd /tmp/powershell-$version
wget https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-linux-arm64.tar.gz
tar -xf powershell-${version}-linux-arm64.tar.gz
ls -l
version=7.3.0
mkdir -p /tmp/powershell-$version
cd /tmp/powershell-$version
wget https://github.com/PowerShell/PowerShell/releases/download/v${version}/powershell-${version}-linux-arm64.tar.gz
tar -xf powershell-${version}-linux-arm64.tar.gz
ls -l

@237dmitry
Copy link

the powershell tarfile

Do you mean the tar archive of the release? Yes, pwsh in it was not executable. But UnixMode represents correct string as it does native ls

@theofficialgman
Copy link
Author

theofficialgman commented Nov 9, 2022

See my script for the file I am talking about. These are the official binary release archives that are now broken

@237dmitry
Copy link

These are the official binary release archives that are now broken

Add to script chmod +x /path/to/pwsh

@theofficialgman
Copy link
Author

theofficialgman commented Nov 9, 2022

You should look at the tarfile. That's not the only mistake regarding permissions. Everything is wrong
Just diff the contents. This is a packaging issue

@237dmitry
Copy link

237dmitry commented Nov 9, 2022

Everything is wrong

I did these steps and all works:

  1. Downloaded
  2. Unpacked
  3. chmod +x pwsh
  4. Made symlinks in the $PATH to pwsh and pwsh.dll.

pwsh to /usr/bin. pwsh.dll to ~/bin

ArcoLinux_2022-11-09_18-03-34

Symlinks I did early. To pwsh 7.0.* maybe and to pwsh.dll 7.3.0-rc.1

@theofficialgman
Copy link
Author

theofficialgman commented Nov 9, 2022

You are missing the point. It's a packaging issue. It was correct by default in previous releases as it should be. Tarfiles contain the file permissionsm the user shouldn't have to do anything to run from the archive

@237dmitry
Copy link

You are missing the point. It's a packaging issue.

No, I did not. I do not refuse that this is the error of packagers.

the user shouldn't have to do anything to run from the archive

This is linux, I'm already used to all sorts of surprises ))

@theofficialgman
Copy link
Author

theofficialgman commented Nov 9, 2022

You are missing the point. It's a packaging issue.

No, I did not. I do not refuse that this is the error of packagers.

I will continue to wait till a maintainer comes around. there isn't any debate here, this is a mistake of the packaging. tarfiles contain the file permissions for a reason, so that you can extract and run without messing with permissions.

the user shouldn't have to do anything to run from the archive

This is linux, I'm already used to all sorts of surprises ))

bad packages like this is what makes these surprises. your denial only further worsens that situation and makes the linux ecosystem less welcoming. @237dmitry I'm going to ask that you refrain from commenting here further. your comments do nothing for the issue.

previous releases with correct permissions on all files

-rwxr--r--  1 ubuntu ubuntu   199280 Sep 26 17:29 libSystem.Globalization.Native.so
-rwxr--r--  1 ubuntu ubuntu   854464 Sep 26 17:29 libSystem.IO.Compression.Native.so
-rwxr--r--  1 ubuntu ubuntu   198944 Oct 22  2021 libSystem.IO.Ports.Native.so
-rwxr--r--  1 ubuntu ubuntu   198944 Sep 26 17:29 libSystem.Native.so
-rwxr--r--  1 ubuntu ubuntu   199080 Sep 26 17:29 libSystem.Net.Security.Native.so
-rwxr--r--  1 ubuntu ubuntu   198968 Sep 26 17:29 libSystem.Security.Cryptography.Native.OpenSsl.so
-rwxr--r--  1 ubuntu ubuntu  2433384 Sep 26 17:18 libclrjit.so
-rwxr--r--  1 ubuntu ubuntu  6929448 Sep 26 17:18 libcoreclr.so
-rwxr--r--  1 ubuntu ubuntu   858808 Sep 26 17:12 libcoreclrtraceptprovider.so
-rwxr--r--  1 ubuntu ubuntu   791616 Sep 26 17:16 libdbgshim.so
-rwxr--r--  1 ubuntu ubuntu   461432 Sep 26 17:41 libhostfxr.so
-rwxr--r--  1 ubuntu ubuntu   461448 Sep 26 17:41 libhostpolicy.so
-rwxr--r--  1 ubuntu ubuntu  2589248 Sep 26 17:17 libmscordaccore.so
-rwxr--r--  1 ubuntu ubuntu  1774960 Sep 26 17:18 libmscordbi.so
-rwxr--r--  1 ubuntu ubuntu   242432 Oct 18  2021 libpsl-native.so
-rwxr--r--  1 ubuntu ubuntu    58504 Sep 26 17:29 mscorlib.dll
-rwxr--r--  1 ubuntu ubuntu   101504 Sep 26 17:29 netstandard.dll
drwxr-xr-x  2 ubuntu ubuntu     4096 Oct 17 23:21 pl
drwxr-xr-x  2 ubuntu ubuntu     4096 Oct 17 23:21 pt-BR
-rwxr-xr-x  1 ubuntu ubuntu   200424 Oct 17 23:17 pwsh

the incorrect packaging from 7.3.0

-rw-r--r--  1 ubuntu ubuntu   201568 Nov  7 22:23 libSystem.Globalization.Native.so
-rw-r--r--  1 ubuntu ubuntu   855568 Nov  7 22:23 libSystem.IO.Compression.Native.so
-rw-r--r--  1 ubuntu ubuntu   200200 Nov  7 22:23 libSystem.IO.Ports.Native.so
-rw-r--r--  1 ubuntu ubuntu   211560 Nov  7 22:23 libSystem.Native.so
-rw-r--r--  1 ubuntu ubuntu   200416 Nov  7 22:23 libSystem.Net.Security.Native.so
-rw-r--r--  1 ubuntu ubuntu   347184 Nov  7 22:23 libSystem.Security.Cryptography.Native.OpenSsl.so
-rw-r--r--  1 ubuntu ubuntu   856344 Nov  7 22:23 libclrgc.so
-rw-r--r--  1 ubuntu ubuntu  3085408 Nov  7 22:23 libclrjit.so
-rw-r--r--  1 ubuntu ubuntu  6866104 Nov  7 22:23 libcoreclr.so
-rw-r--r--  1 ubuntu ubuntu   990184 Nov  7 22:23 libcoreclrtraceptprovider.so
-rw-r--r--  1 ubuntu ubuntu   462392 Nov  7 22:23 libhostfxr.so
-rw-r--r--  1 ubuntu ubuntu   461848 Nov  7 22:23 libhostpolicy.so
-rw-r--r--  1 ubuntu ubuntu  2596432 Nov  7 22:23 libmscordaccore.so
-rw-r--r--  1 ubuntu ubuntu  1840944 Nov  7 22:23 libmscordbi.so
-rw-r--r--  1 ubuntu ubuntu   242432 Nov  7 22:23 libpsl-native.so
-rw-r--r--  1 ubuntu ubuntu    58496 Nov  7 22:23 mscorlib.dll
-rw-r--r--  1 ubuntu ubuntu   101040 Nov  7 22:23 netstandard.dll
drwxr-xr-x  2 ubuntu ubuntu     4096 Nov  7 22:26 pl
drwxr-xr-x  2 ubuntu ubuntu     4096 Nov  7 22:26 pt-BR
-rw-r--r--  1 ubuntu ubuntu   201272 Nov  7 22:23 pwsh

@mmitche
Copy link

mmitche commented Nov 10, 2022

@SteveL-MSFT, any idea about this issue?

@AndrewSav
Copy link

This is affecting us too

@SteveL-MSFT
Copy link
Member

The Maintainers are looking at this today

@ghost ghost added the In-PR Indicates that a PR is out for the issue label Nov 22, 2022
@ghost ghost added Resolution-Fixed The issue is fixed. and removed In-PR Indicates that a PR is out for the issue Needs-Triage The issue is new and needs to be triaged by a work group. labels Nov 22, 2022
@ghost
Copy link

ghost commented Dec 20, 2022

🎉This issue was addressed in #18643, which has now been successfully released as v7.4.0-preview.1.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Fixed The issue is fixed.
Projects
None yet
6 participants