From 68d300b061c7dee98196c2d1064e4dc0ce35ddea Mon Sep 17 00:00:00 2001 From: piaip Date: Thu, 29 Sep 2011 11:00:40 +0000 Subject: allow sysop edit only files in boards/home/man. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5405 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/more.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pttbbs/mbbsd/more.c b/pttbbs/mbbsd/more.c index 5ee5ab30..78c535ec 100644 --- a/pttbbs/mbbsd/more.c +++ b/pttbbs/mbbsd/more.c @@ -27,6 +27,17 @@ check_sysop_edit_perm(const char *fpath) strcmp(fpath, "etc/ve.hlp") == 0) return 0; + if (fpath) { + if (strstr(fpath, BBSHOME) == fpath) + fpath += (strlen(BBSHOME) + 1); + + // allow only files in board, man or home. + if (!(strstr(fpath, "boards/") == fpath || + strstr(fpath, "home/") == fpath || + strstr(fpath, "man/") == fpath)) + return 0; + } + #ifdef BN_SECURITY if (strcmp(currboard, BN_SECURITY) == 0) return 0; -- cgit v1.2.3