If using SELinux, mount /selinux in the appliance.
[libguestfs.git] / daemon / file.c
index 6062c50..cd477e5 100644 (file)
@@ -97,18 +97,18 @@ do_cat (char *path)
     if (size >= alloc) {
       alloc += 8192;
       if (alloc > max) {
-       reply_with_error ("cat: %s: file is too large for message buffer",
-                         path);
-       free (buf);
-       close (fd);
-       return NULL;
+        reply_with_error ("cat: %s: file is too large for message buffer",
+                          path);
+        free (buf);
+        close (fd);
+        return NULL;
       }
       buf2 = realloc (buf, alloc);
       if (buf2 == NULL) {
-       reply_with_perror ("realloc");
-       free (buf);
-       close (fd);
-       return NULL;
+        reply_with_perror ("realloc");
+        free (buf);
+        close (fd);
+        return NULL;
       }
       buf = buf2;
     }
@@ -392,7 +392,6 @@ do_file (char *path)
   int len;
 
   NEED_ROOT_OR_IS_DEVICE (path, NULL);
-  ABS_PATH (path, NULL);
 
   if (strncmp (path, "/dev/", 5) == 0)
     buf = (char *) path;
@@ -416,7 +415,7 @@ do_file (char *path)
     return NULL;
   }
 
-  r = command (&out, &err, "file", "-bsL", buf, NULL);
+  r = command (&out, &err, "file", "-zbsL", buf, NULL);
   if (freeit) free (buf);
 
   if (r == -1) {