1
0
mirror of https://github.com/systemd/systemd synced 2026-04-26 17:04:50 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Lennart Poettering
a8796773b0 update TODO 2022-05-05 10:55:18 +02:00
Sonali Srivastava
a5efbf468c terminal-util: get_color_mode checks COLORTERM 2022-05-05 09:18:51 +02:00
3 changed files with 27 additions and 10 deletions

21
TODO
View File

@ -79,6 +79,21 @@ Janitorial Clean-ups:
Features: Features:
* tmpfiles: for f/F/w lines, if the argument columns is left unspecified, look
for a service credential named after the file path to write to, and load
contents to write from there. Usecase: provision arbitrary files from
credentials. Example use: with a line like "f /root/.ssh/authorized-keys
0644 root root" in a tmpfiles.d/ snippet add
LoadCredential=root.ssh.authorized-keys via drop-in to
systemd-tmpfiles.service, and then provision an SSH access key through
nspawn's --load-credential=, through qemu's fw_cfg, or via systemd-stub's
credntial pick-up. The latter is particularly interesting to implement SSH
access to an initrd.
* systemd-homed: when initializing, look for a credential sysemd.homed.register
or so with JSON user records to automatically register if not registered yet.
Usecase: deploy a system, and add an account one can directly log into.
* add a proper concept of a "developer" mode, i.e. where cryptographic * add a proper concept of a "developer" mode, i.e. where cryptographic
protections of the root OS are weakened after interactive confirmation, to protections of the root OS are weakened after interactive confirmation, to
allow hackers to allow their own stuff. idea: allow entering developer mode allow hackers to allow their own stuff. idea: allow entering developer mode
@ -174,9 +189,6 @@ Features:
the sigqueue() data parameter. With that we extended with minimal logic the the sigqueue() data parameter. With that we extended with minimal logic the
service runtime logic quite substantially. service runtime logic quite substantially.
* get_color_mode() should probably check the $COLORTERM environment variable
which most terminal environments appear to set.
* firstboot: maybe just default to C.UTF-8 locale if nothing is set, so that we * firstboot: maybe just default to C.UTF-8 locale if nothing is set, so that we
don't query this unnecessarily in entirely uninitialized don't query this unnecessarily in entirely uninitialized
containers. (i.e. containers with empty /etc). containers. (i.e. containers with empty /etc).
@ -788,9 +800,6 @@ Features:
* Move RestrictAddressFamily= to the new cgroup create socket * Move RestrictAddressFamily= to the new cgroup create socket
* support the bind/connect/sendmsg cgroup stuff for sandboxing, and possibly
patching around
* maybe implicitly attach monotonic+realtime timestamps to outgoing messages in * maybe implicitly attach monotonic+realtime timestamps to outgoing messages in
log.c and sd-journal-send log.c and sd-journal-send

View File

@ -1278,6 +1278,11 @@ ColorMode get_color_mode(void) {
/* We only check for the presence of the variable; value is ignored. */ /* We only check for the presence of the variable; value is ignored. */
cached_color_mode = COLOR_OFF; cached_color_mode = COLOR_OFF;
else if (STRPTR_IN_SET(getenv("COLORTERM"),
"truecolor",
"24bit"))
cached_color_mode = COLOR_24BIT;
else if (getpid_cached() == 1) else if (getpid_cached() == 1)
/* PID1 outputs to the console without holding it open all the time. /* PID1 outputs to the console without holding it open all the time.
* *

View File

@ -100,16 +100,19 @@ typedef enum AcquireTerminalFlags {
/* Limits the use of ANSI colors to a subset. */ /* Limits the use of ANSI colors to a subset. */
typedef enum ColorMode { typedef enum ColorMode {
/* No colors, monochrome output. */ /* No colors, monochrome output. */
COLOR_OFF = 0, COLOR_OFF,
/* All colors, no restrictions. */ /* All colors, no restrictions. */
COLOR_ON = 1, COLOR_ON,
/* Only the base 16 colors. */ /* Only the base 16 colors. */
COLOR_16 = 16, COLOR_16,
/* Only 256 colors. */ /* Only 256 colors. */
COLOR_256 = 256, COLOR_256,
/* For truecolor or 24bit color support.*/
COLOR_24BIT,
_COLOR_INVALID = -EINVAL, _COLOR_INVALID = -EINVAL,
} ColorMode; } ColorMode;