summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/perm.h8
-rw-r--r--mbbsd/admin.c5
-rw-r--r--mbbsd/bbs.c2
-rw-r--r--mbbsd/board.c6
-rw-r--r--mbbsd/mail.c8
-rw-r--r--mbbsd/var.c4
-rw-r--r--util/uhash_loader.c14
7 files changed, 24 insertions, 23 deletions
diff --git a/include/perm.h b/include/perm.h
index 03e5b432..c49de88e 100644
--- a/include/perm.h
+++ b/include/perm.h
@@ -28,21 +28,21 @@
#define PERM_VIEWSYSOP 000004000000 /* 視覺站長 */
#define PERM_LOGUSER 000010000000 /* 觀察使用者行蹤 */
#define PERM_NOCITIZEN 000020000000 /* 搋奪公權 */
-#define PERM_RELATION 000040000000 /* 公關組 */
+#define PERM_SYSSUPERSUBOP 000040000000 /* 群組長 */
#define PERM_ACCTREG 000100000000 /* 帳號審核組 */
#define PERM_PRG 000200000000 /* 程式組 */
#define PERM_ACTION 000400000000 /* 活動組 */
#define PERM_PAINT 001000000000 /* 美工組 */
#define PERM_LAW 002000000000 /* 立法組 */
#define PERM_SYSSUBOP 004000000000 /* 小組長 */
-#define PERM_MSYSOP 010000000000 /* 一級主管 */
+#define PERM_OLDSYSOP 010000000000 /* 退休站長 */
#define PERM_PTT 020000000000 /* Ptt */
#define NUMPERMS 32
#define PERM_DEFAULT (PERM_BASIC | PERM_CHAT | PERM_PAGE )
-#define PERM_MANAGER (PERM_RELATION | PERM_ACCTREG | PERM_ACTION | PERM_PAINT | PERM_LAW)
-#define PERM_ADMIN (PERM_ACCOUNTS | PERM_SYSOP | PERM_SYSSUBOP | PERM_MANAGER | PERM_BM)
+#define PERM_MANAGER (PERM_ACCTREG | PERM_ACTION | PERM_PAINT | PERM_LAW)
+#define PERM_ADMIN (PERM_ACCOUNTS | PERM_SYSOP | PERM_SYSSUBOP | PERM_SYSSUPERSUBOP | PERM_MANAGER | PERM_BM)
#define PERM_ALLBOARD (PERM_SYSOP | PERM_BOARD)
#define PERM_LOGINCLOAK (PERM_SYSOP | PERM_ACCOUNTS)
#define PERM_SEEULEVELS (PERM_SYSOP)
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index eb6b47d1..9a0fd4e0 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -404,7 +404,7 @@ m_mod_board(char *bname)
snprintf(genbuf, sizeof(genbuf), "(E)設定 (V)違法/解除%s%s [Q]取消?",
HasUserPerm(PERM_SYSOP |
PERM_BOARD) ? " (B)Vote (S)救回 (C)合併 (G)賭盤解卡" : "",
- HasUserPerm(PERM_SYSSUBOP | PERM_BOARD) ? " (D)刪除" : "");
+ HasUserPerm(PERM_SYSSUBOP | PERM_SYSSUPERSUBOP | PERM_BOARD) ? " (D)刪除" : "");
getdata(10, 0, genbuf, ans, 3, LCECHO);
switch (*ans) {
@@ -482,7 +482,8 @@ m_mod_board(char *bname)
}
break;
case 'd':
- if (!HasUserPerm(PERM_SYSOP | PERM_BOARD))
+ if (!(HasUserPerm(PERM_SYSOP | PERM_BOARD) ||
+ (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP())))
break;
getdata_str(9, 0, msg_sure_ny, genbuf, 3, LCECHO, "N");
if (genbuf[0] != 'y' || !bname[0])
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 04a802ad..234b5444 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -3051,7 +3051,7 @@ change_cooldown(int ent, const fileheader_t * fhdr, const char *direct)
{
boardheader_t *bp = getbcache(currbid);
- if (!HasUserPerm(PERM_SYSOP))
+ if (!(HasUserPerm(PERM_SYSOP) || (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP())))
return DONOTHING;
if (bp->brdattr & BRD_COOLDOWN) {
diff --git a/mbbsd/board.c b/mbbsd/board.c
index bf5867d9..01a529cb 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -880,7 +880,8 @@ choose_board(int newflag)
brdnum = -1;
break;
case 'D':
- if (HasUserPerm(PERM_SYSOP)) {
+ if (HasUserPerm(PERM_SYSOP) ||
+ (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP())) {
ptr = &nbrd[num];
if (ptr->myattr & NBRD_SYMBOLIC) {
if (getans("確定刪除連結?[N/y]") == 'y')
@@ -912,7 +913,8 @@ choose_board(int newflag)
brdnum = -1;
break;
case 'L':
- if (HasUserPerm(PERM_SYSOP) && IN_CLASS()) {
+ if ((HasUserPerm(PERM_SYSOP) ||
+ (HasUserPerm(PERM_SYSSUPERSUBOP) && GROUPOP())) && IN_CLASS()) {
if (make_symbolic_link_interactively(class_bid) < 0)
break;
brdnum = -1;
diff --git a/mbbsd/mail.c b/mbbsd/mail.c
index 0d57a8bc..dd69aba9 100644
--- a/mbbsd/mail.c
+++ b/mbbsd/mail.c
@@ -202,8 +202,12 @@ void
setupmailusage(void)
{ // Ptt: get_sum_records is a bad function
int max_keepmail = MAX_KEEPMAIL;
- if( HasUserPerm(PERM_SYSSUBOP | PERM_ACCTREG | PERM_PRG |
- PERM_ACTION | PERM_PAINT) ){
+ if (HasUserPerm(PERM_SYSSUPERSUBOP)) {
+ mailsumlimit = 900;
+ max_keepmail = 700;
+ }
+ else if (HasUserPerm(PERM_SYSSUBOP | PERM_ACCTREG | PERM_PRG |
+ PERM_ACTION | PERM_PAINT)) {
mailsumlimit = 700;
max_keepmail = 500;
} else if (HasUserPerm(PERM_BM)) {
diff --git a/mbbsd/var.c b/mbbsd/var.c
index 11a77017..b6e50000 100644
--- a/mbbsd/var.c
+++ b/mbbsd/var.c
@@ -30,14 +30,14 @@ const char * const str_permid[] = {
"視覺站長", /* PERM_VIEWSYSOP */
"觀察使用者行蹤", /* PERM_LOGUSER */
"禠奪公權", /* PERM_NOCITIZEN */
- "公關組", /* PERM_RELATION */
+ "群組長", /* PERM_SYSSUPERSUBOP */
"帳號審核組", /* PERM_ACCTREG */
"程式組", /* PERM_PRG */
"活動組", /* PERM_ACTION */
"美工組", /* PERM_PAINT */
"立法組", /* PERM_LAW */
"小組長", /* PERM_SYSSUBOP */
- "一級主管", /* PERM_LSYSOP */
+ "退休站長", /* PERM_OLDSYSOP */
"Ptt" /* PERM_PTT */
};
diff --git a/util/uhash_loader.c b/util/uhash_loader.c
index 0654d60c..3400e153 100644
--- a/util/uhash_loader.c
+++ b/util/uhash_loader.c
@@ -12,10 +12,8 @@ SHM_t *SHM;
int main()
{
-#ifndef USE_HUGETLB
setgid(BBSGID);
setuid(BBSUID);
-#endif
chdir(BBSHOME);
load_uhash();
return 0;
@@ -25,20 +23,16 @@ void load_uhash(void) {
int shmid, err;
shmid = shmget(SHM_KEY, SHMSIZE,
#ifdef USE_HUGETLB
- SHM_HUGETLB | 0666 |
-#else
- 0600 |
+ SHM_HUGETLB |
#endif
- IPC_CREAT | IPC_EXCL);
+ 0600 | IPC_CREAT | IPC_EXCL);
err = errno;
if( err == EEXIST )
shmid = shmget(SHM_KEY, SHMSIZE,
#ifdef USE_HUGETLB
- SHM_HUGETLB | 0666 |
-#else
- 0600 |
+ SHM_HUGETLB |
#endif
- IPC_CREAT);
+ 0600 | IPC_CREAT);
if( shmid < 0 ){
perror("shmget");