MOTD "safe_print" prints control characters

Bug #1857733 reported by Victor Engmark
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
New
Wishlist
Unassigned

Bug Description

/etc/update-motd.d/50-motd-news contains a function called "safe_print". Its documentation says it does not print control characters, but this is false. If you look at the `tr` command it prints \012 (Device Control 2 aka. DC2 aka. ␒) and \015 (Negative Acknowledge aka. NAK aka. ␕) from the source. I don't know why it would do that, or whether it could possibly be a security issue, especially since it makes the code more complex than it should be (`tr -d '\000-\011\013\014\016-\037'` vs `tr -d '\000-\037'`). A quick `/etc/update-motd.d/50-motd-news --force | grep $'\x12\|\x15'` returned exit code 1, so it's not part of the current MOTD.

Revision history for this message
Victor Engmark (victor-engmark) wrote :

Correction: That's of course *octal* 012 and 015, aka. Line Feed and Carriage Return. That should probably be explicit in the documentation.

Steve Langasek (vorlon)
Changed in base-files (Ubuntu):
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.