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 842040 - df -P gives new lines when where '\n' is in any of the /proc/mounts fields.
Summary: df -P gives new lines when where '\n' is in any of the /proc/mounts fields.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils
Version: 6.2
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-21 07:40 UTC by Antony Peter
Modified: 2018-12-04 14:42 UTC (History)
10 users (show)

Fixed In Version: coreutils-8.4-28.el6
Doc Type: Bug Fix
Doc Text:
Cause: Command df interpreted control characters in the output mount point name. Consequence: It's awkward to read and problematic for scripts when control characters like '\n' are output. Fix: Problematic characters are hidden/replaced by "?" Result: Output with problematic characters is no longer hard to read.
Clone Of:
Environment:
Last Closed: 2013-11-21 20:58:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1652 0 normal SHIPPED_LIVE Low: coreutils security, bug fix, and enhancement update 2013-11-20 21:53:21 UTC

Description Antony Peter 2012-07-21 07:40:05 UTC
Description of problem:
df -P" file system information is not "always printed on exactly one line"

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

RHEL 6.2 

How reproducible:

Easily reproducible

[root@dhcp233-121 ~]# mount -o loop cd.iso '/media/Volume
> Identifier'/
[root@dhcp233-121 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      6.5G  3.2G  3.0G  52% /
tmpfs                 246M     0  246M   0% /dev/shm
/dev/vda1             485M   45M  415M  10% /boot
/root/cd.iso          348K  348K     0 100% /media/Volume
Identifier
[root@dhcp233-121 ~]# df -P
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/mapper/VolGroup-lv_root   6748936   3290120   3115984      52% /
tmpfs                   251360         0    251360       0% /dev/shm
/dev/vda1               495844     45755    424489      10% /boot
/root/cd.iso               348       348         0     100% /media/Volume
Identifier
[root@dhcp233-121 ~]#

Steps to Reproduce:

1.Press enter between "Volume" and "Identifier" so it looks like this:
$ genisoimage -V 'Volume
 Identifier' -o cd.iso /test1/ 

 2. Either burn to a disk and let nautilus mount it, or for manual mounting the mount point should include a newline.  If you want to mount it manually, do this, putting a newline between "Volume" and "Identifier":

# mkdir '/media/Volume
Identifier'
# mount -o loop cd.iso '/media/Volume
Identifier'/


3)df -h

  
Actual results:

It prints the information about the file system on two lines:
/dev/sr0   348   348  0 100% /media/Volume
Identifier


[root@dhcp233-121 ~]# df -P
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/mapper/VolGroup-lv_root   6748936   3290120   3115984      52% /
tmpfs                   251360         0    251360       0% /dev/shm
/dev/vda1               495844     45755    424489      10% /boot
/root/cd.iso               348       348         0     100% /media/Volume  Identifier
[root@dhcp233-121 ~]#
Expected results:

The manual says about -P: "The information about each file system is always printed on exactly one line"


[root@dhcp233-121 ~]# df -P
Filesystem         1024-blocks      Used Available Capacity Mounted on
/dev/mapper/VolGroup-lv_root   6748936   3290120   3115984      52% /
tmpfs                   251360         0    251360       0% /dev/shm
/dev/vda1               495844     45755    424489      10% /boot
/root/cd.iso               348       348         0     100% /media/Volume Identifier
[root@dhcp233-121 ~]#

Additional info:


This is now handled upstream with:
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=3ed70fd5

Comment 5 Pádraig Brady 2012-07-30 11:24:36 UTC
A clarification comment. /etc/mtab contains \012
but glibc will convert the \012 back to \n before sending to df.
So the patch is needed to stop df outputting erroneous new lines.

Comment 6 Kamil Dudka 2012-07-30 11:49:35 UTC
(In reply to comment #5)
> So the patch is needed to stop df outputting erroneous new lines.

You mean a patch to escape special chars back to octal notation?

Comment 7 Pádraig Brady 2012-07-30 22:54:25 UTC
Sorry. The upstream patch is needed
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=3ed70fd5

That will convert control chars to to '?'
As a side effect it will keep df from outputting \n
df will not get octal escapes due to the processing done by glibc
df will not output octal escapes for backwards compatibility reasons

Comment 8 Kamil Dudka 2012-07-31 06:56:57 UTC
Oops, I somehow overlooked the link in comment #0.  That should do the job.  Thanks!

Comment 12 RHEL Program Management 2012-09-07 05:08:46 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 27 errata-xmlrpc 2013-11-21 20:58:36 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/RHSA-2013-1652.html


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