summaryrefslogtreecommitdiffstats
path: root/term-utils
diff options
context:
space:
mode:
authorJakub Wilk2019-03-07 21:42:09 +0100
committerJakub Wilk2019-03-07 22:11:38 +0100
commitc1b4cf105dacee1452c725d5517c13fd41f712cf (patch)
tree0ae1606dbacd6193656517bddc7fe3da27c7f966 /term-utils
parentsu: add note about ECHO on --pty (diff)
downloadkernel-qcow2-util-linux-c1b4cf105dacee1452c725d5517c13fd41f712cf.tar.gz
kernel-qcow2-util-linux-c1b4cf105dacee1452c725d5517c13fd41f712cf.tar.xz
kernel-qcow2-util-linux-c1b4cf105dacee1452c725d5517c13fd41f712cf.zip
setterm: disallow "default" for --ulcolor/--hbcolor
Passing "default" to --ulcolor or --hbcolor worked, but it set the color to bright red. This was not a documented syntax, so let's forbid it. Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Diffstat (limited to 'term-utils')
-rw-r--r--term-utils/setterm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index bb13eb3c7..a8ccc3864 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -231,7 +231,7 @@ static int parse_ulhb_color(char **av, int *oi)
color = parse_color(color_name);
if (color < 0)
color = strtos32_or_err(color_name, _("argument error"));
- if (!is_valid_color(color))
+ if (!is_valid_color(color) || color == DEFAULT)
errx(EXIT_FAILURE, "%s: %s", _("argument error"), color_name);
if (bright && (color == BLACK || color == GREY))
errx(EXIT_FAILURE, _("argument error: bright %s is not supported"), color_name);