deploy: Add some error prefixing around xattr setting
authorColin Walters <walters@verbum.org>
Wed, 9 Sep 2020 12:34:44 +0000 (12:34 +0000)
committerColin Walters <walters@verbum.org>
Wed, 9 Sep 2020 12:34:44 +0000 (12:34 +0000)
Looking at
https://github.com/coreos/coreos-assembler/issues/1703
a user is getting a bare:
`error: fsetxattr: Permission denied`

I don't think it's these code paths since a deploy
isn't happening but on inspection I noticed we didn't
have error prefixing here.

src/libostree/ostree-sysroot-deploy.c

index 0e02d1f25b3942a48ef1416f8fe170f05672957a..65d54b46b4332170b19339aa892cd8f802c8ab94 100644 (file)
@@ -313,7 +313,7 @@ copy_dir_recurse (int              src_parent_dfd,
 
   if (!dirfd_copy_attributes_and_xattrs (src_parent_dfd, name, src_dfd_iter.fd, dest_dfd,
                                          flags, cancellable, error))
-    return FALSE;
+    return glnx_prefix_error (error, "Copying attributes of %s", name);
 
   while (TRUE)
     {
@@ -340,7 +340,7 @@ copy_dir_recurse (int              src_parent_dfd,
                                   dest_dfd, dent->d_name,
                                   sysroot_flags_to_copy_flags (GLNX_FILE_COPY_OVERWRITE, flags),
                                   cancellable, error))
-            return FALSE;
+            return glnx_prefix_error (error, "Copying %s", dent->d_name);
         }
     }
 
@@ -488,7 +488,7 @@ copy_modified_config_file (int                 orig_etc_fd,
                               new_etc_fd, path,
                               sysroot_flags_to_copy_flags (GLNX_FILE_COPY_OVERWRITE, flags),
                               cancellable, error))
-        return FALSE;
+        return glnx_prefix_error (error, "Copying %s", path);
     }
   else
     {