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

Executable files in a PDK template do not end up as executable in the module #1224

Closed
chelnak opened this issue Mar 13, 2023 · 4 comments
Closed
Labels
bug needs-triage Newly created issue that has not been reviewed by a PDK contributor

Comments

@chelnak
Copy link
Contributor

chelnak commented Mar 13, 2023

Issue moved from PDK-1803

The Problem

I have a PDK template where the moduleroot/ has a folder with scripts that are marked executable.

~/src/pdk-template$  ls -l moduleroot/ci_scripts
total 8
-rwxr-xr-x@ 1 nate  nate  287 Mar 10 15:34 validate_things.sh

When I build a module based on this PDK template, the validate_things.sh script does not get created as executable.
Also when updating a module based on this template, the script remains not executable.

What is expected

A file that's executable in a PDK template (either in moduleroot or moduleroot_init) should be created/updated by the PDK as executable in the module.

What actually happens

Executable files are created without the execute bit set, making them non-executable.
This also happens when pdk update'ing a module.

@chelnak chelnak added bug needs-triage Newly created issue that has not been reviewed by a PDK contributor labels Mar 13, 2023
@natemccurdy
Copy link
Contributor

Reproduction

Here’s a reproduction case. It’s a new PDK module based on a fork of PDK templates that includes an executable file:

~ $ pdk new module --template-url=https://github.com/natemccurdy/pdk-templates --template-ref=PDK-1803/reproduction

...(snip interview dialog)...

~ $ cd test                                     
~/test $ ls -l validate_things.sh               
.rw-r--r-- 218 nate 15 Mar 13:50 validate_things.sh

~/src/test $ bash validate_things.sh
validate_things.sh is NOT executable

@ghoneycutt
Copy link

+1 on fixing this as it makes development harder since templated scripts cannot just be executed locally and work arounds for CI/CD have to be put in place.

@chelnak
Copy link
Contributor Author

chelnak commented Mar 17, 2023

Hey! With tasks in the pipeline for puppet 8 readiness I don't think I'll personally have time to work on this.

However! This is open source! So if anyone wants to contribute towards this feature I'm happy to assist.

My only concern here is shipping around executable files could be seen as a security risk by some.. so we would need to cover that.

@jordanbreen28
Copy link
Contributor

jordanbreen28 commented Jan 25, 2024

see
#1289
puppetlabs/pdk-templates#539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Newly created issue that has not been reviewed by a PDK contributor
Projects
None yet
Development

No branches or pull requests

4 participants