#include "device-nodes.h"
#include "dropin.h"
#include "efivars.h"
+#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "fstab-util.h"
}
static int process_resume(void) {
- _cleanup_free_ char *device_unit = NULL;
+ _cleanup_free_ char *device_unit = NULL, *device_escaped = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
if (r < 0)
log_warning_errno(r, "Failed to write device timeout drop-in, ignoring: %m");
+ device_escaped = cescape(arg_resume_device);
+ if (!device_escaped)
+ return log_oom();
+
r = generator_open_unit_file(arg_dest, NULL, SPECIAL_HIBERNATE_RESUME_SERVICE, &f);
if (r < 0)
return r;
"Type=oneshot\n"
"ExecStart=" LIBEXECDIR "/systemd-hibernate-resume %2$s %3$" PRIu64 "\n",
device_unit,
- arg_resume_device,
+ device_escaped,
arg_resume_offset);
r = fflush_and_check(f);