src = mnt_fs_get_source(cxt->fs);
+ if (!src && (cxt->mountflags & MS_PROPAGATION))
+ /* mount --make-{shared,private,...} */
+ return mnt_fs_set_source(cxt->fs, "none");
+
/* ignore filesystems without source or filesystems
* where the source is quasi-path (//foo/bar)
*/
if ((cxt->mountflags & (MS_BIND | MS_MOVE | MS_PROPAGATION)) ||
mnt_fs_is_pseudofs(cxt->fs)) {
- DBG(CXT, mnt_debug_h(cxt, "PROPAGATION/pseudo FS source: %s", path));
+ DBG(CXT, mnt_debug_h(cxt, "BIND/MOVE/pseudo FS source: %s", path));
return rc;
}
if (!target)
return -EINVAL;
- if (!src)
+ if (!src) {
+ /* unnecessary, should be already resolved in
+ * mnt_context_prepare_srcpath(), but for sure... */
+ DBG(CXT, mnt_debug_h(cxt, "WARNING: source is NULL -- using \"none\"!"));
src = "none";
-
+ }
type = try_type ? : mnt_fs_get_fstype(cxt->fs);
if (!(flags & MS_MGC_MSK))