From: Art Cancro Date: Wed, 15 Jun 2022 12:54:38 +0000 (-0400) Subject: Handle system accounts differently in auto purger X-Git-Tag: v957~2 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=49b52e4ae6cd698246f088997adba3f37bd59291;p=citadel.git Handle system accounts differently in auto purger --- diff --git a/citadel/server/modules/expire/serv_expire.c b/citadel/server/modules/expire/serv_expire.c index ca51edd09..e92ae6c4a 100644 --- a/citadel/server/modules/expire/serv_expire.c +++ b/citadel/server/modules/expire/serv_expire.c @@ -391,14 +391,7 @@ void do_user_purge(char *username, void *data) { if (us.usernum < 0L) purge = 1; // Don't purge user 0. That user is there for the system - if (us.usernum == 0L) { - // FIXME: Temporary log message. Until we do unauth access with user 0 we should - // try to get rid of all user 0 occurences. Many will be remnants from old code so - // we will need to try and purge them from users data bases.Some will not have names but - // those with names should be purged. - syslog(LOG_DEBUG, "Auto purger found a user 0 with name <%s>", us.fullname); - // purge = 0; - } + if (us.usernum == 0L) purge = 0; // If the user has no full name entry then we can't purge them since the actual purge can't find them. // This shouldn't happen but does somehow. diff --git a/citadel/server/user_ops.c b/citadel/server/user_ops.c index 0603fc79c..d45e50044 100644 --- a/citadel/server/user_ops.c +++ b/citadel/server/user_ops.c @@ -566,6 +566,11 @@ int CtdlLoginExistingUser(const char *trythisname) { } } + // User 0 is a system account and must not be used by a real user + if (&CC->user.usernum <= 0) { + return login_not_found; + } + // Did we find something? if (found_user == 0) { if (((CC->nologin)) && (CC->user.axlevel < AxAideU)) {