PathTools 3.26 issues
Julian Field
MailScanner at ecs.soton.ac.uk
Wed Jan 16 22:23:29 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I've done a diff of the code changes between 3.2501 (which works) and
3.26 (which doesn't).
The change is basically 1 line that calls a function which uses
"strlcpy()" several times.
In 3.2501, this line is not compiled, with the result that all the
strlcpy() code is totally optimised out by the compiler and then the linker.
In 3.26, this line is used, so all the strlcpy() code is compiled and
linked in.
Unfortunately, strlcpy() is not included in the GNU C library. According
to a Mac, strlcpy() does this:
The strlcpy() and strlcat() functions copy and concatenate strings
respectively. They are designed to be safer, more consistent, and less
error prone replacements for strncpy(3) and strncat(3). Unlike those
functions, strlcpy() and strlcat() take the full size of the buffer
(not
just the length) and guarantee to NUL-terminate the result (as long as
size is larger than 0 or, in the case of strlcat(), as long as there is
at least one byte free in dst). Note that you should include a
byte for
the NUL in size. Also note that strlcpy() and strlcat() only
operate on
true ``C'' strings. This means that for strlcpy() src must be
NUL-termi-
nated and for strlcat() both src and dst must be NUL-terminated.
The strlcpy() function copies up to size - 1 characters from the
NUL-ter-
minated string src to dst, NUL-terminating the result.
But Linux, for example, does not include strlcpy(). Oops.
There is no simple work-around that I can write in MailScanner to avoid
calling this code. The Perl function 'cwd' (read the current working
directory) now doesn't work in 3.26, and will cause Perl to bomb out
with this error:
/usr/bin/perl: symbol lookup error:
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/Cwd/Cwd.so:
undefined symbol: strlcpy
I really do need to read the current working directory once in a while.
So until the author of PathTools (File::Spec) chooses to include source
for strlcpy() in his module source code, this is going to stay broken.
Sorry, but that's it. He broke it.
I would be grateful if someone could contact the author of PathTools and
ask him to fix his code so that it works on rather more systems than it
does now (which is not many).
Jules
- --
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
PGP public key: http://www.jules.fm/julesfm.asc
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.7.0 (Build 1012)
Comment: Use Thunderbird's Enigmail add-on to verify this message
Charset: ISO-8859-1
wj8DBQFHjoPjEfZZRxQVtlQRAjPdAJ4rhJB9NoVJ4PJ53l6rJR1SrGjzcACg+K97
eQTTRsKuhMV5ZOAkOXeGcg4=
=iV10
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the MailScanner
mailing list