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 814427 - Unexpected /sbin/securetty failure with read-only root file system
Summary: Unexpected /sbin/securetty failure with read-only root file system
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.2
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-19 20:38 UTC by Rick Mohr
Modified: 2016-11-25 13:05 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Securetty always tries to open file /etc/securetty read/write mode Consequence: On readonly root filesystem this leads to failure even if the tty already exists, thus file won't be changed Fix: Check if the file really needs to be edited, if not, just exit correctly. Result: Securetty should now work correctly with readonly root.
Clone Of:
Environment:
Last Closed: 2013-11-21 22:09:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
lightly tested patch (1.65 KB, patch)
2012-04-19 21:05 UTC, Bill Nottingham
no flags Details | Diff
better patch (2.93 KB, patch)
2012-04-19 21:09 UTC, Bill Nottingham
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1679 0 normal SHIPPED_LIVE initscripts bug fix and enhancement update 2013-11-20 21:52:39 UTC

Description Rick Mohr 2012-04-19 20:38:59 UTC
Description of problem:

During startup, a host with a read-only NFS root file system triggers /etc/init/serial.conf which attempts to run "/sbin/securetty ttyS0".  Even though "ttyS0" already exists in the /etc/securetty file, the command fails with the following error:

securetty: Couldn't open /etc/securetty: Permission denied

The permissions are correct, and the root user can successfully run "cat /etc/securetty".


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

initscripts-9.03.27-1.el6

How reproducible:
Always

Steps to Reproduce:
1. Boot system with read-only root file system
2. Run "/sbin/securetty $DEV" where $DEV is a device name that already exists in /etc/securetty.
  
Actual results:

Command failure (rc=1)

Expected results:

Command should succeed. Because the device already exists in /etc/securetty, the file does not need to be modified.

Additional info:

Looking at the source code, it appears that /sbin/securetty attempts to open /etc/securetty in read-write mode before even checking if the file needs to be modified.  If the root file system is mounted read-only, the results in a failure.  A better approach would be to check if the file needs to be modified, and if not, exit with rc=0.

Comment 2 Bill Nottingham 2012-04-19 21:05:17 UTC
Created attachment 578786 [details]
lightly tested patch

Here's a lightly tested patch to do just that.

Comment 3 Bill Nottingham 2012-04-19 21:09:45 UTC
Created attachment 578789 [details]
better patch

And a better one that removes the now-obsolete check in rewrite_securetty.

Comment 5 RHEL Program Management 2012-07-10 08:35:54 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2012-07-10 23:25:59 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 14 David Mansfield 2013-09-10 20:08:59 UTC
this never made 6.4 as far as I can tell. I have the exact same problem.

Comment 15 Lukáš Nykrýn 2013-09-11 06:26:47 UTC
No, this will be fixed in 6.5.

Comment 17 errata-xmlrpc 2013-11-21 22:09:51 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2013-1679.html


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