Commit efe2d4e1 authored by boyska's avatar boyska

ref #17533 fix possible overflow

plymouth has stringent limits on message-length. The previous method of trimming the message
was only appropriate for single-line messages. Now it's always valid.

This is important because messages exceeding length would result in no message at all.
parent 82a65c7b
......@@ -31,6 +31,6 @@ ExecStart=/bin/sh -c \
PREFIX="Error starting GDM with your graphics card: " ; \
SUFFIX=". Please take note of this error and visit for troubleshooting." ; \
MAX_VIDEO_CARD_LENGTH=$(($MAX_LENGTH - $(echo -n "$PREFIX$SUFFIX" | wc -c))) ; \
VIDEO_CARD=$(lspci -d::0300 -nn | sed -E "s,.* VGA compatible controller \\[0300\\]:\s*,," | cut -c "1-$MAX_VIDEO_CARD_LENGTH") ; \
VIDEO_CARD=$(lspci -d::0300 -nn | sed -E "s,.* VGA compatible controller \\[0300\\]:\s*,," | head -c "$MAX_VIDEO_CARD_LENGTH") ; \
/bin/plymouth display-message --text="$PREFIX$VIDEO_CARD$SUFFIX" \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment