Bug 2053536 - after su from root to a normal user mesg is unable to show current status
Summary: after su from root to a normal user mesg is unable to show current status
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: util-linux
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
: 2036583 (view as bug list)
Depends On: 1906157
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-11 13:33 UTC by Vinay Mishra
Modified: 2023-08-10 09:32 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1906157
Environment:
Last Closed: 2023-08-10 09:32:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-112034 0 None None None 2022-02-11 13:43:08 UTC
Red Hat Knowledge Base (Solution) 6471561 0 None None None 2022-03-05 06:16:54 UTC

Comment 3 Karel Zak 2022-02-15 09:15:23 UTC
> sudo su - svc-mongo
> Last login: Fri Jan 28 16:04:57 CST 2022 on pts/0
> mesg: cannot open /dev/pts/1: Permission denied

I guess there is "mesg y" (or "mesg n") in the user's profile file. 

The bugfix in rhel-8.5 has fixed "mesg" (without any option). If you call "mesg y|n" then it needs to open and modify the terminal setting, but the terminal is still owned by the root user. This is impossible to fix.

Example:

 # su - kzak
 Last login: Tue Feb 15 03:50:00 EST 2022 on pts/0

 $ mesg
 is y

 $ mesg y
 mesg: cannot open /dev/pts/0: Permission denied

 $ rpm -qf /bin/mesg
 util-linux-2.32.1-32.el8.x86_64


This is expected behavior.


Note that since util-linux v2.7 (RHEL-9) it will be possible to use "su --pty" to create a new terminal owned by the user.

Comment 4 Karel Zak 2022-02-15 09:18:06 UTC
Sorry for typo -- s/since util-linux v2.7/since util-linux v2.37/

Comment 9 Karel Zak 2022-07-12 10:32:30 UTC
*** Bug 2036583 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.