git: 57f92b10c34c - main - net/netatalk3: fix parsing of macOS created AppleDouble files
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jan 2024 07:49:50 UTC
The branch main has been updated by marcus:
URL: https://cgit.FreeBSD.org/ports/commit/?id=57f92b10c34cccaa7285d639707294c50daa8aa3
commit 57f92b10c34cccaa7285d639707294c50daa8aa3
Author: Joe Marcus Clarke <marcus@FreeBSD.org>
AuthorDate: 2024-01-02 07:48:52 +0000
Commit: Joe Marcus Clarke <marcus@FreeBSD.org>
CommitDate: 2024-01-02 07:48:52 +0000
net/netatalk3: fix parsing of macOS created AppleDouble files
Obtained from: https://github.com/Netatalk/netatalk/commit/a0d2bb957ba097849748c0febcac7e9ef041c65a?diff=unified&w=0
---
net/netatalk3/Makefile | 1 +
.../files/patch-libatalk_adouble_ad__open.c | 43 ++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/net/netatalk3/Makefile b/net/netatalk3/Makefile
index acacf59363ea..a297d24722ee 100644
--- a/net/netatalk3/Makefile
+++ b/net/netatalk3/Makefile
@@ -1,5 +1,6 @@
PORTNAME= netatalk
PORTVERSION= 3.1.18
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= net
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-${PORTVERSION:S/./-/g}
diff --git a/net/netatalk3/files/patch-libatalk_adouble_ad__open.c b/net/netatalk3/files/patch-libatalk_adouble_ad__open.c
new file mode 100644
index 000000000000..05102b8d34df
--- /dev/null
+++ b/net/netatalk3/files/patch-libatalk_adouble_ad__open.c
@@ -0,0 +1,43 @@
+--- libatalk/adouble/ad_open.c.orig 2024-01-02 07:44:09 UTC
++++ libatalk/adouble/ad_open.c
+@@ -668,6 +668,11 @@ reread:
+ int retry_read = 0;
+
+ reread:
++ if (hst == NULL) {
++ hst = &st;
++ EC_NEG1( fstat(ad_reso_fileno(ad), hst) );
++ }
++
+ LOG(log_debug, logtype_ad, "ad_header_read_osx: %s", path ? fullpathname(path) : "");
+ ad_init_old(&adosx, AD_VERSION_EA, ad->ad_options);
+ buf = &adosx.ad_data[0];
+@@ -707,7 +712,7 @@ reread:
+ return -1;
+ }
+
+- if (parse_entries(&adosx, nentries, header_len) != 0) {
++ if (parse_entries(&adosx, nentries, hst->st_size) != 0) {
+ LOG(log_warning, logtype_ad, "ad_header_read(%s): malformed AppleDouble",
+ path ? fullpathname(path) : "");
+ errno = EIO;
+@@ -725,6 +730,7 @@ reread:
+ }
+ retry_read++;
+ if (ad_convert_osx(path, &adosx) == 1) {
++ hst = NULL;
+ goto reread;
+ }
+ errno = EIO;
+@@ -738,11 +744,6 @@ reread:
+ LOG(log_error, logtype_ad, "ad_header_read_osx: problem with rfork entry offset.");
+ errno = EIO;
+ return -1;
+- }
+-
+- if (hst == NULL) {
+- hst = &st;
+- EC_NEG1( fstat(ad_reso_fileno(ad), &st) );
+ }
+
+ ad_setentryoff(ad, ADEID_RFORK, ad_getentryoff(&adosx, ADEID_RFORK));