1
0
mirror of https://github.com/systemd/systemd.git synced 2025-09-07 09:44:44 +03:00

udev: allow to execute longer command line

Fixes #23607.
This commit is contained in:
Yu Watanabe
2022-06-24 13:49:15 +09:00
parent f3bd663faf
commit c3613ee51e

View File

@@ -1717,7 +1717,7 @@ static int udev_rule_apply_token_to_event(
return token->op == (match ? OP_MATCH : OP_NOMATCH);
}
case TK_M_PROGRAM: {
char buf[UDEV_PATH_SIZE], result[UDEV_LINE_SIZE];
char buf[UDEV_LINE_SIZE], result[UDEV_LINE_SIZE];
bool truncated;
size_t count;
@@ -1805,7 +1805,7 @@ static int udev_rule_apply_token_to_event(
}
case TK_M_IMPORT_PROGRAM: {
_cleanup_strv_free_ char **lines = NULL;
char buf[UDEV_PATH_SIZE], result[UDEV_LINE_SIZE];
char buf[UDEV_LINE_SIZE], result[UDEV_LINE_SIZE];
bool truncated;
(void) udev_event_apply_format(event, token->value, buf, sizeof(buf), false, &truncated);
@@ -1873,7 +1873,7 @@ static int udev_rule_apply_token_to_event(
UdevBuiltinCommand cmd = PTR_TO_UDEV_BUILTIN_CMD(token->data);
assert(cmd >= 0 && cmd < _UDEV_BUILTIN_MAX);
unsigned mask = 1U << (int) cmd;
char buf[UDEV_PATH_SIZE];
char buf[UDEV_LINE_SIZE];
bool truncated;
if (udev_builtin_run_once(cmd)) {
@@ -2369,7 +2369,7 @@ static int udev_rule_apply_token_to_event(
case TK_A_RUN_BUILTIN:
case TK_A_RUN_PROGRAM: {
_cleanup_free_ char *cmd = NULL;
char buf[UDEV_PATH_SIZE];
char buf[UDEV_LINE_SIZE];
bool truncated;
if (event->run_final)