]> jfr.im git - irc/quakenet/newserv.git/commitdiff
CHANSERV: don't delete the last user/channel to prevent id reuse 4/head
authorChris Porter <redacted>
Sun, 24 Jan 2016 14:48:00 +0000 (14:48 +0000)
committerChris Porter <redacted>
Sun, 24 Jan 2016 14:48:00 +0000 (14:48 +0000)
chanserv/chanserv_cleanupdb.c

index 210c99eb643125728cc113072a716cbe4617161f..3dd3131cba88494e5aa5f20d6a9e9f4899624f1a 100644 (file)
@@ -102,6 +102,10 @@ static void cleanupdb_real(DBConn *dbconn, void *arg) {
       if (anp->marker == themarker)
         continue;
 
+      /* HACK: don't ever delete the last user -- prevents userids being reused */
+      if (vrup->ID == lastuserID)
+        continue;
+
       if(!anp->nicks && !UHasStaffPriv(vrup) && !UIsCleanupExempt(vrup)) {
         if(vrup->lastauth && (vrup->lastauth < to_age)) {
           expired++;
@@ -126,6 +130,10 @@ static void cleanupdb_real(DBConn *dbconn, void *arg) {
       if (!(rcp=cip->exts[chanservext]))
         continue;
 
+      /* HACK: don't ever delete the last channel -- prevents channelids being reused */
+      if (rcp->ID == lastchannelID)
+        continue;
+
       /* there's a bug here... if no joins or modes are done within the threshold
        * and someone leaves just before the cleanup then the channel will be nuked.
        */