Re: [問題] 想找來源判斷的程式碼

看板PttCurrent作者 ( )時間14年前 (2010/01/16 04:50), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《terrykyo (T.K.O)》之銘言: : 各位大大好 : 剛剛trace pttbbs的原始碼 : 想找出ip來源位置判斷故鄉的程式碼 : (也就是所屬哪個學校 哪個ISP的) : 但是沒找出來.. : 可以請問有人知道放在哪個檔案的函式嗎 : 感謝!! 產生畫面 mbbsd/talk.c: descript(): case 0: return (((uentp->pager != PAGER_DISABLE && uentp->pager != PAGER_ANTIWB && diff) || HasUserPerm(PERM_SYSOP)) ? uentp->from : "*"); 欄位設定 mbbsd/mbbsd.c: setup_utmp() # ifdef FROMD (ptt 的做法: 另外跑 daemon resolve) { int fd; if ( (fd = toconnect(FROMD_ADDR)) >= 0 ) { write(fd, fromhost, strlen(fromhost)); // zero and reuse uinfo.from to check real data memset(uinfo.from, 0, sizeof(uinfo.from)); read(fd, uinfo.from, sizeof(uinfo.from) - 1); // keep trailing zero close(fd); // copy back to currutmp if (uinfo.from[0]) strlcpy(currutmp->from, uinfo.from, sizeof(currutmp->from)); } } # else // !FROMD (比較簡單, 看看 where() 和 common/bbs/cache.c: reload_fcache() ) fromd daemon/fromd/fromd.c & daemon/fromd/ip_desc_db.c -- -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GCS/M/TW d- s:++(+) a--->-- C++$ ULB+>++ P++ L++ E---@ W+ N? o? K? w--(++) O-- !M V- PS-(--) PE- Y PGP- t+ 5? X R !tv b++ DI+ D+ G e h! !r z ------END GEEK CODE BLOCK------ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 128.36.229.167

01/18 02:14, , 1F
感謝!!
01/18 02:14, 1F
文章代碼(AID): #1BKDKYGn (PttCurrent)
文章代碼(AID): #1BKDKYGn (PttCurrent)