Bug 141678

Summary: [patch] A minor enhancement to how /etc/rc.d/jail determines mount points used in jails
Product: Base System Reporter: Markiyan Kushnir <mkushnir>
Component: confAssignee: freebsd-rc (Nobody) <rc>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: jamie
Priority: Normal    
Version: 8.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Markiyan Kushnir 2009-12-16 12:40:00 UTC
As a part of jail cleanup the /etc/rc.d/jail script performs un-mount of the configured mount points, such as dev, fdesc, proc, as well as those in the jail's fstab file. To safely umount the mount point, it first checks if it is really a mount point, calling is_current_mountpoint(). This function performs rather naive path normalization, which fails if there are "/./" present in the mount point path. It can occur if, for example, the fstab file if automatically generated. Such paths are, however, perfectly valid input to the mount(8).

Please consider a little bit advanced version of the path normalization, which I propose to put in the rc.subr.

Fix: Please see the patch attached.

Patch attached with submission follows:
How-To-Repeat: One might have the following fstab:

/data/test-release/R/stage/trees/base/bin  /usr/jails/M/./bin  nullfs ro 0 0
/data/test-release/R/stage/trees/base/boot /usr/jails/M/./boot nullfs ro 0 0
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-12-16 12:53:17 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 Jamie Gritton freebsd_committer freebsd_triage 2016-01-25 20:13:49 UTC
As of 10-STABLE, the path check is done in jail(8) and the problematic code no longer exists.