summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-03-13 19:59:56 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-03-13 19:59:56 +0800
commit9f537c69f49981771442e49951a74dc3d6fa5269 (patch)
treecd65a06109e74fa6f01ecbb6605a0b7869e2c7f4 /mbbsd/bbs.c
parentb66bcd428ebaa8b382e354f164f5b697c88704c3 (diff)
downloadpttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.tar
pttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.tar.gz
pttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.tar.bz2
pttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.tar.lz
pttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.tar.xz
pttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.tar.zst
pttbbs-9f537c69f49981771442e49951a74dc3d6fa5269.zip
use Copy() instead Link() for most cases
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2613 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 9431f532..fff7418e 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -12,24 +12,6 @@ static char * const badpost_reason[] = {
};
#endif
-static void
-mail_by_link(char *owner, char *title, char *path)
-{
- char genbuf[200];
- fileheader_t mymail;
-
- sethomepath(genbuf, cuser.userid);
- stampfile(genbuf, &mymail);
- strlcpy(mymail.owner, owner, sizeof(mymail.owner));
- snprintf(mymail.title, sizeof(mymail.title), title);
- unlink(genbuf);
- Link(path, genbuf);
- sethomedir(genbuf, cuser.userid);
-
- append_record(genbuf, &mymail, sizeof(mymail));
-}
-
-
void
anticrosspost(void)
{
@@ -40,8 +22,8 @@ anticrosspost(void)
post_violatelaw(cuser.userid, "Ptt系統警察", "Cross-post", "罰單處份");
cuser.userlevel |= PERM_VIOLATELAW;
cuser.vl_count++;
- mail_by_link("Ptt警察部隊", "Cross-Post罰單",
- BBSHOME "/etc/crosspost.txt");
+ mail_id(cuser.userid, "Cross-Post罰單",
+ "etc/crosspost.txt", "Ptt警察部隊");
u_exit("Cross Post");
exit(0);
}
@@ -417,6 +399,7 @@ do_unanonymous_post(char *fpath)
if (dashd(genbuf)) {
stampfile(genbuf, &mhdr);
unlink(genbuf);
+ // XXX: Link should use ~/ or BBSHOME/blah
Link(fpath, genbuf);
strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner));
strlcpy(mhdr.title, save_title, sizeof(mhdr.title));
@@ -762,7 +745,7 @@ do_general(int isbid)
sethomepath(genbuf, quote_user);
stampfile(genbuf, &postfile);
unlink(genbuf);
- Link(fpath, genbuf);
+ Copy(fpath, genbuf);
strlcpy(postfile.owner, cuser.userid, sizeof(postfile.owner));
strlcpy(postfile.title, save_title, sizeof(postfile.title));
@@ -2415,7 +2398,7 @@ good_post(int ent, fileheader_t * fhdr, char *direct)
digest.filemode = 0;
snprintf(genbuf2, sizeof(genbuf2), "%s%s", buf, fhdr->filename);
- Link(genbuf2, genbuf);
+ Copy(genbuf2, genbuf);
strcpy(ptr, fn_mandex);
append_record(buf, &digest, sizeof(digest));