From 77e21c6b7db87bad533843f44e031247516c57f5 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 2 Oct 2024 19:23:24 +0200 Subject: [PATCH] Flock: a bit more fd closing --- flock/container.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flock/container.c b/flock/container.c index 47a32237..c8bafa6d 100644 --- a/flock/container.c +++ b/flock/container.c @@ -209,17 +209,16 @@ container_mainloop(int fd) SYSCALL(fchdir, wfd); close(wfd); wfd = -1; - int ufd = GETDIR(lp_strdup(lp, "./upper")); + close(GETDIR(lp_strdup(lp, "./upper"))); close(GETDIR(lp_strdup(lp, "./tmp"))); close(GETDIR(lp_strdup(lp, "./root"))); - int lfd = -1; bool cloneroot = !strcmp(ccf.basedir, "/"); bool clonedev = cloneroot; if (cloneroot) { ccf.basedir = "./lower"; - lfd = GETDIR(lp_strdup(lp, "./lower")); + close(GETDIR(lp_strdup(lp, "./lower"))); } const char *overlay_mount_options = lp_sprintf(lp, "lowerdir=%s,upperdir=%s,workdir=%s", @@ -321,6 +320,7 @@ container_mainloop(int fd) pid_t logger_pid = fork(); if (!logger_pid) { + /* TODO: this HAS to run as birdloop */ MKDIR("/var/log"); int wfd = SYSCALL(open, "/var/log/syslog", O_WRONLY | O_CREAT, 0640);