On Tue, 2 Oct 2018, Marcus MERIGHI wrote:
> >Description:
> On this machine an NFS share is mounted at /data/user only while
> backup is running: mount, rsync (as $user!), unmount.
>
> I've received such a message three times and I'm not able to reproduce
> manually.
>
> NFS client fstab(5) of the machine that produces the error message:
> 192.168.168.168:/data/user /data/user nfs \
> rw,nodev,nosuid,noauto,net,soft,intr,-a=4,-r=32768,-w=32768 0 0
>
> NFS server exports(5):
> /data/user -network=192.168.168 -mask=255.255.255.0
>
> It's clear that security(8), running as root, cannot access the NFS
> share. But why does it try? security(8), line 537 adds non-local
> mounts to the list of mount points to skip.
If /data/user was mounted after security(8) had reached line 547 but
before the File::Find::find reached /data in its tree walk, then
/data/user won't be in %skip and it'll get processed resulting in the
errors seen.
The issue should be resolvable by
a) changing the timing of the backup so that it mounts /data/user before
security(8) runs
b) changing the timing of the backup so that it mounts /data/user after
the File::Find::find step is complete, or
c) create/append to your /etc/daily.local:
SUIDSKIP=/data/user
(Catching that warning from File::Find::find() and rechecking the path
involved is _possible_, but since it's already a race condition it's not
worth write a lot a code for this unless it can be made race-proof (IMHO).
Unfortunately, it looks like perl's opendir() doesn't have an fdopendir(3)
variant, so I'm not convinced the race can be completely closed from the
script itself.)
Philip Guenther