More spelling fixes across source4/
[samba.git] / source4 / nbt_server / wins / winsserver.c
index 4b8b8cc137aa5f0ddcfd00908f12368d61882440..95d22242b31cdb359105799993c4478c88ca5de2 100644 (file)
@@ -281,8 +281,8 @@ static void wins_wack_allow(struct nbtd_wins_wack_state *s)
        rec->registered_by = s->src->addr;
 
        /*
-        * now remove all addresses that're the client doesn't hold anymore
-        * and update the time stamp and owner for the ownes that are still there
+        * now remove all addresses that the client doesn't hold anymore
+        * and update the time stamp and owner for the ones that are still there
         */
        for (i=0; rec->addresses[i]; i++) {
                bool found = false;
@@ -496,6 +496,11 @@ static void nbtd_winsserver_register(struct nbt_name_socket *nbtsock,
                goto done;
        }
 
+       if (name->scope && strlen(name->scope) > 237) {
+               rcode = NBT_RCODE_SVR;
+               goto done;
+       }
+
        duplicate_packet = wins_check_wack_queue(iface, packet, src);
        if (duplicate_packet) {
                /* just ignore the packet */
@@ -664,8 +669,7 @@ static void nbtd_wins_randomize1Clist(struct loadparm_context *lp_ctx,
        if (num_addrs <= 1) return; /* nothing to do */
 
        /* first sort the addresses depending on the matching to the client */
-       ldb_qsort(addresses, num_addrs , sizeof(addresses[0]),
-                 src, (ldb_qsort_cmp_fn_t)nbtd_wins_randomize1Clist_sort);
+       LDB_TYPESAFE_QSORT(addresses, num_addrs, src, nbtd_wins_randomize1Clist_sort);
 
        mask = lp_parm_string(lp_ctx, NULL, "nbtd", "wins_randomize1Clist_mask");
        if (!mask) {
@@ -874,6 +878,10 @@ static void nbtd_winsserver_release(struct nbt_name_socket *nbtsock,
                goto done;
        }
 
+       if (name->scope && strlen(name->scope) > 237) {
+               goto done;
+       }
+
        status = winsdb_lookup(winssrv->wins_db, name, packet, &rec);
        if (!NT_STATUS_IS_OK(status)) {
                goto done;