Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jan 2023 02:35:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 269213] /etc/rc.d/cleanvar interaction with samba fdescfs mount causes file deletions outside of /var/run
Message-ID:  <bug-269213-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269213

            Bug ID: 269213
           Summary: /etc/rc.d/cleanvar interaction with samba fdescfs
                    mount causes file deletions outside of /var/run
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: julian@precisium.com.au

With newer samba versions there is apparently a requirement of the new VFS =
to
mount fdescfs with the nodup option.
Samba mounts fdescfs under /var/run   e.g /var/run/samba4/fd

This interacts badly with /etc/rc.d/cleanvar which uses 'find /var/run ...'=
=20=20
to delete files under /var/run.

During startup - there appear to be various parts of the filesystem referen=
ced
under /var/run/samba4/fd  so that the result is deletion of all files under
paths such as /bin /sbin /etc /root=20

Rather than pushing to try to stop samba mounting this where it wants - I'm
filing this bug to see if it makes sense instead to make cleanvar safer, as
potentially other packages may do this sort of thing in future anyway.

I tried various -name & -path flags to exclude *samba4/fd/* etc -but 'find'
doesn't seem to recognise these as normal names & paths.
adding "-mount" to restrict find to the same device number as /var/run seem=
s to
work.

e.g the relevant line in /etc/rc.d/cleanvar becomes:
find /var/run -mount \( -type f -or -type s | -name log -and ! -name logpri=
v \)
-delete

see also discussion at
https://forums.freebsd.org/threads/iocage-removes-files-at-startup.87733/

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-269213-227>