RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1906157 - 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 ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: util-linux
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks: 2053536
TreeView+ depends on / blocked
 
Reported: 2020-12-09 18:59 UTC by Michele Casaburo
Modified: 2024-12-20 19:27 UTC (History)
8 users (show)

Fixed In Version: util-linux-2.32.1-28.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2053536 (view as bug list)
Environment:
Last Closed: 2021-11-09 20:02:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 6471561 0 None None None 2022-03-05 06:12:02 UTC
Red Hat Product Errata RHBA-2021:4490 0 None None None 2021-11-09 20:02:28 UTC

Internal Links: 2036583

Description Michele Casaburo 2020-12-09 18:59:49 UTC
Description of problem:

After "su" from root to a normal user mesg is unable to retrieve current permissions as it cannot open the pty

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. clean RHEL 8.3 install
2. login as root
3. create a normal user
# useradd -m testuser
3. su to the user
# su testuser
4. run mesg
$ mesg

Actual results:
$ mesg
mesg: cannot open /dev/pts/0: Permission denied

Expected results:
$ mesg
is y

Additional info:

Comment 2 Karel Zak 2021-02-23 09:10:43 UTC
Sure, this is expected behavior. su(1) changes the user and group ID, but it still uses the original terminal with the original permissions.

Since v2.31 su(1) provides a new command-line option --pty to create a pseudo-terminal for the session, but it does not change permissions for the pty device. It seems like a disadvantage that I can fix in the upstream tree. 

Anyway, won't fix for RHEL8.

Comment 4 Karel Zak 2021-04-12 08:04:54 UTC
I have investigated the problem more closely and it seems we can fix it :-)

I thought the problem is only the relation between terminal and mesg(1) permissions, but the issue is that the new mesg(1) always tries to open the terminal device. It seems unnecessary. All we need is to call stat(2) in this case.

Sorry for the previous CLOSE/UPSTREAM, reopening.

Fixed also in the upstream tree by commit https://github.com/karelzak/util-linux/commit/c0246ce059503bbc078122a50d564ca36a66f348

Comment 15 errata-xmlrpc 2021-11-09 20:02:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (util-linux bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4490

Comment 18 Karel Zak 2022-02-15 09:16:03 UTC
Please, see my answer for bug #2053536.

Comment 19 kginon 2024-06-18 11:29:50 UTC
hi 
please notice i can still see this annoying message on rhel8.8
[root@bvt-centralsite-centralsitemanager-2 ncs-administrator (Backup)]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.8 (Ootpa)


[root@bvt-centralsite-centralsitemanager-2 ncs-administrator (Backup)]# su - cbis-admin
Last login: Tue Jun 18 11:27:18 UTC 2024 on pts/1
mesg: cannot open /dev/pts/1: Permission denied


[root@bvt-centralsite-centralsitemanager-2 ncs-administrator (Backup)]# rpm -qf /bin/mesg
util-linux-2.32.1-42.el8_8.1.x86_64


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