#806507 union-mount-options: fails to handle ${CHROOT_UNION_OVERLAY_DIRECTORY}, etc.

Package:
schroot
Source:
schroot
Description:
Execute commands in a chroot environment
Submitter:
Ivan Shmakov
Date:
2015-11-28 07:24:06 UTC
Severity:
normal
#806507#5
Date:
2015-11-28 06:52:54 UTC
From:
To:
	schroot.conf(5) reads:

  union-mount-options=options

    […] Note: One can use the variables
    “${CHROOT_UNION_OVERLAY_DIRECTORY}” and
    “${CHROOT_UNION_UNDERLAY_DIRECTORY}” to refer to the writable
    overlay session directory and read-only underlying directory which
    are to form the union.

	However, it looks like these (or any other, for that matter)
	variables are never substituted within the code, and the value
	of the ‘union-mount-options’ option is instead passed to
	mount(8) “as-is”, leading to an error like:

Nov 28 06:30:49 crabs kernel: [938142.164904] aufs opt_add:714:mount[3093]: lookup failed ${CHROOT_UNION_OVERLAY_DIRECTORY} (-2)

	As an (untested) workaround, the following code could be added
	to either setup.d/10mount (do_mount_fs_union), or a file
	processed prior to one.

    CHROOT_UNION_MOUNT_OPTIONS=${CHROOT_UNION_MOUNT_OPTIONS//\${CHROOT_UNION_UNDERLAY_DIRECTORY\}/${CHROOT_UNION_UNDERLAY_DIRECTORY}}
    CHROOT_UNION_MOUNT_OPTIONS=${CHROOT_UNION_MOUNT_OPTIONS//\${CHROOT_UNION_OVERLAY_DIRECTORY\}/${CHROOT_UNION_OVERLAY_DIRECTORY}}

	(Per my reading of [1], the problem is not resolved as of the
	current ‘master’.)

[1] https://github.com/codelibre-net/schroot/blob/master/etc/setup.d/10mount