]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: let's better not invade stdio territory when duplicating fds
authorLennart Poettering <lennart@poettering.net>
Wed, 28 Feb 2018 22:36:33 +0000 (23:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 2 Mar 2018 10:42:10 +0000 (11:42 +0100)
src/libsystemd/sd-bus/bus-message.c

index 95a87da08bda0e13a187771e696c9eb531082a16..c756a25add40a6dbf1a7e70553c1b4aeac712094 100644 (file)
@@ -2646,7 +2646,7 @@ _public_ int sd_bus_message_append_array_memfd(
         if (r < 0)
                 return r;
 
-        copy_fd = dup(memfd);
+        copy_fd = fcntl(memfd, F_DUPFD_CLOEXEC, 3);
         if (copy_fd < 0)
                 return copy_fd;
 
@@ -2721,7 +2721,7 @@ _public_ int sd_bus_message_append_string_memfd(
         if (r < 0)
                 return r;
 
-        copy_fd = dup(memfd);
+        copy_fd = fcntl(memfd, FD_CLOEXEC, 3);
         if (copy_fd < 0)
                 return copy_fd;