return log_error_errno(errno, "Failed to fstat() '%s': %m", path);
if (((st.st_mode ^ filetype) & S_IFMT) != 0)
- return log_error_errno(
- SYNTHETIC_ERRNO(ENODEV),
- "Special node '%s' we just created is of a wrong type: %m", path);
+ return log_error_errno(SYNTHETIC_ERRNO(ENODEV),
+ "Special node '%s' we just created is of a wrong type: %m", path);
return TAKE_FD(fd);
}
if (r == ARCHIVE_EOF)
break;
if (r != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Unexpected error while iterating through ACLs.");
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Unexpected error while iterating through ACLs.");
assert(rtype == type);
ar = sym_archive_read_open_fd(a, input_fd, 64 * 1024);
if (ar != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to initialize archive context: %s", sym_archive_error_string(a));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to initialize archive context: %s", sym_archive_error_string(a));
OpenInode *open_inodes = NULL;
if (ar == ARCHIVE_EOF)
break;
if (!IN_SET(ar, ARCHIVE_OK, ARCHIVE_WARN))
- return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Failed to parse archive: %s", sym_archive_error_string(a));
+ return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Failed to parse archive: %s",
+ sym_archive_error_string(a));
const char *p = NULL;
r = archive_entry_pathname_safe(entry, &p);
if (r < 0)
return log_error_errno(r, "Invalid path name in entry, refusing.");
if (ar == ARCHIVE_WARN)
- log_warning("Non-critical error found while parsing '%s' from the archive, ignoring: %s", p ?: ".", sym_archive_error_string(a));
+ log_warning("Non-critical error found while parsing '%s' from the archive, ignoring: %s",
+ p ?: ".", sym_archive_error_string(a));
if (!p) {
/* This is the root inode */
if (r < 0)
return r;
if (open_inodes[0].filetype != S_IFDIR)
- return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Archives root inode is not a directory, refusing.");
+ return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
+ "Archives root inode is not a directory, refusing.");
continue;
}
"Invalid hardlink path name '%s' in entry, refusing.", target);
_cleanup_close_ int target_fd = -EBADF;
- r = chaseat(tree_fd, target, CHASE_PROHIBIT_SYMLINKS|CHASE_AT_RESOLVE_IN_ROOT|CHASE_NOFOLLOW, /* ret_path= */ NULL, &target_fd);
+ r = chaseat(tree_fd, target,
+ CHASE_PROHIBIT_SYMLINKS|CHASE_AT_RESOLVE_IN_ROOT|CHASE_NOFOLLOW,
+ /* ret_path= */ NULL, &target_fd);
if (r < 0)
return log_error_errno(
r,
/* Refuse hardlinking directories early. */
if (!inode_type_can_hardlink(verify_st.st_mode))
- return log_error_errno(
- SYNTHETIC_ERRNO(EBADF),
- "Refusing to hardlink inode '%s' of type '%s': %m", target, inode_type_to_string(verify_st.st_mode));
+ return log_error_errno(SYNTHETIC_ERRNO(EBADF),
+ "Refusing to hardlink inode '%s' of type '%s': %m",
+ target, inode_type_to_string(verify_st.st_mode));
if (linkat(target_fd, "", parent_fd, e, AT_EMPTY_PATH) < 0) {
if (errno != ENOENT)
_cleanup_close_ int target_parent_fd = -EBADF;
_cleanup_free_ char *target_filename = NULL;
- r = chaseat(tree_fd, target, CHASE_PROHIBIT_SYMLINKS|CHASE_AT_RESOLVE_IN_ROOT|CHASE_PARENT|CHASE_EXTRACT_FILENAME|CHASE_NOFOLLOW, &target_filename, &target_parent_fd);
+ r = chaseat(tree_fd, target,
+ CHASE_PROHIBIT_SYMLINKS|CHASE_AT_RESOLVE_IN_ROOT|CHASE_PARENT|CHASE_EXTRACT_FILENAME|CHASE_NOFOLLOW,
+ &target_filename, &target_parent_fd);
if (r < 0)
- return log_error_errno(
- r,
- "Failed to find inode '%s' which shall be hardlinked as '%s': %m", target, j);
+ return log_error_errno(r, "Failed to find inode '%s' which shall be hardlinked as '%s': %m",
+ target, j);
if (linkat(target_parent_fd, target_filename, parent_fd, e, /* flags= */ 0) < 0)
- return log_error_errno(
- errno,
- "Failed to hardlink inode '%s' as '%s': %m", target, j);
+ return log_error_errno(errno, "Failed to hardlink inode '%s' as '%s': %m",
+ target, j);
}
continue;
const char *w = startswith(e, ".wh.");
if (w) {
if (!filename_is_valid(w))
- return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "Invalid whiteout file entry '%s', refusing.", e);
+ return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
+ "Invalid whiteout file entry '%s', refusing.", e);
r = archive_unpack_whiteout(a, entry, parent_fd, empty_to_root(parent_path), w, j);
if (r < 0)
break;
default:
- return log_error_errno(
- SYNTHETIC_ERRNO(ENOTRECOVERABLE),
- "Unexpected file type %i of '%s', refusing.", (int) filetype, j);
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Unexpected file type %i of '%s', refusing.",
+ (int) filetype, j);
}
} else {
/* This is some intermediary node in the path that we haven't opened yet. Create it with default attributes */
sym_archive_entry_set_hardlink(entry, hardlink);
if (sym_archive_write_header(d->archive, entry) != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to write archive entry header: %s", sym_archive_error_string(d->archive));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to write archive entry header: %s", sym_archive_error_string(d->archive));
return RECURSE_DIR_CONTINUE;
}
}
if (sym_archive_write_header(d->archive, entry) != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to write archive entry header: %s", sym_archive_error_string(d->archive));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to write archive entry header: %s",
+ sym_archive_error_string(d->archive));
if (S_ISREG(sx->stx_mode)) {
assert(data_fd >= 0);
la_ssize_t k;
k = sym_archive_write_data(d->archive, buffer, l);
if (k < 0)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to write archive data: %s", sym_archive_error_string(d->archive));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to write archive data: %s",
+ sym_archive_error_string(d->archive));
}
}
else
r = sym_archive_write_set_format_pax(a);
if (r != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to set libarchive output format: %s", sym_archive_error_string(a));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to set libarchive output format: %s", sym_archive_error_string(a));
r = sym_archive_write_open_fd(a, output_fd);
if (r != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Failed to set libarchive output file: %s", sym_archive_error_string(a));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Failed to set libarchive output file: %s", sym_archive_error_string(a));
_cleanup_(make_archive_data_done) struct make_archive_data data = {
.archive = a,
r = sym_archive_write_close(a);
if (r != ARCHIVE_OK)
- return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE), "Unable to finish writing archive: %s", sym_archive_error_string(a));
+ return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
+ "Unable to finish writing archive: %s", sym_archive_error_string(a));
return 0;
}