[Spread-users] problem re-using private names with 3.17.0
Jeremy Hylton
jeremy at zope.com
Thu Oct 24 13:11:41 EDT 2002
We have some applications that re-use private names. I tried running
some tests with a 3.17.0+ build, i.e. a fresh CVS checkout. Our test
applications all fail because they can't use the same private name
more than once. I suspect this behavior is a bug introduced in
3.17.0.
I've attached a simple test program that is passed a private name as
its argument. It does an SP_connect(), SP_disconnect(), sleep(), and
a second SP_connect() with the same name. The second SP_connect()
always fails with a REJECT_NOT_UNIQUE. It seems that the only way I
can convince spread to forget about a name is to restart the daemon.
I'd be happy to provide more clues, but I'm not sure what to look for.
Jeremy
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "sp.h"
char name[9];
void testconnect()
{
int err, mbox = 0;
char private[MAX_GROUP_NAME + 1];
err = SP_connect("4803 at jeremy", name, 0, 1, &mbox, private);
if (err == ACCEPT_SESSION)
fprintf(stderr, "connected as %s\n", private);
else {
fprintf(stderr, "failed to connect: %d\n", err);
return;
}
SP_disconnect(mbox);
}
main(int argc, char *argv[])
{
int f = open("/dev/urandom", O_RDONLY);
strncpy(name, argv[1], 8);
name[8] = 0;
testconnect();
sleep(10);
testconnect();
}
More information about the Spread-users
mailing list