summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pttbbs/UPDATING4
-rw-r--r--pttbbs/include/perm.h8
-rw-r--r--pttbbs/upgrade/Makefile6
-rw-r--r--pttbbs/upgrade/r5734.c41
4 files changed, 51 insertions, 8 deletions
diff --git a/pttbbs/UPDATING b/pttbbs/UPDATING
index 251752cc..3025bc23 100644
--- a/pttbbs/UPDATING
+++ b/pttbbs/UPDATING
@@ -23,6 +23,10 @@ https://opensvn.csie.org/traccgi/pttbbs/changeset/2273
make r4871_uflag
-----------------------------------------------------------------------------
+r5734: [cleanup]
+userec_t 裡很多東西以後可能要挪作它用,跑一下 upgrade/r5734 可以把資料清空。
+早作早好。
+
r5663: [fromd/where]
中文故鄉 (pttbbs.conf:WHERE) 改由 FROMD 來提供,移除原 cache + mbbsd 的機制.
好處是: (1) 減少 reload cache 所花時間 (2) 避免 duplicated code.
diff --git a/pttbbs/include/perm.h b/pttbbs/include/perm.h
index 302ed73e..4080935e 100644
--- a/pttbbs/include/perm.h
+++ b/pttbbs/include/perm.h
@@ -23,15 +23,12 @@
#define PERM_BBSADM 000000100000 /* BBSADM */
#define PERM_NOTOP 000000200000 /* 不列入排行榜 */
#define PERM_VIOLATELAW 000000400000 /* 違法通緝中 */
-#ifdef PLAY_ANGEL
#define PERM_ANGEL 000001000000 /* 有資格擔任小天使 */
-#endif
-#define OLD_PERM_NOOUTMAIL 000001000000 /* 不接受站外的信 */
-#define PERM_NOREGCODE 000002000000 /*不允許認證碼註冊*/
+#define PERM_NOREGCODE 000002000000 /* 不允許認證碼註冊 */
#define PERM_VIEWSYSOP 000004000000 /* 視覺站長 */
#define PERM_LOGUSER 000010000000 /* 觀察使用者行蹤 */
#define PERM_NOCITIZEN 000020000000 /* 搋奪公權 */
-#define PERM_SYSSUPERSUBOP 000040000000 /* 群組長 */
+#define PERM_SYSSUPERSUBOP 000040000000 /* 群組長 */
#define PERM_ACCTREG 000100000000 /* 帳號審核組 */
#define PERM_PRG 000200000000 /* 程式組 */
#define PERM_ACTION 000400000000 /* 活動組 */
@@ -40,6 +37,7 @@
#define PERM_SYSSUBOP 004000000000 /* 小組長 */
#define PERM_OLDSYSOP 010000000000 /* 退休站長 */
#define PERM_POLICE 020000000000 /* 警察 */
+// 32 個已經全部用光了。 後面沒有了。
#define NUMPERMS 32
diff --git a/pttbbs/upgrade/Makefile b/pttbbs/upgrade/Makefile
index 373ba4ac..f26967d9 100644
--- a/pttbbs/upgrade/Makefile
+++ b/pttbbs/upgrade/Makefile
@@ -9,10 +9,10 @@ CFLAGS+= -DPTTBBS_UTIL
BBSBASE= $(SRCROOT)/include/var.h
UTIL_OBJS= \
- util_var.o
+ ../util/util_var.o
-LDLIBS+= $(SRCROOT)/common/sys/libcmsys.a \
- $(SRCROOT)/common/bbs/libcmbbs.a
+LDLIBS+= $(UTIL_OBJS) $(SRCROOT)/common/bbs/libcmbbs.a \
+ $(SRCROOT)/common/sys/libcmsys.a
all:
echo "Usually you won't build everything for upgrading, so we let you decide what to run."
diff --git a/pttbbs/upgrade/r5734.c b/pttbbs/upgrade/r5734.c
new file mode 100644
index 00000000..65e406d2
--- /dev/null
+++ b/pttbbs/upgrade/r5734.c
@@ -0,0 +1,41 @@
+#define _UTIL_C_
+#include "bbs.h"
+
+#define CLEAR(x) memset(&(u->x), 0, sizeof(u->x))
+
+int check(void *data, int n, userec_t *u)
+{
+ if (!u->userid[0])
+ return 0;
+ fprintf(stderr, "%d\r", n);
+
+ // clear unused data
+ CLEAR(_unused);
+ CLEAR(_unused1);
+ CLEAR(_unused3);
+ CLEAR(_unused4);
+ CLEAR(_unused5);
+ CLEAR(_unused6);
+ CLEAR(_unused7);
+ CLEAR(_unused8);
+ CLEAR(_unused9);
+ CLEAR(_unused10);
+ CLEAR(_unused11);
+ CLEAR(_unused12);
+ // flush
+ passwd_update(n+1, u);
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ now = time(NULL);
+ chdir(BBSHOME);
+
+ attach_SHM();
+ if(passwd_init())
+ exit(1);
+ passwd_apply(NULL, check);
+
+ return 0;
+}