]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_expire.c
* Variable names, comments, documentation, etc... removed the acronym 'BBS'
[citadel.git] / citadel / serv_expire.c
index 80e4ea20288fef0063ca7c70bcfd1bf5721f7db9..5995d80edd6749545e96f08f04a4f2c0e9ab56f4 100644 (file)
@@ -360,7 +360,7 @@ void do_uid_user_purge(struct ctdluser *us, void *data) {
 #ifdef ENABLE_AUTOLOGIN
        struct PurgeList *pptr;
 
-       if ((us->uid != (-1)) && (us->uid != BBSUID)) {
+       if ((us->uid != (-1)) && (us->uid != CTDLUID)) {
                if (getpwuid(us->uid) == NULL) {
                        pptr = (struct PurgeList *)
                                malloc(sizeof(struct PurgeList));
@@ -432,6 +432,11 @@ void do_user_purge(struct ctdluser *us, void *data) {
         */
        if (us->timescalled == 0) purge = 1;
 
+       /* User number 0, as well as any negative user number, is
+        * also impossible.
+        */
+       if (us->usernum < 1L) purge = 1;
+
        if (purge == 1) {
                pptr = (struct PurgeList *) malloc(sizeof(struct PurgeList));
                pptr->next = UserPurgeList;
@@ -632,7 +637,7 @@ void purge_databases(void) {
         * last twelve hours.  This is usually enough granularity.
         */
        now = time(NULL);
-       memcpy(&tm, localtime(&now), sizeof(struct tm));
+       localtime_r(&now, &tm);
        if (tm.tm_hour != config.c_purge_hour) return;
        if ((now - last_purge) < 43200) return;