chiark / gitweb /
Fix check_loopback()
[elogind.git] / src / machine / image.c
index 1574adf30b1531dac024bded9a5784e8499679e1..46a216bbb77a65fc50090c1f6a998c8bc0c0859d 100644 (file)
@@ -112,7 +112,7 @@ static int image_make(
 
         read_only =
                 (path && path_startswith(path, "/usr")) ||
-                faccessat(dfd, filename, W_OK, AT_EACCESS) < 0;
+                (faccessat(dfd, filename, W_OK, AT_EACCESS) < 0 && errno == EROFS);
 
         if (S_ISDIR(st.st_mode)) {
 
@@ -243,7 +243,7 @@ int image_find(const char *name, Image **ret) {
         }
 
         if (streq(name, ".host"))
-                return image_make(NULL, AT_FDCWD, NULL, "/", ret);
+                return image_make(".host", AT_FDCWD, NULL, "/", ret);
 
         return 0;
 };