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

install.py: [!] Failed to extract archive: Permission denied #28

Closed
stardust85 opened this issue Feb 12, 2017 · 8 comments
Closed

install.py: [!] Failed to extract archive: Permission denied #28

stardust85 opened this issue Feb 12, 2017 · 8 comments

Comments

@stardust85
Copy link

OS Build: 14393.693
python: 3.4.5 cygwin

How can I allow it to write there?

@stardust85
Copy link
Author

when debugging with pdb:

> /cygdrive/c/Users/msamia/WSL-Distribution-Switcher/ntfsea.py(261)init()
-> ntfsea.lib = loader('ntfsea_%s.dll' % ('x64' if platform.architecture()[0] == '64bit' else 'x86'))
(Pdb)
OSError: Permission denied

@stardust85
Copy link
Author

Updating to Windows 10 Insider Preview 15031

@stardust85
Copy link
Author

@RoliSoft
Copy link
Owner

The script was originally designed to work with the Windows distribution of Python. After the script was mostly finished, I added support for Cygwin, but it required a lot of hacks, since Cygwin ships the Linux version, so to speak, so a lot of Windows-specific functionalities are missing, lack of ctypes.WinDLL being one of them.

However, it is working on my Cygwin installation as the script is now, so it should work for you as well under normal circumstances.

I'll try recreating the issue so I can see what I can do about it, meanwhile, you can try the compiled version of the script: https://github.com/RoliSoft/WSL-Distribution-Switcher/releases

Currently, the compiled version is the latest version, and does not require separate Python runtime. Just run the exes from command prompt as you would run the scripts.

@stardust85
Copy link
Author

stardust85 commented Feb 13, 2017

Upgraded to Updating to Windows 10 Insider Preview 15031. Specified explicit path to installed windows version of Python 3.6. Running from powershell.

PS C:\Users\msamia\WSL-Distribution-Switcher> git rev-parse HEAD
1adbfbca21e58c700c105e5bfe9165069d57d0cc
PS C:\Users\msamia\WSL-Distribution-Switcher>

PS C:\Users\msamia\WSL-Distribution-Switcher> C:\Users\msamia\AppData\Local\Programs\Python\Python36\python.exe .\install.py centos:7
[*] Probing the Linux subsystem...
[*] Default user is root at /root.
[*] Reading /etc/{passwd,shadow,group,gshadow} entries for root...
[*] Beginning extraction...
[!] Failed to extract archive: [WinError 5] Access is denied
PS C:\Users\msamia\WSL-Distribution-Switcher>

The same happens when I run the powershell as administrator.

@stardust85
Copy link
Author

Minimum reproduction scenario on both versions 15031 and 14393.51 in powershell:

PS C:\Users\msamia\WSL-Distribution-Switcher> python -c 'from ntfsea import ntfsea; ntfsea.init()'
python : Traceback (most recent call last):
At line:1 char:1
+ python -c 'from ntfsea import ntfsea; ntfsea.init()' 2>&1|clip
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
  File "<string>", line 1, in <module>
  File "C:\Users\msamia\WSL-Distribution-Switcher\ntfsea.py", line 261, in init
    ntfsea.lib = loader('ntfsea_%s.dll' % ('x64' if platform.architecture()[0] == '64bit' else 'x86'))
  File "C:\Users\msamia\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 344, in __init__
    self._handle = _dlopen(self._name, mode)
PermissionError: [WinError 5] Access is denied

@RoliSoft
Copy link
Owner

Could you please check if this issue resolves itself if you run the script as administrator?

You don't need admin for the scripts, but for debugging purposes, let's make sure whether this is a genuine permission issue, or something else disguised as "Access is denied".

@stardust85
Copy link
Author

Now I made it work. Even under normal user. The ntfs extended attribute dll wasn't allowed to be executed for any user.

How to fix it:

  1. right-click on ntfsea_x64.dll (or x86 if you have 32 bit)
  2. properties
  3. tab Security
  4. Advanced
  5. remove all lines containing type Deny
  6. OK
  7. choose your user
  8. tick read and execute
  9. OK

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

No branches or pull requests

2 participants