- if (strlen(initok) >= sizeof(sessions.store[0]->token)) {
- fprintf(stderr, "Error: initial token '%s' too long (max length 36)", initok);
+ if (initok == NULL)
+ /* without token, a secret is made to forbid creation of sessions */
+ new_uuid(sessions.initok);
+ else if (strlen(initok) < sizeof(sessions.store[0]->token))
+ strcpy(sessions.initok, initok);
+ else {
+ ERROR("initial token '%s' too long (max length 36)", initok);