Bug 520630 - df -l <device> as regular user cause "Permission denied"
Summary: df -l <device> as regular user cause "Permission denied"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: coreutils
Version: 5.4
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 521106 521206 (view as bug list)
Depends On:
Blocks: 499522 528641 707606
TreeView+ depends on / blocked
 
Reported: 2009-09-01 14:11 UTC by Olivier Fourdan
Modified: 2018-11-14 20:29 UTC (History)
12 users (show)

Fixed In Version: coreutils-5.97-24.el5
Doc Type: Bug Fix
Doc Text:
Due to a regression, running the "df -l" command with a specific device specified resulted in a "Permission denied" error message for regular users. This bug has been fixed and specifying a device now works for regular users. Note that running the "df -l" command to list all devices was not affected by this bug; it worked as expected previously and continues to do so subsequent to this update.
Clone Of:
Environment:
Last Closed: 2011-07-21 10:34:06 UTC


Attachments (Terms of Use)
Proposed patch (1.29 KB, patch)
2009-09-01 14:11 UTC, Olivier Fourdan
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1074 normal SHIPPED_LIVE coreutils bug fix and enhancement update 2011-07-21 10:33:32 UTC

Description Olivier Fourdan 2009-09-01 14:11:17 UTC
Created attachment 359401 [details]
Proposed patch

Description of problem:

The patch for bug #497830 breaks "df -l" for regular users whena device is specified, causing a "Permission denied" error whereas "df -l" lists all the devices correctly.

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

coreutils-5.97-23

How reproducible:

100% reprodicbile 

Steps to Reproduce:
1. Log-in a a regular user
2. Run "df -l" to list all devices:

  $ df -l
  Filesystem           1K-blocks      Used Available Use% Mounted on
  /dev/mapper/VolGroup00-LogVol00
                         6983168   4864476   1758244  74% /
  /dev/hda1               101086     12436     83431  13% /boot
  tmpfs                   255028         0    255028   0% /dev/shm

3. Pick one device and retry:

  $ df -l /dev/hda1

Actual results:

  df: `/dev/hda1': Permission denied

Expected results:

  /dev/hda1               101086     12436     83431  13% /boot

Additional info:

The problem comes from the patch to fix bug #497830 (which is also upstream at least in the latest coreutils-7.5)

open() on the device will fail as a regular user and df will stop with the "Permission denied" error.

The attached patch tries that open()/fstat() method but will fallback to the previous stat() method if open()/fstat() failed.

Comment 2 Ondrej Vasik 2009-09-01 14:51:33 UTC
Thanks for report and patch, adding upstream maintainer to CC as the problem exists upstream.

Comment 4 Ondrej Vasik 2009-09-03 18:47:09 UTC
*** Bug 521106 has been marked as a duplicate of this bug. ***

Comment 5 Tim Mooney 2009-09-03 19:26:04 UTC
Funny that the search I did before I created Bug 521106 didn't turn up this report.

The system monitoring package we currently use (HP SiteScope) relies on being able to run df /dev/path/here to monitor free space on individual volumes.  Because of this regression, disk monitoring is currently not working for any of our RHEL 5.4 boxes.  We're therefore very interested in what the timeline is for seeing a fix for this released into the channel.

Comment 6 Ondrej Vasik 2009-09-04 06:31:01 UTC
As package maintainer I can't guarantee any timeline - but coreutils is common component of almost every regular update. So this will LIKELY be fixed for 5.5 as the patch is available and solves the issue. You could check other possibilities with product support (as bugzilla is not product support for Red Hat Enterprise Linux).

Comment 7 Baptiste Mille-Mathias 2009-09-07 12:46:48 UTC
Funnily I am in the same situation than Tim, I'm running the same monitoring tool and have the same issue with 5.4. I'm stuck now until a fix is released.

Comment 8 Baptiste Mille-Mathias 2009-09-07 12:47:47 UTC
*** Bug 521206 has been marked as a duplicate of this bug. ***

Comment 12 Colin.Simpson 2009-09-17 14:04:48 UTC
We have the same issue with Sitescope and RH5.4. This should be urgent as it's a regression.

Comment 18 Ondrej Vasik 2009-10-12 13:05:57 UTC
Fix commited to CVS -> MODIFIED

Comment 24 Colin.Simpson 2010-07-09 13:42:06 UTC
Should this not be closed as the patch has long been released.

Comment 25 Ondrej Vasik 2010-07-09 14:04:24 UTC
No, it should stay opened until regular RHEL-5 coreutils update will be released.

Comment 28 Ondrej Vasik 2011-03-31 13:59:13 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The coreutils update included with Red Hat Enterprise Linux 5.4 introduced a regression in the df command. Running "df -l" with a specific device specified (for example, "df -l /dev/hda1") resulted in a "Permission denied" message for regular users. This update corrects the regression: specifying a device now works for regular users as it did previously. Note: running "df -l" to list all devices was not affected by this bug: it worked as expected previously and continues to do so subsequent to this update.

Comment 31 Tomas Capek 2011-07-13 12:12:11 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1,3 @@
-The coreutils update included with Red Hat Enterprise Linux 5.4 introduced a regression in the df command. Running "df -l" with a specific device specified (for example, "df -l /dev/hda1") resulted in a "Permission denied" message for regular users. This update corrects the regression: specifying a device now works for regular users as it did previously. Note: running "df -l" to list all devices was not affected by this bug: it worked as expected previously and continues to do so subsequent to this update.+Due to a regression, running the "df -l" command with a specific device specified resulted in a "Permission denied" error message for regular users. This bug has been fixed and specifying a device now works for regular users.
+
+Note that running the "df -l" command to list all devices was not affected by this bug; it worked as expected previously and continues to do so subsequent to this update.

Comment 32 errata-xmlrpc 2011-07-21 10:34:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1074.html

Comment 33 errata-xmlrpc 2011-07-21 12:10:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1074.html


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