Undo the unnecessary rewrite, which introduced bugs, and modernise ircd-seven's version instead. Also fix missing privset accounting which caused leaks (and use-after-frees in some corner cases), and play nicely with ed3ca2ff16a1dc921d90c0a67093de8f47209176.
Undo the unnecessary rewrite, which introduced bugs, and modernise ircd-seven's version instead. Also fix missing privset accounting which caused leaks (and use-after-frees in some corner cases), and play nicely with ed3ca2ff16a1dc921d90c0a67093de8f47209176.