Tomasz Sterna wrote:
> Dnia 06-05-2007, N o godzinie 01:23 -0700, Michael Collette napisaƂ(a):
>> At present the FreeBSD ports tree still has the 2.0.11 up there.  That 
>> version 
>> is pretty unstable so I set about trying to upgrade to 2.1.4.
> 
> I'm glad to see that there is a move to the 2.1 series.
> 
> 
>> My first problem was with compiling 2.1.4.  The mod_announce.c file tried 
>> doing a calculation with timezone.  I took that out, back to what the 2.0.11 
>> version had, and I was able to compile properly.
> 
> Well... Removing features to fix compilation problems is not really a
> way to go.

Yeah, I knew that when I did it.  Not much of a C programmer, but I was 
feeling pretty stubborn about getting it working.

> What exact problem with timezone did you have?
> We could work on a solution for it.

Here's the snippet just about when the build failed...
----------------------------------------------------------------------------
/bin/sh ../libtool --tag=CC    --mode=compile cc -DHAVE_CONFIG_H -I. -I.. 
-DCONFIG_DIR=\"/usr/local/etc/jabberd\" 
-DLIBRARY_DIR=\"/usr/local/lib/jabberd\"   -I/usr/local/include/mysql 
-I/usr/local/include  -pipe -g -MT mod_announce.lo -MD -MP -MF 
.deps/mod_announce.Tpo -c -o mod_announce.lo mod_announce.c
  cc -DHAVE_CONFIG_H -I. -I.. -DCONFIG_DIR=\"/usr/local/etc/jabberd\" 
-DLIBRARY_DIR=\"/usr/local/lib/jabberd\" -I/usr/local/include/mysql 
-I/usr/local/include -pipe -g -MT mod_announce.lo -MD -MP -MF 
.deps/mod_announce.Tpo -c mod_announce.c  -fPIC -DPIC -o .libs/mod_announce.o
mod_announce.c: In function `_announce_load':
mod_announce.c:104: error: invalid operands to binary -
----------------------------------------------------------------------------

>> The bulk of my problems after I compiled had to do with the strndup() 
>> function.  After a bit of research I found that this is a rather Linux 
>> specific function not supported on FreeBSD.
> 
> Yes. My manual for strdup() family functions says it's a GNU extension.
> 
> 
>> I took these down to strdup() 
>> functions and things appear to continue to work nicely.  I honestly don't 
>> know 
>> what further ramifications there are from doing this.
> 
> These strndup()s are there for a reason: They protect from buffer overruns.
> 
> The way to fix it is to put strndup() implementation in subst/ directory and 
> check
> wether it is needed during ./configure.

I figured that my little fix was way less than optimal, but the correct 
solution was beyond my abilities.  Thankfully I'm only running this on a 
private LAN behind a firewall.  I definitely wouldn't feel good about running 
with this cheap hack on a publicly available server.

>> I haven't yet sent my port change upstream to the FreeBSD tree just yet.  I 
>> was rather hoping fixes might get put into place with the actual source 
>> code, 
>> thus removing the need to track patches to keep FreeBSD up to date with 
>> jabberd.
> 
> I'm always for fixing things in mainline.
> Even distribution specific things may be integrated into mainline if they do 
> not
 > introduce incompatibilities.

If fixes can be worked in so we can dodge my cheap hacks for a true FreeBSD 
version, I'm all for it.  I'd send you patch files with the correct fixes if I 
knew how to do them.  Other than that, I'd be happy to run any testing on this 
end that might help this along.

Later on,
-- 
"In theory, there is no difference between theory and practice.
In practice, there is."
- Yogi Berra
_______________________________________________
jabberd2 mailing list
[email protected]
http://lists.xiaoka.com/listinfo.cgi/jabberd2-xiaoka.com

Reply via email to