diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-09-29 19:00:40 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2011-09-29 19:00:40 +0800 |
commit | 68d300b061c7dee98196c2d1064e4dc0ce35ddea (patch) | |
tree | be781f26551217d1c7d8290a0a0e3012c4ef0fd4 | |
parent | bc468953b22ca78296382a03c26fa0402eaf5bda (diff) | |
download | pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.tar pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.tar.gz pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.tar.bz2 pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.tar.lz pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.tar.xz pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.tar.zst pttbbs-68d300b061c7dee98196c2d1064e4dc0ce35ddea.zip |
allow sysop edit only files in boards/home/man.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5405 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/more.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; |