I have a script that runs the command
mount -v 2>/some/file, which I then parse with another script using the following regex:
^.*[\ \t]+type[\ \t]+nfs(?![\ \t]+.*\b(?:nosuid|nosetuid)\b).*
The problem I am having is this: there are a few NFS mounts that have waivers excluding them from being mounted with
nosuid (they're Solaris 11 IPS repositories). Now I need to modify my regex to exclude a known mount...
To provide a point of reference, here's some sample output from
$ mount -v /dev/dsk/c1t0d0s0 on / type ufs read/write/setuid/devices/rstchown/intr/largefiles/logging/xattr/onerror=panic/dev=840000 on Fri Sep 6 12:10:35 2013 /devices on /devices type devfs read/write/setuid/devices/rstchown/dev=4c00000 on Fri Sep 6 12:10:25 2013 ctfs on /system/contract type ctfs read/write/setuid/devices/rstchown/dev=4c80001 on Fri Sep 6 12:10:25 2013 proc on /proc type proc read/write/setuid/devices/rstchown/dev=4c40000 on Fri Sep 6 12:10:25 2013 mnttab on /etc/mnttab type mntfs read/write/setuid/devices/rstchown/dev=4cc0001 on Fri Sep 6 12:10:25 2013 swap on /etc/svc/volatile type tmpfs read/write/setuid/devices/rstchown/xattr/dev=4d00001 on Fri Sep 6 12:10:25 2013 objfs on /system/object type objfs read/write/setuid/devices/rstchown/dev=4d40001 on Fri Sep 6 12:10:25 2013 sharefs on /etc/dfs/sharetab type sharefs read/write/setuid/devices/rstchown/dev=4d80001 on Fri Sep 6 12:10:25 2013 /usr/lib/libc/libc_hwcap1.so.1 on /lib/libc.so.1 type lofs read/write/setuid/devices/rstchown/dev=840000 on Fri Sep 6 12:10:31 2013 fd on /dev/fd type fd read/write/setuid/devices/rstchown/dev=4f00001 on Fri Sep 6 12:10:35 2013 swap on /tmp type tmpfs read/write/setuid/devices/rstchown/xattr/dev=4d00002 on Fri Sep 6 12:10:38 2013 swap on /var/run type tmpfs read/write/setuid/devices/rstchown/xattr/dev=4d00003 on Fri Sep 6 12:10:38 2013 /dev/dsk/c1t0d0s7 on /export/home type ufs read/write/setuid/devices/rstchown/intr/largefiles/logging/xattr/onerror=panic/dev=840007 on Fri Sep 6 12:10:44 2013 sample-ips:/ips/blargSolaris11.1 on /blargSolaris11.1 type nfs remote/read/write/setuid/devices/rstchown/soft/xattr/dev=8c00001 on Tue Sep 10 12:07:46 2013
I had tried modifying the regex to exclude the IP's mount based on matching the mount at the beginning of the line like this:
^(.*|[^sample])[\ \t]+type[\ \t]+nfs(?![\ \t]+.*\b(?:nosuid|nosetuid)\b).*
But it's not working...