df -h permission denied error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lightdm (Ubuntu) |
Invalid
|
Medium
|
Unassigned |
Bug Description
Running "df -h" from the cli as a normal user returns:
Filesystem Size Used Avail Use% Mounted on
/dev/md0 37G 6.6G 29G 19% /
udev 796M 8.0K 796M 1% /dev
tmpfs 322M 888K 321M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 805M 92K 805M 1% /run/shm
/dev/sda3 1.8T 265G 1.6T 15% /mnt/d1
/dev/sdb3 1.8T 1.7T 102G 95% /mnt/d2
/dev/sdc3 893G 33M 893G 1% /mnt/d3
df: `/var/lib/
$
running with "su"
$ sudo df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md0 37G 6.6G 29G 19% /
udev 796M 8.0K 796M 1% /dev
tmpfs 322M 888K 321M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 805M 92K 805M 1% /run/shm
/dev/sda3 1.8T 265G 1.6T 15% /mnt/d1
/dev/sdb3 1.8T 1.7T 102G 95% /mnt/d2
/dev/sdc3 893G 33M 893G 1% /mnt/d3
$
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: bash 4.2-0ubuntu4
ProcVersionSign
Uname: Linux 3.0.0-10-server x86_64
ApportVersion: 1.23-0ubuntu2
Architecture: amd64
Date: Tue Oct 4 14:17:28 2011
InstallationMedia: Ubuntu-Server 11.04 "Natty Narwhal" - Release amd64 (20110426)
ProcEnviron:
SHELL=/bin/bash
LANG=en_US.UTF-8
SourcePackage: bash
UpgradeStatus: Upgraded to oneiric on 2011-09-05 (29 days ago)
Changed in lightdm (Ubuntu): | |
status: | Opinion → Fix Released |
This is how Unix systems are supposed to behave. The ~lightdm/.gvfs filesystem is a private FUSE-mounted filesystem that belongs to the lightdm user, so a normal user shouldn't be able to access it. The same thing would happen if you had a GVFS filesystem open as yourself and another user (who was were logged in to the machine via ssh of via the switch-user feature) ran df -h.
I certainly see why this text being dumped to stderr on a common command like df -h feels like an error, though.
This behavior runs deep into the design of the Linux (and all Unix) kernel, but I'd be interested in any ideas you have about how to modify the behavior to be more suitable.