]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: fix tree FD usage in subdir hook
authorKarel Zak <kzak@redhat.com>
Mon, 3 Jun 2024 10:33:01 +0000 (12:33 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Jun 2024 07:18:10 +0000 (09:18 +0200)
commitc399bc797d4bdfaed6ca9ad22c1e11fc35b96341
tree4f58093842571ca590faf1e7f16a491ff1a5300d
parent9aa18ade22b55f7db28217a6d02bfd6f95f88f64
libmount: fix tree FD usage in subdir hook

* Initialize the tree file descriptor in the hook_subdir.c module if
  it has not been initialized yet. (hook_mount.c does not open the
  tree if the mount.<type> helper will be executed.)

* Move the function to open the tree to context.c to make it more
  generic and usable in more places.

Reported-by: Linus Heckemann <git@sphalerite.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 2a684833d723e29af0ba772b3e6917492c69e023)
libmount/src/context.c
libmount/src/hook_mount.c
libmount/src/hook_subdir.c
libmount/src/mountP.h