#include "machine-image.h"
#include "machine-pool.h"
#include "machined.h"
+#include "missing_capability.h"
#include "path-util.h"
#include "process-util.h"
#include "stdio-util.h"
static int method_list_images(sd_bus_message *message, void *userdata, sd_bus_error *error) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
- _cleanup_(image_hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
Manager *m = userdata;
Image *image;
Iterator i;
assert(message);
assert(m);
- images = hashmap_new(&string_hash_ops);
+ images = hashmap_new(&image_hash_ops);
if (!images)
return -ENOMEM;
if (lseek(operation->extra_fd, 0, SEEK_SET) == (off_t) -1)
return -errno;
- f = fdopen(operation->extra_fd, "re");
+ f = fdopen(operation->extra_fd, "r");
if (!f)
return -errno;
if (success) /* The resulting temporary file could not be updated, ignore it. */
return ret;
- r = read_nul_string(f, &name);
- if (r < 0 || isempty(name)) /* Same here... */
+ r = read_nul_string(f, LONG_LINE_MAX, &name);
+ if (r <= 0) /* Same here... */
return ret;
return sd_bus_error_set_errnof(error, ret, "Failed to remove image %s: %m", name);
_cleanup_free_ char *name = NULL;
uint64_t size;
- r = read_nul_string(f, &name);
+ r = read_nul_string(f, LONG_LINE_MAX, &name);
if (r < 0)
return r;
- if (isempty(name)) /* reached the end */
+ if (r == 0) /* reached the end */
break;
errno = 0;
if (r < 0)
return sd_bus_error_set_errnof(error, r, "Failed to fork(): %m");
if (r == 0) {
- _cleanup_(image_hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
bool success = true;
Image *image;
Iterator i;
errno_pipe_fd[0] = safe_close(errno_pipe_fd[0]);
- images = hashmap_new(&string_hash_ops);
+ images = hashmap_new(&image_hash_ops);
if (!images) {
r = -ENOMEM;
goto child_fail;