Skip to content

Conversation

@obbardc
Copy link
Member

@obbardc obbardc commented Jan 7, 2022

If a script doesn't exist or the permissions are wrong, the
recipe exits during execution. Let's check early if the
script exists on the host filesystem and that the file has
executable permission bit set.

@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch from a8a574e to f4d49c5 Compare January 7, 2022 09:09
@sjoerdsimons
Copy link
Member

fwiw this would be a great change to start adding test for

@obbardc obbardc added this to the v1.1.2 milestone Oct 12, 2022
@obbardc obbardc self-assigned this Oct 27, 2022
@obbardc obbardc removed this from the v1.1.2 milestone Jul 26, 2023
@obbardc obbardc changed the title actions/run: Check script exists during recipe verification actions: run: Check script exists during recipe verification Jul 27, 2023
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch 2 times, most recently from 27c3f44 to fb2c1c0 Compare July 27, 2023 12:38
@obbardc obbardc requested a review from sjoerdsimons July 27, 2023 12:38
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch from fb2c1c0 to 8fd0ace Compare July 27, 2023 12:40
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch 2 times, most recently from 8c6a800 to 5fe7313 Compare January 10, 2024 15:18
@obbardc obbardc added this to the v1.1.4 milestone Jan 10, 2024
@sjoerdsimons sjoerdsimons force-pushed the wip/obbardc/fix-run-missing-mount branch from 5fe7313 to f805d84 Compare February 16, 2025 10:50
@obbardc obbardc moved this from Review required to In Progress in Debos&Fakemachine development Aug 8, 2025
@obbardc obbardc moved this from In Progress to Stalled in Debos&Fakemachine development Aug 8, 2025
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch from f805d84 to 28eb2d9 Compare August 10, 2025 16:20
@obbardc obbardc moved this from Stalled to In progress in Debos&Fakemachine development Aug 10, 2025
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch from 28eb2d9 to e7ebbf6 Compare August 11, 2025 16:33
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch 7 times, most recently from 4e077b6 to b943d29 Compare November 30, 2025 22:58
@obbardc obbardc requested a review from sjoerdsimons December 1, 2025 17:31
/* Extract the full script path from the arguments */
args := strings.Split(run.Script, " ")
run.scriptPath = debos.CleanPathAt(args[0], context.RecipeDir)
run.scriptArgs = args[1:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather then doing this in the verifying function and passing it along in the action struct, why not split it out in a function you called in both places?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done i think; commits need cleaning up if you;re happy with logic

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, cleaned up the commits a bit. Hope it;s all good now.

Signed-off-by: Christopher Obbard <[email protected]>
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch from b943d29 to f926a36 Compare December 7, 2025 22:52
If a script doesn't exist or the permissions are wrong, the recipe exits
during the recipe execution. Let's do some early checks in the Verify
stage to ensure the script exists on the host filesystem and a basic check
that the file has executable permission bit set. This check also follows
symlinks.

Signed-off-by: Christopher Obbard <[email protected]>
Add a new test case to verify that run actions with scripts actually
call a script which exists on the filesystem as well as some other
interesting cases, like a script which doesn't exist, symlink scripts
and missing files.

Signed-off-by: Christopher Obbard <[email protected]>
@obbardc obbardc force-pushed the wip/obbardc/fix-run-missing-mount branch from 2090858 to ce1e5fc Compare December 8, 2025 00:50
@obbardc obbardc requested a review from sjoerdsimons December 8, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants