]> code.ossystems Code Review - openembedded-core.git/commitdiff
base-files: ignore "mesg n" error messages
authorPatrick Ohly <patrick.ohly@intel.com>
Wed, 12 Jul 2017 08:44:12 +0000 (10:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 17 Jul 2017 12:49:02 +0000 (13:49 +0100)
When using "su - myuser" to change from root to a non-privileged user,
"mesg n" from the default .profile fails with "mesg: error: tty device
is not owned by group `tty' or "mesg: cannot open /dev/ttyS0:
Permission denied", depending on whether mesg comes from busybox or
util-linux.

This does not happen during a normal login because permissions on
/dev/tty* get changed while doing that, something that isn't possible
with plain "su -".

As the error can't be avoided and failures of mesg probably aren't
particularly important, now error messages get dumped to /dev/null.

[YOCTO #11127]

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/base-files/base-files/share/dot.profile

index 979793e8b5a338b1526a9877c3c63269ff49f794..a87316077cd16c25c5a17f07686014c2e8032945 100644 (file)
@@ -7,4 +7,5 @@ fi
 # path set by /etc/profile
 # export PATH
 
-mesg n
+# Might fail after "su - myuser" when /dev/tty* is not writable by "myuser".
+mesg n 2>/dev/null