#include "fdset.h"
#include "build.h"
#include "fileio.h"
-#include "bus-internal.h"
-#include "bus-message.h"
+#include "bus-util.h"
#ifndef TTY_GID
#define TTY_GID 5
static int setup_resolv_conf(const char *dest) {
char _cleanup_free_ *where = NULL;
- _cleanup_close_ int fd = -1;
assert(dest);
if (!where)
return log_oom();
- fd = open(where, O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC|O_NOCTTY|O_NOFOLLOW, 0644);
-
/* We don't really care for the results of this really. If it
* fails, it fails, but meh... */
- if (mount("/etc/resolv.conf", where, "bind", MS_BIND, NULL) < 0)
- log_warning("Failed to bind mount /etc/resolv.conf: %m");
- else
- if (mount("/etc/resolv.conf", where, "bind",
- MS_BIND|MS_REMOUNT|MS_RDONLY, NULL) < 0) {
- log_error("Failed to remount /etc/resolv.conf readonly: %m");
- return -errno;
- }
+ copy_file("/etc/resolv.conf", where, O_TRUNC|O_NOFOLLOW);
return 0;
}
NULL,
"sayssusa(sv)",
arg_machine,
- SD_BUS_APPEND_ID128(arg_uuid),
+ SD_BUS_MESSAGE_APPEND_ID128(arg_uuid),
"nspawn",
"container",
(uint32_t) 0,
bool saved_attr_valid = false;
struct winsize ws;
int kmsg_socket_pair[2] = { -1, -1 };
- FDSet *fds = NULL;
+ _cleanup_fdset_free_ FDSet *fds = NULL;
log_parse_environment();
log_open();
free(arg_directory);
free(arg_machine);
- fdset_free(fds);
-
return r;
}