From: Wilfried Goesgens Date: Mon, 22 Dec 2014 18:45:39 +0000 (+0100) Subject: The new base 64 encoder adds linebreaks, we need to remove them again for the list... X-Git-Tag: v9.01~75 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=3ea9847837af221d22494eebeb8b08826db0fb25 The new base 64 encoder adds linebreaks, we need to remove them again for the list subscription tokens --- diff --git a/citadel/modules/listsub/serv_listsub.c b/citadel/modules/listsub/serv_listsub.c index 889926ac4..ada4bbadd 100644 --- a/citadel/modules/listsub/serv_listsub.c +++ b/citadel/modules/listsub/serv_listsub.c @@ -57,17 +57,21 @@ void listsub_generate_token(char *buf) { char sourcebuf[SIZ]; static int seq = 0; + size_t len; /* Theo, please sit down and shut up. This key doesn't have to be * tinfoil-hat secure, it just needs to be reasonably unguessable * and unique. */ - sprintf(sourcebuf, "%lx", + len = sprintf(sourcebuf, "%lx", (long) (++seq + getpid() + time(NULL)) ); /* Convert it to base64 so it looks cool */ - CtdlEncodeBase64(buf, sourcebuf, strlen(sourcebuf), 0); + len = CtdlEncodeBase64(buf, sourcebuf, len, 0); + if (buf[len - 1] == '\n') { + buf[len - 1] = '\0'; + } } const RoomNetCfg ActiveSubscribers[] = {listrecp, digestrecp};