mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
Check whether the argument of the `--background` option of `systemd-run`, `run0`, `systemd-nspawn`, `systemd-vmspawn`, and `systemd-pty-forward` is either empty or looks like an ANSI color code, and reject invalid values when parsing arguments. We consider a string to look like an ANSI color code if it consists of one or more sequences of ASCII digits separated by semicolons. This permits every valid ANSI color code, and should reject anything that results in garbled output.
13 lines
591 B
C
13 lines
591 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include "shared-forward.h"
|
|
|
|
int parse_boolean_argument(const char *optname, const char *s, bool *ret);
|
|
int parse_tristate_argument(const char *optname, const char *s, int *ret);
|
|
int parse_json_argument(const char *s, sd_json_format_flags_t *ret);
|
|
int parse_path_argument(const char *path, bool suppress_root, char **arg);
|
|
int parse_signal_argument(const char *s, int *ret);
|
|
int parse_machine_argument(const char *s, const char **ret_host, BusTransport *ret_transport);
|
|
int parse_background_argument(const char *s, char **arg);
|