svn commit: r445076 - in head/x11-servers: xorg-nestserver/files xorg-server xorg-server/files xorg-vfbserver/files xwayland/files
Matthew Rezny
rezny at freebsd.org
Sat Jul 8 10:54:36 UTC 2017
On Wednesday 05 July 2017 12:41:57 Jan Beich wrote:
> Author: jbeich
> Date: Wed Jul 5 12:41:57 2017
> New Revision: 445076
> URL: https://svnweb.freebsd.org/changeset/ports/445076
>
> Log:
> x11-servers/xorg-server: close-on-exec for MIT-SHM (like Linux)
>
> This is similar to what x11/libxshmfence already does.
>
> MFH: 2017Q3
>
> Added:
> head/x11-servers/xorg-nestserver/files/
> head/x11-servers/xorg-nestserver/files/patch-Xext_shm.c (contents, props
> changed) head/x11-servers/xorg-nestserver/files/patch-configure
> (contents, props changed)
> head/x11-servers/xorg-nestserver/files/patch-include_dix-config.h.in
> (contents, props changed)
> head/x11-servers/xorg-server/files/patch-Xext_shm.c (contents, props
> changed) head/x11-servers/xorg-server/files/patch-include_dix-config.h.in
> (contents, props changed) head/x11-servers/xorg-vfbserver/files/
> head/x11-servers/xorg-vfbserver/files/patch-Xext_shm.c (contents, props
> changed) head/x11-servers/xorg-vfbserver/files/patch-configure (contents,
> props changed)
> head/x11-servers/xorg-vfbserver/files/patch-include_dix-config.h.in
> (contents, props changed) head/x11-servers/xwayland/files/
> head/x11-servers/xwayland/files/patch-Xext_shm.c (contents, props
> changed) head/x11-servers/xwayland/files/patch-configure (contents, props
> changed) head/x11-servers/xwayland/files/patch-include_dix-config.h.in
> (contents, props changed) Modified:
> head/x11-servers/xorg-server/Makefile (contents, props changed)
> head/x11-servers/xorg-server/files/patch-configure (contents, props
> changed)
>
> Added: head/x11-servers/xorg-nestserver/files/patch-Xext_shm.c
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-nestserver/files/patch-Xext_shm.c Wed Jul 5
> 12:41:57 2017 (r445076) @@ -0,0 +1,14 @@
> +--- Xext/shm.c.orig 2016-07-19 17:14:21 UTC
> ++++ Xext/shm.c
> +@@ -1210,7 +1210,11 @@ shm_tmpfile(void)
> + }
> + ErrorF ("Not using O_TMPFILE\n");
> + #endif
> ++#ifdef HAVE_MKOSTEMP
> ++ fd = mkostemp(template, O_CLOEXEC);
> ++#else
> + fd = mkstemp(template);
> ++#endif
> + if (fd < 0)
> + return -1;
> + unlink(template);
>
> Added: head/x11-servers/xorg-nestserver/files/patch-configure
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-nestserver/files/patch-configure Wed Jul 5
> 12:41:57 2017 (r445076) @@ -0,0 +1,10 @@
> +--- configure.orig 2017-01-11 21:16:40 UTC
> ++++ configure
> +@@ -22758,6 +22758,7 @@ fi
> + for ac_func in backtrace ffs geteuid getuid issetugid getresuid \
> + getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
> + mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
> ++ mkostemp \
> + walkcontext setitimer poll epoll_create1
> + do :
> + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
>
> Added: head/x11-servers/xorg-nestserver/files/patch-include_dix-config.h.in
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-nestserver/files/patch-include_dix-config.h.in
Wed
> Jul 5 12:41:57 2017 (r445076) @@ -0,0 +1,12 @@
> +--- include/dix-config.h.in.orig 2016-07-19 17:07:29 UTC
> ++++ include/dix-config.h.in
> +@@ -140,6 +140,9 @@
> + /* Define to 1 if you have the <linux/fb.h> header file. */
> + #undef HAVE_LINUX_FB_H
> +
> ++/* Define to 1 if you have the `mkostemp' function. */
> ++#undef HAVE_MKOSTEMP
> ++
> + /* Define to 1 if you have the `mmap' function. */
> + #undef HAVE_MMAP
> +
>
> Modified: head/x11-servers/xorg-server/Makefile
> ============================================================================
> == --- head/x11-servers/xorg-server/Makefile Wed Jul 5 12:41:43
> 2017 (r445075) +++ head/x11-servers/xorg-server/Makefile Wed Jul 5
> 12:41:57 2017 (r445076) @@ -3,7 +3,7 @@
>
> PORTNAME?= xorg-server
> PORTVERSION?= 1.18.4
> -PORTREVISION?= 1
> +PORTREVISION?= 2
> PORTEPOCH?= 1
> CATEGORIES= x11-servers
> MASTER_SITES= XORG/individual/xserver
>
> Added: head/x11-servers/xorg-server/files/patch-Xext_shm.c
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-server/files/patch-Xext_shm.c Wed Jul 5 12:41:57
> 2017 (r445076) @@ -0,0 +1,14 @@
> +--- Xext/shm.c.orig 2016-07-19 17:14:21 UTC
> ++++ Xext/shm.c
> +@@ -1210,7 +1210,11 @@ shm_tmpfile(void)
> + }
> + ErrorF ("Not using O_TMPFILE\n");
> + #endif
> ++#ifdef HAVE_MKOSTEMP
> ++ fd = mkostemp(template, O_CLOEXEC);
> ++#else
> + fd = mkstemp(template);
> ++#endif
> + if (fd < 0)
> + return -1;
> + unlink(template);
>
> Modified: head/x11-servers/xorg-server/files/patch-configure
> ============================================================================
> == --- head/x11-servers/xorg-server/files/patch-configure Wed Jul 5
> 12:41:43 2017 (r445075) +++
> head/x11-servers/xorg-server/files/patch-configure Wed Jul 5 12:41:57
> 2017 (r445076) @@ -1,5 +1,13 @@
> --- configure.orig 2016-07-19 17:27:31 UTC
> +++ configure
> +@@ -22742,6 +22742,7 @@ fi
> + for ac_func in backtrace ffs geteuid getuid issetugid getresuid \
> + getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
> + mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
> ++ mkostemp \
> + walkcontext
> + do :
> + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
> @@ -23168,9 +23168,14 @@ $as_echo "#define USE_ALPHA_PIO 1" >>con
> esac
> GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
>
> Added: head/x11-servers/xorg-server/files/patch-include_dix-config.h.in
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-server/files/patch-include_dix-config.h.in Wed Jul
> 5 12:41:57 2017 (r445076) @@ -0,0 +1,12 @@
> +--- include/dix-config.h.in.orig 2016-07-19 17:07:29 UTC
> ++++ include/dix-config.h.in
> +@@ -140,6 +140,9 @@
> + /* Define to 1 if you have the <linux/fb.h> header file. */
> + #undef HAVE_LINUX_FB_H
> +
> ++/* Define to 1 if you have the `mkostemp' function. */
> ++#undef HAVE_MKOSTEMP
> ++
> + /* Define to 1 if you have the `mmap' function. */
> + #undef HAVE_MMAP
> +
>
> Added: head/x11-servers/xorg-vfbserver/files/patch-Xext_shm.c
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-vfbserver/files/patch-Xext_shm.c Wed Jul 5
> 12:41:57 2017 (r445076) @@ -0,0 +1,14 @@
> +--- Xext/shm.c.orig 2016-07-19 17:14:21 UTC
> ++++ Xext/shm.c
> +@@ -1210,7 +1210,11 @@ shm_tmpfile(void)
> + }
> + ErrorF ("Not using O_TMPFILE\n");
> + #endif
> ++#ifdef HAVE_MKOSTEMP
> ++ fd = mkostemp(template, O_CLOEXEC);
> ++#else
> + fd = mkstemp(template);
> ++#endif
> + if (fd < 0)
> + return -1;
> + unlink(template);
>
> Added: head/x11-servers/xorg-vfbserver/files/patch-configure
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-vfbserver/files/patch-configure Wed Jul 5
> 12:41:57 2017 (r445076) @@ -0,0 +1,10 @@
> +--- configure.orig 2017-01-11 21:16:40 UTC
> ++++ configure
> +@@ -22758,6 +22758,7 @@ fi
> + for ac_func in backtrace ffs geteuid getuid issetugid getresuid \
> + getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
> + mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
> ++ mkostemp \
> + walkcontext setitimer poll epoll_create1
> + do :
> + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
>
> Added: head/x11-servers/xorg-vfbserver/files/patch-include_dix-config.h.in
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xorg-vfbserver/files/patch-include_dix-config.h.in Wed
> Jul 5 12:41:57 2017 (r445076) @@ -0,0 +1,12 @@
> +--- include/dix-config.h.in.orig 2016-07-19 17:07:29 UTC
> ++++ include/dix-config.h.in
> +@@ -140,6 +140,9 @@
> + /* Define to 1 if you have the <linux/fb.h> header file. */
> + #undef HAVE_LINUX_FB_H
> +
> ++/* Define to 1 if you have the `mkostemp' function. */
> ++#undef HAVE_MKOSTEMP
> ++
> + /* Define to 1 if you have the `mmap' function. */
> + #undef HAVE_MMAP
> +
>
> Added: head/x11-servers/xwayland/files/patch-Xext_shm.c
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xwayland/files/patch-Xext_shm.c Wed Jul 5 12:41:57
> 2017 (r445076) @@ -0,0 +1,14 @@
> +--- Xext/shm.c.orig 2016-07-19 17:14:21 UTC
> ++++ Xext/shm.c
> +@@ -1210,7 +1210,11 @@ shm_tmpfile(void)
> + }
> + ErrorF ("Not using O_TMPFILE\n");
> + #endif
> ++#ifdef HAVE_MKOSTEMP
> ++ fd = mkostemp(template, O_CLOEXEC);
> ++#else
> + fd = mkstemp(template);
> ++#endif
> + if (fd < 0)
> + return -1;
> + unlink(template);
>
> Added: head/x11-servers/xwayland/files/patch-configure
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xwayland/files/patch-configure Wed Jul 5 12:41:57
> 2017 (r445076) @@ -0,0 +1,10 @@
> +--- configure.orig 2017-01-11 21:16:40 UTC
> ++++ configure
> +@@ -22758,6 +22758,7 @@ fi
> + for ac_func in backtrace ffs geteuid getuid issetugid getresuid \
> + getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
> + mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
> ++ mkostemp \
> + walkcontext setitimer poll epoll_create1
> + do :
> + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
>
> Added: head/x11-servers/xwayland/files/patch-include_dix-config.h.in
> ============================================================================
> == --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ head/x11-servers/xwayland/files/patch-include_dix-config.h.in Wed Jul 5
> 12:41:57 2017 (r445076) @@ -0,0 +1,12 @@
> +--- include/dix-config.h.in.orig 2016-07-19 17:07:29 UTC
> ++++ include/dix-config.h.in
> +@@ -140,6 +140,9 @@
> + /* Define to 1 if you have the <linux/fb.h> header file. */
> + #undef HAVE_LINUX_FB_H
> +
> ++/* Define to 1 if you have the `mkostemp' function. */
> ++#undef HAVE_MKOSTEMP
> ++
> + /* Define to 1 if you have the `mmap' function. */
> + #undef HAVE_MMAP
> +
Please revert this unauthorized non-maintainer commit promptly. There was no
PR or review. Had there been, it would have been pointed out that the patch is
neither necessary nor correctly implemented in any sense.
excerpt of original code for reference:
fd = mkstemp(template);
if (fd < 0)
return -1;
unlink(template);
flags = fcntl(fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
(void) fcntl(fd, F_SETFD, &flags);
}
return fd
Since fcntl is used to add FD_CLOEXEC after the unlink, there is zero
functional difference between using mkstemp and mkostemp with O_CLOEXEC.
Therefore, the the patch is entirely unnecessary cruft.
Had the patch been needed, duplicating it into the slaves is not the correct
approach, nor is altering patch-configure (generated) without bothering to
update the patch to configure.ac.
More information about the svn-ports-all
mailing list