summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-16 13:57:38 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-16 13:57:38 +0800
commit83adb6993917757ba2d03854e082ca010a888aac (patch)
tree8f445bf199b054e144ea4f2874e868e909933098
parent95696e492ef929abbde0b0f05f4c96071cddc55a (diff)
downloadpttbbs-83adb6993917757ba2d03854e082ca010a888aac.tar
pttbbs-83adb6993917757ba2d03854e082ca010a888aac.tar.gz
pttbbs-83adb6993917757ba2d03854e082ca010a888aac.tar.bz2
pttbbs-83adb6993917757ba2d03854e082ca010a888aac.tar.lz
pttbbs-83adb6993917757ba2d03854e082ca010a888aac.tar.xz
pttbbs-83adb6993917757ba2d03854e082ca010a888aac.tar.zst
pttbbs-83adb6993917757ba2d03854e082ca010a888aac.zip
only BMs could copy directory in man
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@853 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/announce.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index e9068638..2b52bbc2 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -1,4 +1,4 @@
-/* $Id: announce.c,v 1.19 2003/03/28 14:30:40 in2 Exp $ */
+/* $Id: announce.c,v 1.20 2003/05/16 05:57:38 in2 Exp $ */
#include "bbs.h"
static void
@@ -1427,11 +1427,26 @@ a_menu(char *maintitle, char *path, int lastlevel)
case 'c':
if (me.now < me.num) {
+ boardheader_t *bp;
if (!isvisible_man(&me))
break;
+
+ if( !(bp = getbcache(getbnum(currboard))) )
+ break;
+
snprintf(fname, sizeof(fname), "%s/%s", path,
me.header[me.now - me.page].filename);
- a_copyitem(fname, me.header[me.now - me.page].title, 0, 1);
+
+ /* XXX: dirty fix
+ 應該要改成如果發現該目錄裡面有隱形目錄的話才拒絕.
+ 不過這樣的話須要整個搜一遍, 而且目前判斷該資料是目錄
+ 還是檔案竟然是用 fstat(2) 而不是直接存在 .DIR 內 |||b
+ 須等該資料寫入 .DIR 內再 implement才有效率.
+ */
+ if( !HAS_PERM(PERM_SYSOP) && !is_BM(bp->BM) && dashd(fname) )
+ vmsg("只有板主才可以拷貝目錄唷!");
+ else
+ a_copyitem(fname, me.header[me.now - me.page].title, 0, 1);
me.page = 9999;
break;
}