On Monday, 04/17/2017 at 03:14 GMT, Grzegorz Powiedziuk 
<gpowiedz...@gmail.com> wrote:
> I am having a really weird issue on one of the z redhat systems. 
Probably
> it doesn't have anything to do with Z but we have some great minds here 
so
> perhaps someone will help me
>
> the "df -h" or "df -P"  command doesn't work when run as a normal user.
> "df" on it's own works fine.
>
> Error:
> df: cannot read table of mounted file systems: Permission denied
>
> Now, here is when it gets really strange. Above suggests wrong 
permissions
> on /etc/mtab which are fine:
> [root@it069qz5ora lib64]# ls -la /etc/mtab
> -rw-r--r-- 1 root root 2024 Apr 17 10:44 /etc/mtab
>
> But the "df -h" is trying to open that file with WRITE access mode !!!
> strace df -h 2>&1 |grep open  | grep mtab
> ...
> open("/etc/mtab", O*_RDWR*|O_CLOEXEC)     = -1 EACCES (Permission 
denied)
>
> On all other systems"df -h" opens that mtab file in O_RDONLY. Why this 
one
> is different?
>
> And as I said, regular "df" works fine and it usies O_RDONLY flag.
>
> So the problem happens only with "df -h" or "df -P" . That doesn't make 
any
> sense to me.
>
> Has anyone seen anything like that?

Weird.  The read_file_system_list() routine in mountlist.c (called by 
df.c) code shows a hard-coded "r" option in the fopen(), and I don't see 
df calling some other "mount list" function because of -h or -P.

Alan Altmark

Senior Managing z/VM and Linux Consultant
Lab Services System z Delivery Practice
IBM Systems & Technology Group
ibm.com/systems/services/labservices
office: 607.429.3323
mobile; 607.321.7556
alan_altm...@us.ibm.com
IBM Endicott

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to