]> git.ipfire.org Git - pakfire.git/commitdiff
mount: Make changing mount operation not dependant on pakfire
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Nov 2023 08:28:49 +0000 (08:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 2 Nov 2023 08:28:49 +0000 (08:28 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/mount.h
src/libpakfire/jail.c
src/libpakfire/mount.c

index b3b14fbb832eebc9230c2f4b10a04489d9b288ed..c924664e6b6ab1099b6a9beb3d9b70c480d6ffcc 100644 (file)
 
 #ifdef PAKFIRE_PRIVATE
 
+#include <pakfire/ctx.h>
 #include <pakfire/pakfire.h>
 
-int pakfire_mount_change_propagation(struct pakfire* pakfire, int propagation, const char* path);
+int pakfire_mount_change_propagation(struct pakfire_ctx* ctx, const char* path, int propagation);
 
 int pakfire_mount_make_mounpoint(struct pakfire* pakfire, const char* path);
 
index ebcb6f31abce7cbf367779b19f227a772d09aad1..fff8c7e671a8a2c9dfc8cfecbace24036c0fe496 100644 (file)
@@ -1705,7 +1705,7 @@ static int pakfire_jail_child(struct pakfire_jail* jail, struct pakfire_jail_exe
        const char* arch = pakfire_get_effective_arch(jail->pakfire);
 
        // Change mount propagation to slave to receive anything from the parent namespace
-       r = pakfire_mount_change_propagation(jail->pakfire, MS_SLAVE, "/");
+       r = pakfire_mount_change_propagation(jail->ctx, "/", MS_SLAVE);
        if (r)
                return r;
 
@@ -1715,7 +1715,7 @@ static int pakfire_jail_child(struct pakfire_jail* jail, struct pakfire_jail_exe
                return r;
 
        // Change mount propagation to private
-       r = pakfire_mount_change_propagation(jail->pakfire, MS_PRIVATE, root);
+       r = pakfire_mount_change_propagation(jail->ctx, root, MS_PRIVATE);
        if (r)
                return r;
 
index 25641985ed9d211e04381ec4903c83996119d869..494c25852921b3dd166f6ccc91933449586a508d 100644 (file)
@@ -144,12 +144,12 @@ static const struct pakfire_symlink {
        { NULL },
 };
 
-int pakfire_mount_change_propagation(struct pakfire* pakfire, int propagation, const char* path) {
-       DEBUG(pakfire, "Changing mount propagation on %s\n", path);
+int pakfire_mount_change_propagation(struct pakfire_ctx* ctx, const char* path, int propagation) {
+       CTX_DEBUG(ctx, "Changing mount propagation on %s\n", path);
 
        int r = mount(NULL, path, NULL, propagation|MS_REC, NULL);
        if (r)
-               ERROR(pakfire, "Failed to change mount propagation on %s: %m\n", path);
+               CTX_ERROR(ctx, "Failed to change mount propagation on %s: %m\n", path);
 
        return r;
 }