Samba historically only had one way to generate random numbers, to avoid developers choosing a weak RNG accidentially it was safer to just generate good random number for everything, and we would often directly use /dev/urandom for that, or an RC4 stream from that. Now we have GnuTLS and it has 3 levels of still very good random numbers, we should use generate_nonce_buffer() where we need a unique buffer (eg a GUID) not a key-strength buffer. It may not make a lot of difference in practice, but the main detail is that this uses GNUTLS_RND_NONCE, which works of a pool itself seeded from the GNUTLS_RND_RANDOM pool, so triggers less calls for system entropy.