mounts to polydirs not working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libpam-mount (Debian) |
Fix Released
|
Unknown
|
|||
libpam-mount (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Focal |
New
|
Low
|
Unassigned | ||
Jammy |
New
|
Low
|
Unassigned | ||
Kinetic |
Fix Released
|
Low
|
Unassigned |
Bug Description
Using a polyinstantiated directory as a mount point is not working in focal (20.04.1) with libpam-mount 2.16-10.
The problem is only when the polydir itself is used as a mountpoint; there is no problem using a subdirectory inside the polydir. (e.g. If "/data2" is defined as a polydir in /etc/security/
I think the problem is this patch: 0014-Don-
Expected behavior: A filesystem should be mounted at the polydir or at least debug logs should show an attempted mount command.
Observed behavior: Nothing is mounted and the following lines are logged by both systemd and login (debugging enabled in pam_mount.conf.xml)
(mount.c:250): Mount info: globalconf, user=elinde <volume fstype="cifs" server="stor1" path="data" mountpoint="/data2" cipher="(null)" fskeypath="(null)" fskeycipher=
(mount.c:622): data already seems to be mounted at /data2, skipping
The behavior I'm looking for does work in bionic (18.04.5) with libpam-mount 2.16-3ubuntu0.1.
description: | updated |
tags: | added: focal |
Changed in libpam-mount (Debian): | |
status: | Unknown → New |
Changed in libpam-mount (Debian): | |
status: | New → Fix Released |
Hi Evan,
thanks for opening the bug, it is indeed a result of the 0014-Don- t-compare- source- when-checking- if-it-s- already- m.patch.
As far as I understand polydirs are implemented as mount overlays and so /data2 in your example is a mount point already.
You can test this with this example using the same functions as libpam-mount:
// sudo apt install gcc libmount-dev; cc -o lsmount lsmount.c -lmount; ./lsmount
#include <libmount/ libmount. h>
int main()
{
struct libmnt_context *ctx;
struct libmnt_table *table;
struct libmnt_iter *iter;
struct libmnt_fs *fs;
ctx = mnt_new_context(); get_mtab( ctx, &table) != 0) iter(MNT_ ITER_BACKWARD) ;
if (ctx == NULL)
return -1;
if (mnt_context_
goto out;
iter = mnt_new_
if (iter == NULL)
goto out;
while (mnt_table_ next_fs( table, iter, &fs) == 0) "source: \t%s target: %s\n", mnt_fs_ get_source( fs), mnt_fs_ get_target( fs)); context( ctx);
printf(
out:
mnt_free_
return 0;
}
It should list /data2 as a target if run as the user with the polydir.
As far as I understand, mounting something on top of the polydir would hide the polydir.
Can you give some more background of your setup?