Skip to content

Windows permissions incorrect after clean clone of repository #23

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

Closed
gwharton opened this issue Aug 21, 2024 · 8 comments
Closed

Windows permissions incorrect after clean clone of repository #23

gwharton opened this issue Aug 21, 2024 · 8 comments

Comments

@gwharton
Copy link

Clone repository
Try to launch phpsdk-vs17-x64.bat (or any batch file)

image

graham@DESKTOP-IAGIISG ~/php-sdk-binary-tools
$ ./phpsdk-vs17-x64.bat
bash: ./phpsdk-vs17-x64.bat: Permission denied

graham@DESKTOP-IAGIISG ~/php-sdk-binary-tools
$ icacls phpsdk-vs17-x64.bat 
phpsdk-vs17-x64.bat NULL SID:(DENY)(Rc,X,DC)
                    DESKTOP-IAGIISG\graham:(R,W,D,WDAC,WO)
                    NT AUTHORITY\SYSTEM:(DENY)(X)
                    BUILTIN\Administrators:(DENY)(X)
                    DESKTOP-IAGIISG\None:(R)
                    NT AUTHORITY\SYSTEM:(RX,W)
                    BUILTIN\Administrators:(RX,W)
                    Everyone:(R)

Successfully processed 1 files; Failed processing 0 files

graham@DESKTOP-IAGIISG ~/php-sdk-binary-tools
$ icacls "*" /q /c /t /reset
Successfully processed 384 files; Failed processing 0 files

graham@DESKTOP-IAGIISG ~/php-sdk-binary-tools
$ icacls phpsdk-vs17-x64.bat 
phpsdk-vs17-x64.bat NULL SID:(I)(DENY)(Rc,REA,X,DC)
                    DESKTOP-IAGIISG\graham:(I)(F)
                    DESKTOP-IAGIISG\None:(I)(RX)
                    NT AUTHORITY\SYSTEM:(I)(RX,W,DC)
                    BUILTIN\Administrators:(I)(RX,W,DC)
                    Everyone:(I)(RX)

Successfully processed 1 files; Failed processing 0 files

graham@DESKTOP-IAGIISG ~/php-sdk-binary-tools
$ ./phpsdk-vs17-x64.bat
[vcvarsall.bat] Environment initialized for: 'x64'

PHP SDK 2.3.1-dev

OS architecture:    x64 
Build architecture: x64
Visual C++:         14.41.34120.0
PHP-SDK path:       C:\Users\GrahamWharton\php-sdk-binary-tools

C:\Users\GrahamWharton\php-sdk-binary-tools

I can now use the SDK after resetting permissions.

@cmb69
Copy link
Member

cmb69 commented Aug 21, 2024

It never occured to me to want to install the PHP SDK binary tools in a users home directory, but yeah, why not. I wonder whether this permission issue would already happen on Windows 10 (or even older systems), or whether this is a Windows 11 only thing. Is it even a default setting?

Anyway, the only thing we could do is to mark relevant files as executable in the repo. Would that solve the issue for you?

Other than that, we could only document that this may need to be done (or maybe add a respective script which changes the execution permissions, but then again, that script would need to have appropriate permissions in the first place).

@gwharton
Copy link
Author

This is just an annoyance really, raised in haste. If i clone the repo i get permissions errors, but if I download the zip and extract it, everything is fine. I'm gonna close this as its so easy to get around, but maybe having the executable bits set on the batch files may not hurt?????

cmb69 added a commit to cmb69/php-sdk-binary-tools that referenced this issue Aug 21, 2024
We set executable permissions for all starter files.
@cmb69
Copy link
Member

cmb69 commented Aug 21, 2024

[…], but maybe having the executable bits set on the batch files may not hurt?????

No, of course not. Can you please try #24 (that may not be sufficent, but at least a start)?

@cmb69 cmb69 reopened this Aug 21, 2024
@gwharton
Copy link
Author

Your branch helps, I can now run the batch file after a clean clone, but the batch file still errors due to also needing

chmod 755 bin/.exe
chmod 755 bin/
.bat
chmod 755 bin/php/do_php.bat
chmod 755 bin/php/php.exe

Maybe also the msys2 stuff, but I have cygwin installed, so maybe those aren't used on my setup.

If I make all the above changes, the SDK initialises with a single click from explorer on the relevant starter batch file no problems. If you update your branch, I'll test again if you like.

@cmb69
Copy link
Member

cmb69 commented Aug 21, 2024

Thank you for checking.

I've updated the PR now (and included the msys2/usr/bin/*exe files right away).

@cmb69
Copy link
Member

cmb69 commented Aug 21, 2024

[…], but I have cygwin installed, so maybe those aren't used on my setup.

Ah, that could be the reason for the behavior. :)

Anyway, if you have time, please test again.

@gwharton
Copy link
Author

Yep, your latest commit to cmb/perms branch fixes everything for me.

@cmb69 cmb69 closed this as completed in 20d13ba Aug 21, 2024
@cmb69
Copy link
Member

cmb69 commented Aug 21, 2024

Thank you! I have just merged that PR.

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