aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-files
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-07-12 10:44:12 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-17 13:49:02 +0100
commit4511a524f906c97db7c7674ad34e7bc8630649e3 (patch)
treecb0685296d97b6c29f1238041c91db05a5b7c80c /meta/recipes-core/base-files
parent1ad32536c2d4a3e55e698d27d827caee788cb0f7 (diff)
downloadopenembedded-core-contrib-4511a524f906c97db7c7674ad34e7bc8630649e3.tar.gz
base-files: ignore "mesg n" error messages
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>
Diffstat (limited to 'meta/recipes-core/base-files')
-rw-r--r--meta/recipes-core/base-files/base-files/share/dot.profile3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/recipes-core/base-files/base-files/share/dot.profile b/meta/recipes-core/base-files/base-files/share/dot.profile
index 979793e8b5..a87316077c 100644
--- a/meta/recipes-core/base-files/base-files/share/dot.profile
+++ b/meta/recipes-core/base-files/base-files/share/dot.profile
@@ -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