summaryrefslogtreecommitdiffstats
path: root/innbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-10 01:29:36 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-10 01:29:36 +0800
commit90451291f8f509d0f0e3f1c442bb3325de30d9b0 (patch)
tree1d5737feb5cb95e231206b875c21d2d8f88607c6 /innbbsd
parenta0baab6a9bbe6e76779927273f3faeba5b4d3990 (diff)
downloadpttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.tar
pttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.tar.gz
pttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.tar.bz2
pttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.tar.lz
pttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.tar.xz
pttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.tar.zst
pttbbs-90451291f8f509d0f0e3f1c442bb3325de30d9b0.zip
boards/<hash>/<brdname>
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@15 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd')
-rw-r--r--innbbsd/bbslink.c20
-rw-r--r--innbbsd/bbslink2.c22
-rw-r--r--innbbsd/receive_article.c32
3 files changed, 37 insertions, 37 deletions
diff --git a/innbbsd/bbslink.c b/innbbsd/bbslink.c
index 2b0b6f37..fa5716ac 100644
--- a/innbbsd/bbslink.c
+++ b/innbbsd/bbslink.c
@@ -460,7 +460,7 @@ save_article(board, filename, sover)
if (Verbose)
printf("<save_article> %s %s\n", board, filename);
- FN = fopen(fileglue("%s/boards/%s/%s", BBSHOME, board, filename), "w");
+ FN = fopen(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), "w");
if (FN == NULL)
{
bbslog("<save_article> err: %s %s\n", board, filename);
@@ -484,7 +484,7 @@ save_article(board, filename, sover)
times.actime = sover->mtime;
times.modtime = sover->mtime;
- utime(fileglue("%s/boards/%s/%s", BBSHOME, board, filename), &times);
+ utime(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), &times);
utime(fileglue("%s/.bcache/%s", BBSHOME, board), NULL);
}
#endif
@@ -508,7 +508,7 @@ process_article(board, filename, userid, nickname, subject)
{
subject = "µLĂD";
}
- filepath = fileglue("%s/boards/%s/%s", BBSHOME, board, filename);
+ filepath = fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename);
if (isfile(filepath))
{
linkoverview_t lover;
@@ -682,17 +682,17 @@ read_outgoing(sover)
#endif
}
BODY = "";
- FD = open(fileglue("%s/boards/%s/%s", BBSHOME, board, filename), O_RDONLY);
+ FD = open(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), O_RDONLY);
if (FD < 0)
{
if (Verbose)
- printf(" !! can't open %s/boards/%s/%s\n", BBSHOME, board, filename);
+ printf(" !! can't open %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename);
else
- fprintf(stderr, "can't open %s/boards/%s/%s\n", BBSHOME, board, filename);
+ fprintf(stderr, "can't open %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename);
return -1;
}
- FD_SIZE = filesize(fileglue("%s/boards/%s/%s", BBSHOME, board, filename));
+ FD_SIZE = filesize(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename));
if (FD_BUF == NULL)
{
FD_BUF = (char *) mymalloc(FD_SIZE + 1 + strlen(COMMENT));
@@ -709,7 +709,7 @@ read_outgoing(sover)
FD_END += strlen(COMMENT);
if (Verbose)
{
- printf("<read in> %s/boards/%s/%s\n", BBSHOME, board, filename);
+ printf("<read in> %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename);
}
*ORGANIZATION = '\0';
@@ -1301,7 +1301,7 @@ cancel_outgoing(board, filename, from, subject)
bbslog("<cancel_outgoing> Try to move moderated post from %s to deleted\n", board);
if (Verbose)
printf("Try to move moderated post from %s to deleted\n", board);
- FN = popen(fileglue("%s/bbspost post %s/boards/deleted > %s",
+ FN = popen(fileglue("%s/bbspost post %s/boards/d/deleted > %s",
INNDHOME, BBSHOME, TMPFILE), "w");
if (FN == NULL)
{
@@ -1323,7 +1323,7 @@ cancel_outgoing(board, filename, from, subject)
if (strncmp(result, "post to ", 8) == 0)
{
/* try to remove it */
- strncpy(filepath, fileglue("%s/boards/%s/%s", BBSHOME, board, filename), sizeof filepath);
+ strncpy(filepath, fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), sizeof filepath);
if (isfile(filepath))
{
Rename(filepath, fileglue("%s.cancel", filepath));
diff --git a/innbbsd/bbslink2.c b/innbbsd/bbslink2.c
index d79c23a9..70d39766 100644
--- a/innbbsd/bbslink2.c
+++ b/innbbsd/bbslink2.c
@@ -427,7 +427,7 @@ save_article(board, filename, sover)
if (Verbose)
printf("<save_article> %s %s\n", board, filename);
- FN = fopen(fileglue("%s/boards/%s/%s", BBSHOME, board, filename), "w");
+ FN = fopen(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), "w");
if (FN == NULL)
{
bbslog("<save_article> err: %s %s\n", board, filename);
@@ -451,7 +451,7 @@ save_article(board, filename, sover)
times.actime = sover->mtime;
times.modtime = sover->mtime;
- utime(fileglue("%s/boards/%s/%s", BBSHOME, board, filename), &times);
+ utime(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), &times);
utime(fileglue("%s/.bcache/%s", BBSHOME, board), NULL);
}
#endif
@@ -475,7 +475,7 @@ process_article(board, filename, userid, nickname, subject)
{
subject = "µLĂD";
}
- filepath = fileglue("%s/boards/%s/%s", BBSHOME, board, filename);
+ filepath = fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename);
if (isfile(filepath))
{
linkoverview_t lover;
@@ -649,17 +649,17 @@ read_outgoing(sover)
#endif
}
BODY = "";
- FD = open(fileglue("%s/boards/%s/%s", BBSHOME, board, filename), O_RDONLY);
+ FD = open(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), O_RDONLY);
if (FD < 0)
{
if (Verbose)
- printf(" !! can't open %s/boards/%s/%s\n", BBSHOME, board, filename);
+ printf(" !! can't open %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename);
else
- fprintf(stderr, "can't open %s/boards/%s/%s\n", BBSHOME, board, filename);
+ fprintf(stderr, "can't open %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename);
return -1;
}
- FD_SIZE = filesize(fileglue("%s/boards/%s/%s", BBSHOME, board, filename));
+ FD_SIZE = filesize(fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename));
if (FD_BUF == NULL)
{
FD_BUF = (char *) mymalloc(FD_SIZE + 1 + strlen(COMMENT));
@@ -676,7 +676,7 @@ read_outgoing(sover)
FD_END += strlen(COMMENT);
if (Verbose)
{
- printf("<read in> %s/boards/%s/%s\n", BBSHOME, board, filename);
+ printf("<read in> %s/boards/%c/%s/%s\n", BBSHOME, board[0], board, filename);
}
*ORGANIZATION = '\0';
@@ -1248,7 +1248,7 @@ cancel_outgoing(board, filename, from, subject)
bbslog("<cancel_outgoing> Try to move moderated post from %s to deleted\n", board);
if (Verbose)
printf("Try to move moderated post from %s to deleted\n", board);
- FN = popen(fileglue("%s/bbspost post %s/boards/deleted > %s",
+ FN = popen(fileglue("%s/bbspost post %s/boards/d/deleted > %s",
INNDHOME, BBSHOME, TMPFILE), "w");
if (FN == NULL)
{
@@ -1270,7 +1270,7 @@ cancel_outgoing(board, filename, from, subject)
if (strncmp(result, "post to ", 8) == 0)
{
/* try to remove it */
- strncpy(filepath, fileglue("%s/boards/%s/%s", BBSHOME, board, filename), sizeof filepath);
+ strncpy(filepath, fileglue("%s/boards/%c/%s/%s", BBSHOME, board[0], board, filename), sizeof filepath);
if (isfile(filepath))
{
Rename(filepath, fileglue("%s.cancel", filepath));
@@ -1691,7 +1691,7 @@ woju
/*
woju
*/
- sprintf(OUTING, "%s/boards/%s/", BBSHOME, argv[1]);
+ sprintf(OUTING, "%s/boards/%c/%s/", BBSHOME, argv[1][0], argv[1]);
fname = OUTING + strlen(OUTING);
if (initial_bbs("link") == 0)
diff --git a/innbbsd/receive_article.c b/innbbsd/receive_article.c
index 40f2609c..d036fe41 100644
--- a/innbbsd/receive_article.c
+++ b/innbbsd/receive_article.c
@@ -466,7 +466,7 @@ receive_article()
{
goto boardcont;
}
- boardhome = (char *) fileglue("%s/boards/%s", BBSHOME, boardptr);
+ boardhome = (char *) fileglue("%s/boards/%c/%s", BBSHOME, boardptr[0], boardptr);
if (!isdir(boardhome))
{
bbslog(":Err: unable to write %s\n", boardhome);
@@ -485,8 +485,8 @@ receive_article()
fname = (char *) fileglue("%s/%s", boardptr, fname);
if (firstpath[0] == '\0')
{
- sprintf(firstpath, "%s/boards/%s", BBSHOME, fname);
- firstpathbase = firstpath + strlen(BBSHOME) + strlen("/boards/");
+ sprintf(firstpath, "%s/boards/%c, %s", BBSHOME, fname[0], fname);
+ firstpathbase = firstpath + strlen(BBSHOME) + strlen("/boards/x/");
}
if (strlen(fname) + strlen(hispaths) + 1 < sizeof(hispaths))
{
@@ -540,7 +540,7 @@ receive_control()
newsfeeds_t *nf;
bbslog("control post %s\n", HEADER[CONTROL_H]);
- boardhome = (char *) fileglue("%s/boards/control", BBSHOME);
+ boardhome = (char *) fileglue("%s/boards/c/control", BBSHOME);
testandmkdir(boardhome);
*firstpath = '\0';
if (isdir(boardhome))
@@ -549,12 +549,12 @@ receive_control()
if (fname != NULL)
{
if (firstpath[0] == '\0')
- sprintf(firstpath, "%s/boards/control/%s", BBSHOME, fname);
+ sprintf(firstpath, "%s/boards/c/control/%s", BBSHOME, fname);
if (storeDB(HEADER[MID_H], (char *) fileglue("control/%s", fname)) < 0)
{
}
bbsfeedslog(fileglue("control/%s", fname), 'C');
- firstpathbase = firstpath + strlen(BBSHOME) + strlen("/boards/");
+ firstpathbase = firstpath + strlen(BBSHOME) + strlen("/boards/x/");
splitptr = (char **) BNGsplit(GROUPS);
for (ngptr = *splitptr; ngptr != NULL; ngptr = *(++splitptr))
{
@@ -611,7 +611,7 @@ cancel_article_front(msgid)
{
*ptr++ = '\0';
}
- sprintf(filename, "%s/boards/%s", BBSHOME, file);
+ sprintf(filename, "%s/boards/%c/%s", BBSHOME, file[0], file);
bbslog("cancel post %s\n", filename);
if (isfile(filename))
{
@@ -653,7 +653,7 @@ cancel_article_front(msgid)
#ifdef KEEP_NETWORK_CANCEL
bbslog("cancel post %s\n", filename);
- boardhome = (char *) fileglue("%s/boards/deleted", BBSHOME);
+ boardhome = (char *) fileglue("%s/boards/d/deleted", BBSHOME);
testandmkdir(boardhome);
if (isdir(boardhome))
{
@@ -685,8 +685,8 @@ cancel_article_front(msgid)
{
if (firstpath[0] == '\0')
{
- sprintf(firstpath, "%s/boards/deleted/%s", BBSHOME, fname);
- firstpathbase = firstpath + strlen(BBSHOME) + strlen("/boards/");
+ sprintf(firstpath, "%s/boards/d/deleted/%s", BBSHOME, fname);
+ firstpathbase = firstpath + strlen(BBSHOME) + strlen("/boards/x/");
}
if (storeDB(HEADER[MID_H], (char *) fileglue("deleted/%s", fname)) < 0)
{
@@ -700,7 +700,7 @@ cancel_article_front(msgid)
{
char board[256];
newsfeeds_t *nf;
- char *filebase = filename + strlen(BBSHOME) + strlen("/boards/");
+ char *filebase = filename + strlen(BBSHOME) + strlen("/boards/x/");
char *filetail = strrchr(filename, '/');
if (filetail != NULL)
{
@@ -900,10 +900,10 @@ cancelpost(fileheader_t *fhdr, char* boardname)
int fd;
char fpath[MAXPATHLEN];
- sprintf(fpath, BBSHOME "/boards/%s/%s", boardname, fhdr->filename);
+ sprintf(fpath, BBSHOME "/boards/%c/%s/%s", boardname[0], boardname, fhdr->filename);
if ((fd = open(fpath, O_RDONLY)) >= 0) {
fileheader_t postfile;
- char fn2[MAXPATHLEN] = BBSHOME "/boards/deleted", *junkdir;
+ char fn2[MAXPATHLEN] = BBSHOME "/boards/d/deleted", *junkdir;
stampfile(fn2, &postfile);
memcpy(postfile.owner, fhdr->owner, IDLEN + TTLEN + 10);
@@ -1039,7 +1039,7 @@ cancel_article(homepath, board, file)
return 0;
}
size = sizeof(header);
- sprintf(dirname, "%s/boards/%s/.DIR", homepath, board);
+ sprintf(dirname, "%s/boards/%c/%s/.DIR", homepath, board[0], board);
if ((fd = open(dirname, O_RDONLY)) == -1) {
bbslog("cancel_article: open `%s` error\n", dirname);
return 0;
@@ -1173,11 +1173,11 @@ cancel_article(homepath, board, file)
PATH bdir;
struct stat stbuf;
- sprintf(bdir, "%s/boards/%s", homepath, board);
+ sprintf(bdir, "%s/boards/%c/%s", homepath, board[0], board);
stat(bdir, &stbuf);
#endif
- sprintf(fname, "%s/boards/%s/%s", homepath, board, file);
+ sprintf(fname, "%s/boards/%c/%s/%s", homepath, board[0], board, file);
unlink(fname);
/* kill it now! the function is far small then original.. :) */
/* because it won't make system load heavy like before */