]> git.ipfire.org Git - pakfire.git/commitdiff
root: Rename pakfire_root_on_root to pakfire_root_is_root
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 29 Jun 2025 14:51:32 +0000 (14:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 29 Jun 2025 14:51:32 +0000 (14:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/jail.c
src/pakfire/root.c
src/pakfire/root.h

index 328d8bc20799307c31cc101c1822d22aa5e7be00..0398b5d470b5e73685e9cff09532352b6cd933bd 100644 (file)
@@ -252,7 +252,7 @@ int pakfire_jail_create(pakfire_jail** jail, pakfire_ctx* ctx, pakfire_root* roo
                goto ERROR;
 
        // Disable systemctl to talk to systemd
-       if (!pakfire_root_on_root(self->root)) {
+       if (!pakfire_root_is_root(self->root)) {
                r = pakfire_env_set(self->env, "SYSTEMD_OFFLINE", "1");
                if (r < 0)
                        goto ERROR;
@@ -1558,7 +1558,7 @@ static int pakfire_jail_child(pakfire_jail* jail, pakfire_jail_exec* ctx) {
                return r;
 
        // Change root (unless root is /)
-       if (!pakfire_root_on_root(jail->root)) {
+       if (!pakfire_root_is_root(jail->root)) {
                // Mount everything
                r = pakfire_jail_mount(jail, ctx);
                if (r)
index 9fc7b0e0cce027e0f18e881c4798b5147b11764f..2453773394cd157e305c6018b471eff179aecdcf 100644 (file)
@@ -151,7 +151,7 @@ static const char* features[] = {
        NULL,
 };
 
-int pakfire_root_on_root(pakfire_root* self) {
+int pakfire_root_is_root(pakfire_root* self) {
        return (strcmp(self->path, "/") == 0);
 }
 
@@ -178,7 +178,7 @@ const struct pakfire_subid* pakfire_root_subgid(pakfire_root* self) {
 static unsigned int pakfire_root_map_id(pakfire_root* self,
                const struct pakfire_subid* subid, const unsigned int id) {
        // Nothing to do if we are running on root
-       if (pakfire_root_on_root(self))
+       if (pakfire_root_is_root(self))
                return id;
 
        // Map the ID
@@ -196,7 +196,7 @@ static unsigned int pakfire_root_map_id(pakfire_root* self,
 static unsigned int pakfire_root_unmap_id(pakfire_root* self,
                const struct pakfire_subid* subid, const unsigned int id) {
        // Nothing to do if we are running on root
-       if (pakfire_root_on_root(self))
+       if (pakfire_root_is_root(self))
                return id;
 
        // Unmap the ID
@@ -382,7 +382,7 @@ static int pakfire_root_setup_pool(pakfire_root* self) {
        }
 
        // Lock the running kernel
-       if (pakfire_root_on_root(self)) {
+       if (pakfire_root_is_root(self)) {
                r = pakfire_root_lock_running_kernel(self);
                if (r < 0)
                        return r;
@@ -533,7 +533,7 @@ static void pakfire_root_free(pakfire_root* self) {
 // Safety check in case this is being launched on the host system
 static int pakfire_root_safety_checks(pakfire_root* self) {
        // Nothing to do if we are not working on root
-       if (!pakfire_root_on_root(self))
+       if (!pakfire_root_is_root(self))
                return 0;
 
        // We must be root in order to operate in /
@@ -940,7 +940,7 @@ static int pakfire_root_setup_user(pakfire_root* self) {
                self->user.subuids.length = self->group.subgids.length = 1;
 
        // Read SUBUID/SUBGIDs from file
-       if (!pakfire_root_on_root(self)) {
+       if (!pakfire_root_is_root(self)) {
                // Fetch SUBUIDs
                r = pakfire_getsubuid(self->ctx, self, self->user.name, &self->user.subuids);
                switch (r) {
index 725bb9088e6f03bc00ed4a9c1d8a00402e97fd2c..c19498f5e811c5cbf42da3d5cbf69482a0e1e5b8 100644 (file)
@@ -94,7 +94,7 @@ int pakfire_root_update_snapshot(pakfire_root* pakfire);
 
 const char* pakfire_root_get_effective_arch(pakfire_root* pakfire);
 
-int pakfire_root_on_root(pakfire_root* pakfire);
+int pakfire_root_is_root(pakfire_root* pakfire);
 
 uid_t pakfire_root_uid(pakfire_root* pakfire);
 gid_t pakfire_root_gid(pakfire_root* pakfire);