]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (owner) call hooks when all mount stuff is done
authorKarel Zak <kzak@redhat.com>
Wed, 12 Oct 2022 11:00:12 +0000 (13:00 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/hook_owner.c

index 754eb809f5c076496dbb8b322e6cef637ab0d31a..938d34f8d46b5570ebe0eceb46c138dd856f9f58 100644 (file)
@@ -1067,6 +1067,9 @@ again:
                }
        }
 
+       if (rc == 0)
+               rc = mnt_context_call_hooks(cxt, MNT_STAGE_POST);
+
        mnt_context_deinit_hooksets(cxt);
 
        if (!mnt_context_switch_ns(cxt, ns_old))
index 9c23733a384f0423e8b25c954b03c66f7bfe957f..11b238c891743287622a42bc1c4501b5c005e5e5 100644 (file)
@@ -41,7 +41,7 @@ static int hookset_deinit(struct libmnt_context *cxt, const struct libmnt_hookse
        return 0;
 }
 
-static int hook_mount_post(
+static int hook_post(
                        struct libmnt_context *cxt,
                        const struct libmnt_hookset *hs __attribute__((__unused__)),
                        void *data)
@@ -150,8 +150,8 @@ static int hook_prepare_options(
                DBG(CXT, ul_debugobj(cxt, " wanted ownership %d:%d, mode %04o",
                                        hd->owner, hd->group, hd->mode));
                rc = mnt_context_append_hook(cxt, hs,
-                               MNT_STAGE_MOUNT_POST,
-                               hd, hook_mount_post);
+                               MNT_STAGE_POST,
+                               hd, hook_post);
                if (rc < 0)
                        goto fail;
        }