[Bug 241062] bectl: generated mount should be done in /var/tmp not in /tmp

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Oct 4 16:06:42 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241062

            Bug ID: 241062
           Summary: bectl: generated mount should be done in /var/tmp not
                    in /tmp
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: vermaden at interia.pl

The bectl(8) tool mounts BE in /tmp dir.

I already fixed that in beadm(8) to mount them in /var/tmp.

This is very bad and dangerous because if have 'clear_tmp_enable=YES' set in
/etc/rc.conf file then imagine following scenario:

1. # bectl mount BE
2. # shutdown now (single user more)
3. Hit CTRL-D to get back to multiuser mode.
4. The /etc/rc.d/cleartmp script is executed.
5. You jus wiped out contents of BE mounted at /tmp.

# bectl list
BE   Active Mountpoint Space Created
11.3 -      -          6.18G 2019-09-02 13:18
12.1 NR     /          8.74G 2019-08-01 14:24
safe -      -          1.17G 2019-10-02 23:10

# bectl mount 11.3
successfully mounted 11.3 at /tmp/be_mount.vlYN

# bectl list
BE   Active Mountpoint Space Created
11.3 -      /tmp/be_mount.vlYN         6.18G 2019-09-02 13:18
12.1 NR     /          8.74G 2019-08-01 14:24
safe -      -          1.17G 2019-10-02 23:10

Regards.

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


More information about the freebsd-bugs mailing list