Bug 758457 - findmnt -O doesn't work as expected with 'no' options
Summary: findmnt -O doesn't work as expected with 'no' options
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-29 20:31 UTC by Bill Nottingham
Modified: 2014-03-17 03:29 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-12-01 17:41:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bill Nottingham 2011-11-29 20:31:15 UTC
Description of problem:

$ findmnt -m -O nosuid
TARGET                     SOURCE                FSTYPE        OPTIONS
/proc                      proc                  proc          rw,relatime
/sys                       sysfs                 sysfs         rw,relatime,seclabel
/dev                       devtmpfs              devtmpfs      rw,nosuid,relatime,seclabel,size=3980808k,nr_inodes=995202,mode=755
/dev/pts                   devpts                devpts        rw,relatime,seclabel,gid=5,mode=620,ptmxmode=000
/dev/shm                   tmpfs                 tmpfs         rw,relatime,seclabel
/                          /dev/sda2             ext4          rw,noatime,nodiratime,seclabel,user_xattr,barrier=1,data=ordered
/run                       tmpfs                 tmpfs         rw,nosuid,nodev,relatime,seclabel,mode=755

Most of these filesystems aren't mounted with nosuid.

Similarly with 'noatime'

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

util-linux-2.20.1-2.fc16.x86_64

How reproducible:

100%

Steps to Reproduce:
1. play with findmnt

Comment 1 Karel Zak 2011-12-01 17:41:02 UTC
The "no" is interpreted as prefix, so the command returns all entries where is not "suid" option. This is expected behaviour...

Anyway, I have improved the pattern evaluation and now you can use "+" prefix to disable "no" prefix interpretation -- it means that "+noauto" will return entries where is *literally* "noauto" option:

$ findmnt --fstab -O "+noauto"
TARGET      SOURCE                   FSTYPE OPTIONS
/mnt/store  sr.net.home:/mnt/store   nfs    noauto
/mnt/loop   /home/fs-images/ext2.img auto   defaults,noauto

This change will available in the next upstream release (and F17).


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