Skip to content

Conversation

@navi-desu
Copy link
Member

No description provided.

Comment on lines -68 to +69
if [ -z "$1" -o -z "$2" ]; then
eerror "$RC_SVCNAME: not enough arguments"
if [ $# != 2 ]; then
eerror "$RC_SVCNAME: invalid arguments"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the same since "" "" will count as 2 arguments and will pass this test. But -z would've detect them to be empty.

Copy link
Member Author

@navi-desu navi-desu May 27, 2025

Choose a reason for hiding this comment

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

for $2, it'd be handled bellow as an invalid function, passing "" shouldn't be handled differently than "foonyamew" when such command doesn't exist, imo

for $1, openrc-run.c already bails out if it's not a file path to a file with the exec bit set

Copy link
Member Author

Choose a reason for hiding this comment

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

tbh this whole check is kindof meh, considering the preconditions for our internal script to be executed, i think

openrc-ruh.sh is only ever called from openrc-run.c, with a single
command, so looping over "$@" is unnecessary
svc_exec is always called with `command, NULL`, the second argument is
never actually used.
@navi-desu navi-desu merged commit 843dc4a into master Aug 28, 2025
10 checks passed
@navi-desu navi-desu deleted the openrc-run-fixes branch August 28, 2025 19:57
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

Successfully merging this pull request may close these issues.

3 participants