Bug 185862 - Netatalk3 sig 11 with TM and zeroconf
Summary: Netatalk3 sig 11 with TM and zeroconf
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-18 17:20 UTC by Josh Paetzel
Modified: 2014-01-18 23:00 UTC (History)
0 users

See Also:


Attachments
file.diff (2.00 KB, patch)
2014-01-18 17:20 UTC, Josh Paetzel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Paetzel freebsd_committer freebsd_triage 2014-01-18 17:20:00 UTC
afpd bails out with a sig 11 when the following settings are set in afp.conf:

zeroconf = yes (G) # which is the default
timemachine = yes (V)

And netatalk is compiled to use mDNSResponder instead of avahi for zeroconf

Fix: Patch attached

Patch attached with submission follows:
Comment 1 Joe Marcus Clarke freebsd_committer freebsd_triage 2014-01-18 22:35:49 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-18 22:35:50 UTC
Author: marcus
Date: Sat Jan 18 22:35:41 2014
New Revision: 340219
URL: http://svnweb.freebsd.org/changeset/ports/340219
QAT: https://qat.redports.org/buildarchive/r340219/

Log:
  * Fix a segfault when Zeroconf is enabled with Timemachine [1]
  * Convert to new-style LIB_DEPENDS
  
  PR:		185862 [1]
  Submitted by:	jpaetzel [1]

Added:
  head/net/netatalk3/files/patch-etc_afpd_afp_mdns.c   (contents, props changed)
Modified:
  head/net/netatalk3/Makefile

Modified: head/net/netatalk3/Makefile
==============================================================================
--- head/net/netatalk3/Makefile	Sat Jan 18 22:21:51 2014	(r340218)
+++ head/net/netatalk3/Makefile	Sat Jan 18 22:35:41 2014	(r340219)
@@ -3,7 +3,7 @@
 
 PORTNAME=	netatalk
 PORTVERSION=	3.1.0
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	net
 MASTER_SITES=	SF
@@ -15,8 +15,8 @@ COMMENT=	File server for Mac OS X
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	gcrypt:${PORTSDIR}/security/libgcrypt \
-    		event-2:${PORTSDIR}/devel/libevent2
+LIB_DEPENDS=	libgcrypt.so:${PORTSDIR}/security/libgcrypt \
+    		libevent-2.so:${PORTSDIR}/devel/libevent2
 
 USE_AUTOTOOLS=	libtool
 USE_BDB=	46+

Added: head/net/netatalk3/files/patch-etc_afpd_afp_mdns.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/netatalk3/files/patch-etc_afpd_afp_mdns.c	Sat Jan 18 22:35:41 2014	(r340219)
@@ -0,0 +1,34 @@
+--- etc/afpd/afp_mdns.c.orig	2013-10-28 06:43:13.000000000 -0700
++++ etc/afpd/afp_mdns.c	2014-01-17 22:10:59.000000000 -0800
+@@ -37,17 +37,15 @@
+  * Its easier to use asprintf to set the TXT record values
+  */
+ #define TXTRecordPrintf(rec, key, args, ...) {           \
+-        char *str;                                      \
+-        asprintf(&str, args);                           \
++        char str[1024];                                      \
++        sprintf(str, args);                           \
+         TXTRecordSetValue(rec, key, strlen(str), str);  \
+-        free(str);                                      \
+     }
+ #define TXTRecordKeyPrintf(rec, k, var, args, ...) {     \
+-        char *key, *str;                                \
+-        asprintf(&key, k, var);                         \
+-        asprintf(&str, args);                           \
++        char key[1024], str[1024];                                \
++        sprintf(key, k, var);                         \
++        sprintf(str, args);                           \
+         TXTRecordSetValue(rec, key, strlen(str), str);  \
+-        free(str); free(key);                           \
+     }
+ 
+ static struct pollfd *fds;
+@@ -134,7 +132,7 @@
+ 
+     /* Register our service, prepare the TXT record */
+     TXTRecordCreate(&txt_adisk, 0, NULL);
+-    TXTRecordPrintf(&txt_adisk, "sys", "waMa=0,adVF=0x100");
++    TXTRecordPrintf(&txt_adisk, "sys", "waMa=0,adVF=0x100", NULL);
+ 
+     /* Build AFP volumes list */
+     int i = 0;
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-01-18 22:57:54 UTC
Author: marcus
Date: Sat Jan 18 22:57:42 2014
New Revision: 340223
URL: http://svnweb.freebsd.org/changeset/ports/340223
QAT: https://qat.redports.org/buildarchive/r340223/

Log:
  MFH: (r340219)
  
  Fix a segfault when Zeroconf is enabled with Timemachine.
  
  PR:		185862
  Submitted by:	jpaetzel
  Approved by:	portmgr

Added:
  branches/2014Q1/net/netatalk3/files/patch-etc_afpd_afp_mdns.c
     - copied unchanged from r340219, head/net/netatalk3/files/patch-etc_afpd_afp_mdns.c
Modified:
  branches/2014Q1/net/netatalk3/Makefile

Modified: branches/2014Q1/net/netatalk3/Makefile
==============================================================================
--- branches/2014Q1/net/netatalk3/Makefile	Sat Jan 18 22:57:37 2014	(r340222)
+++ branches/2014Q1/net/netatalk3/Makefile	Sat Jan 18 22:57:42 2014	(r340223)
@@ -3,7 +3,7 @@
 
 PORTNAME=	netatalk
 PORTVERSION=	3.1.0
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES=	net
 MASTER_SITES=	SF

Copied: branches/2014Q1/net/netatalk3/files/patch-etc_afpd_afp_mdns.c (from r340219, head/net/netatalk3/files/patch-etc_afpd_afp_mdns.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2014Q1/net/netatalk3/files/patch-etc_afpd_afp_mdns.c	Sat Jan 18 22:57:42 2014	(r340223, copy of r340219, head/net/netatalk3/files/patch-etc_afpd_afp_mdns.c)
@@ -0,0 +1,34 @@
+--- etc/afpd/afp_mdns.c.orig	2013-10-28 06:43:13.000000000 -0700
++++ etc/afpd/afp_mdns.c	2014-01-17 22:10:59.000000000 -0800
+@@ -37,17 +37,15 @@
+  * Its easier to use asprintf to set the TXT record values
+  */
+ #define TXTRecordPrintf(rec, key, args, ...) {           \
+-        char *str;                                      \
+-        asprintf(&str, args);                           \
++        char str[1024];                                      \
++        sprintf(str, args);                           \
+         TXTRecordSetValue(rec, key, strlen(str), str);  \
+-        free(str);                                      \
+     }
+ #define TXTRecordKeyPrintf(rec, k, var, args, ...) {     \
+-        char *key, *str;                                \
+-        asprintf(&key, k, var);                         \
+-        asprintf(&str, args);                           \
++        char key[1024], str[1024];                                \
++        sprintf(key, k, var);                         \
++        sprintf(str, args);                           \
+         TXTRecordSetValue(rec, key, strlen(str), str);  \
+-        free(str); free(key);                           \
+     }
+ 
+ static struct pollfd *fds;
+@@ -134,7 +132,7 @@
+ 
+     /* Register our service, prepare the TXT record */
+     TXTRecordCreate(&txt_adisk, 0, NULL);
+-    TXTRecordPrintf(&txt_adisk, "sys", "waMa=0,adVF=0x100");
++    TXTRecordPrintf(&txt_adisk, "sys", "waMa=0,adVF=0x100", NULL);
+ 
+     /* Build AFP volumes list */
+     int i = 0;
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"