]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
seccomp: notifier fixes
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 30 Apr 2019 22:36:41 +0000 (00:36 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 18 May 2019 09:47:43 +0000 (11:47 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/af_unix.c

index 328f891f0b7a3d7384acc044ab75961370e03b0b..d4107eccc1c671c35777ac4bb45810b1ab96c01d 100644 (file)
@@ -351,18 +351,23 @@ int lxc_unix_connect(struct sockaddr_un *addr)
        int ret;
        ssize_t len;
 
-       fd = socket(PF_UNIX, SOCK_STREAM, SOCK_CLOEXEC);
-       if (fd < 0)
+       fd = socket(AF_UNIX, SOCK_STREAM, 0);
+       if (fd < 0) {
+               SYSERROR("Failed to open new AF_UNIX socket");
                return -1;
+       }
 
        if (addr->sun_path[0] == '\0')
                len = strlen(&addr->sun_path[1]);
        else
                len = strlen(&addr->sun_path[0]);
-       ret = connect(fd, (struct sockaddr *)&addr,
-                     offsetof(struct sockaddr_un, sun_path) + len + 1);
-       if (ret < 0)
+
+       ret = connect(fd, (struct sockaddr *)addr,
+                     offsetof(struct sockaddr_un, sun_path) + len);
+       if (ret < 0) {
+               SYSERROR("Failed to bind new AF_UNIX socket");
                return -1;
+       }
 
        return move_fd(fd);
 }