]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
jail: Don't abort if /etc/hosts or /etc/resolv.conf cannot be bind-mounted
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Sep 2023 19:39:51 +0000 (19:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Sep 2023 19:39:51 +0000 (19:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/jail.c

index 40ea2348acd3f307d95fa89ab8642bd558628bb4..2ffca2b2fc0302ca4bbf2c393102bfad009adbed 100644 (file)
@@ -1285,8 +1285,17 @@ static int pakfire_jail_mount_networking(struct pakfire_jail* jail) {
        // Bind-mount all paths read-only
        for (const char** path = paths; *path; path++) {
                r = pakfire_bind(jail->pakfire, *path, NULL, MS_RDONLY);
-               if (r)
+               if (r) {
+                       switch (errno) {
+                               // Ignore if we don't have permission
+                               case EPERM:
+                                       continue;
+
+                               default:
+                                       break;
+                       }
                        return r;
+               }
        }
 
        return 0;