Giacomo Tesio
320e6e6f35
Any process X can get a new copy of the namespace of a target process Y by writing the string "clone" to the ns file of Y. The same user must own both processes. The process writing the ns file must be allowed to mount. The Pgrp of the calling process is then replaced with a new copy of the Pgrp of the target process. After the operation, any change done by X to its own namespace does not affect Y. Also, if mount was forbidden for Y, it will also be forbidden for X after the clone.