aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2017-07-02 03:17:15 +0000
committerJan Beich <jbeich@FreeBSD.org>2017-07-02 03:17:15 +0000
commit7d6471a18c6ddd810d0bfd7f661106c8bae6aba5 (patch)
tree604f88ae57a7f2d14c36f1d6fbf76887a5e67da8
parent5a21bf34777e5eeb331f6856601b76a70f663058 (diff)
downloadports-7d6471a18c6ddd810d0bfd7f661106c8bae6aba5.tar.gz
ports-7d6471a18c6ddd810d0bfd7f661106c8bae6aba5.zip
MFH: r444811
devel/glib20: fix symlink writing $ gio save testfile < /etc/shells $ ln -s testfile testlink $ gio save testlink < /etc/shells gio: file:///path/to/testlink: Error opening file '/path/to/testlink': Too many links PR: 212572 Reported by: Yuri Victorovich Submitted by: Ting-Wei Lan Approved by: maintainer timeout (3 weeks) Approved by: ports-secteam (feld)
Notes
Notes: svn path=/branches/2017Q2/; revision=444863
-rw-r--r--devel/glib20/Makefile2
-rw-r--r--devel/glib20/files/patch-gio_glocalfileoutputstream.c38
2 files changed, 39 insertions, 1 deletions
diff --git a/devel/glib20/Makefile b/devel/glib20/Makefile
index efd8e95e0d1e..0df97e53ba8e 100644
--- a/devel/glib20/Makefile
+++ b/devel/glib20/Makefile
@@ -3,7 +3,7 @@
PORTNAME= glib
PORTVERSION= 2.46.2
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= devel
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
diff --git a/devel/glib20/files/patch-gio_glocalfileoutputstream.c b/devel/glib20/files/patch-gio_glocalfileoutputstream.c
new file mode 100644
index 000000000000..9a373188836e
--- /dev/null
+++ b/devel/glib20/files/patch-gio_glocalfileoutputstream.c
@@ -0,0 +1,38 @@
+From 45d4b59e3f7ef7b41db08f0c11ee5000126cfedb Mon Sep 17 00:00:00 2001
+From: Ting-Wei Lan <lantw@src.gnome.org>
+Date: Sun, 4 Dec 2016 15:02:54 +0800
+Subject: [PATCH] glocalfileoutputstream: Fix symlink writing on FreeBSD and
+ NetBSD
+
+FreeBSD, DragonflyBSD and NetBSD support O_NOFOLLOW, but they use error
+numbers that are different from what POSIX standard specifies. They are
+not going to change the behavior, and existing programs on these systems
+already take advantage of this difference. To support them, we have to
+add a check in GIO to use different error numbers on these systems.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=775593
+---
+ gio/glocalfileoutputstream.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
+index 81184a671..4b3733cce 100644
+--- gio/glocalfileoutputstream.c
++++ gio/glocalfileoutputstream.c
+@@ -763,7 +763,13 @@ handle_overwrite_open (const char *filename,
+ #ifdef O_NOFOLLOW
+ is_symlink = FALSE;
+ fd = g_open (filename, open_flags | O_NOFOLLOW, mode);
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
++ if (fd == -1 && errno == EMLINK)
++#elif defined(__NetBSD__)
++ if (fd == -1 && errno == EFTYPE)
++#else
+ if (fd == -1 && errno == ELOOP)
++#endif
+ {
+ /* Could be a symlink, or it could be a regular ELOOP error,
+ * but then the next open will fail too. */
+--
+2.13.0
+