]> jfr.im git - solanum.git/blobdiff - extensions/sasl_usercloak.c
callerid: actually the guard should be for source_p
[solanum.git] / extensions / sasl_usercloak.c
index 26e4f52fcb0376160b3a91d856467ad85d68459d..c70b0812900679ee09aeb9edbada43cd3d31f61f 100644 (file)
@@ -46,10 +46,12 @@ check_new_user(void *vdata)
        if (EmptyString(source_p->user->suser))
                return;
 
-       char *accountpart = strstr(source_p->orighost, "account");
-       if (!accountpart)
+       char *accountpart = strstr(source_p->orighost, "/account");
+       if (!accountpart || accountpart[8] != '\0')
                return;
 
+       accountpart += 1;
+
        char buf[HOSTLEN];
        memset(buf, 0, sizeof(buf));
        char *dst = buf;
@@ -95,7 +97,7 @@ check_new_user(void *vdata)
 
                unsigned int hashval = fnv_hash_string(source_p->user->suser);
                hashval %= 100000000; // eight digits only please.
-               snprintf(dst, 9, "%08ud", hashval);
+               snprintf(dst, 9, "%08u", hashval);
        }
 
        /* just in case */