Print

Print


Hello Fabrizio

I tried the GetChecksum perl interface (on linux) with the
latest version. It kind of works but produces a core after
calling.
The problem is in the usage of the shared buffer (char *sharedbuf)
in XrdClientAdmin_c.cc.

XrdGetChecksum() uses this buffer to hold the checksum returned from the
server (AFAIK). I think the core is produced if the buffer is to small.
I changed in XrdGetChecksum()

from:
memset(sharedbuf, 0, sizeof(sharedbuf));
adminst->GetChecksum((kXR_char *)path, (kXR_char *)sharedbuf);

to:
SharedBufRealloc(30);
memset(sharedbuf, 0, 30);
adminst->GetChecksum((kXR_char *)path, (kXR_char *)sharedbuf);

and then it works fine. Is there a better way to allocate the buffer?
I just choose a size (=30) that is safe for our purpose but it isn't
guaranteed that it will work if a different checksum algorithm is used
(Also not only the checksum but also a string is returned e.g.:
crc32 3140090365)

Cheers,
   Wilko