- 主题:新装的bbs程序,用老数据,没法登录了
老站的site.h里面,HAVE_USERMONEY未定义,HAVE_WFORUM是0
新站用的最新的CVS代码,拷贝老站的site.h过来后,
在最后一个#endif之前加上OWN_USEREC的定义,以及从老的struct.h中复制过来userec的定义.加的代码附后.
编译安装没问题,没有 make install-home
从旧站拷来数据,放到对应的地方.起bbs,所有用户都显示是不正确的用户帐号.
如果make install-home后再复制旧站数据
那么guest可以登录,看到版面,精华区等都成功转移了.
部分用户包括SYSOP可以输入密码,然后显示系统错误或封禁登录.
部分用户还是不正确的帐号.
老站上和新站上sizeof(struct userec)都是176
问题出在哪呢
#define OWN_USEREC 1
#ifdef HAVE_IPV6_SMTH
#define IPLEN 46 /* Length of most string data */
#else
#define IPLEN 16
#endif
/* old userec structure */
struct userec {
/* Structure used to hold information in */
char userid[ IDLEN + 2]; /* PASSFILE */
char flags; /*一些标志,戒网,版面排序之类的*/
unsigned char title; /*用户级别*/
time_t firstlogin;
char lasthost[ IPLEN];
unsigned int numlogins;
unsigned int numposts;
#ifdef CONV_PASS
char passwd[ OLDPASSLEN];
char unused_padding[ 2];
#endif
char username[ NAMELEN];
unsigned int club_read_rights[ MAXCLUB>>5];
unsigned int club_write_rights[ MAXCLUB>>5];
unsigned char md5passwd[ MD5PASSLEN];
#ifndef OS_64BIT
unsigned int userlevel;
#endif
time_t lastlogin;
time_t stay;
#ifdef OS_64BIT /* align 8 bytes... */
unsigned int userlevel;
#endif
int signature;
unsigned int userdefine[ 2];
time_t notedate;
int noteline;
int notemode;
time_t exittime;
/* 生日数据转移到 userdata 结构中 */
unsigned int usedspace; /* used space of user's mailbox, in bytes */
#ifdef HAVE_USERMONEY
int money;
int score;
char unused[ 20];
#endif
};
--
修改:diarytea FROM 211.151.90.*
FROM 211.151.90.*
新代码里面的site.h也是从旧站考的阿,然后加了最后那些,HAVE_WFORUM当然是0了
置底已经看了
后来能输密码的时候,如果输错,还是会说密码错阿
输对了就说系统错误或封禁登录
说明有些用户的密码还是读出来了
【 在 cnbird (阿七) 的大作中提到: 】
: HAVE_WFORUM是0 新代码里HAVE_WFORUM也是0么?否则就是1,那就不对吧
: 另外其他一些问题,参考看atppp关于数据结构改变的那篇文摘有没有帮助
--
FROM 211.151.90.*
【 在 atppp (Big Mouse) 的大作中提到: 】
: 标 题: Re: 新装的bbs程序,用老数据,没法登录了
: 发信站: 水木社区 (Mon Dec 19 18:01:37 2005), 转信
:
:
: 【 在 diarytea (相信且只相信一见钟情 日记茶) 的大作中提到: 】
: : 老站的site.h里面,HAVE_USERMONEY未定义,HAVE_WFORUM是0
: : 新站用的最新的CVS代码,拷贝老站的site.h过来后,
: : 在最后一个#endif之前加上OWN_USEREC的定义,以及从老的struct.h中复制过来userec的定义.加的代码附后.
: : 编译安装没问题,没有 make install-home
: : 从旧站拷来数据,放到对应的地方.起bbs,所有用户都显示是不正确的用户帐号.
: 这里你确定起bbs之前共享内存没东西?可以用root执行ipcs来确认。
起之前执行过
ipcs -m | awk '$0~/bbs/ {system(sprintf("ipcrm shm %s",$2));}'
: : 如果make install-home后再复制旧站数据
: : 那么guest可以登录,看到版面,精华区等都成功转移了.
: : 部分用户包括SYSOP可以输入密码,然后显示系统错误或封禁登录.
: : 部分用户还是不正确的帐号.
: 还是部分用户正确?正确的帐号有规律么...
没啥规律..
但是存在的用户,用guest看他的信息,上站次数,生命力,文章数等等都是错的
会不会是cpu存数据格式不一样的问题
老站是 TI UltraSparc II (BlackBird)
新站是 Intel(R) Celeron(R) CPU 2.66GHz
我不太清楚sparc是什么样的
: : 老站上和新站上sizeof(struct userec)都是176
: 这个是如何确认的?
比如在lazybm.c的main()最开头加个 printf("%d",sizeof(struct userec));
: 另是否开了ipv6
内核有这个...ifconfig也能看到,但是其他没配置过了
: 另error log是否看过有有用的信息
: 另...好奇怪啊,我暂时也不知道了
: : 问题出在哪呢
: : #define OWN_USEREC 1
: : #ifdef HAVE_IPV6_SMTH
: : #define IPLEN 46 /* Length of most string data */
: : #else
: : #define IPLEN 16
: : #endif
: : /* old userec structure */
: : struct userec {
: : /* Structure used to hold information in */
: : char userid[ IDLEN + 2]; /* PASSFILE */
: : char flags; /*一些标志,戒网,版面排序之类的*/
: : unsigned char title; /*用户级别*/
: : time_t firstlogin;
: : char lasthost[ IPLEN];
: : unsigned int numlogins;
: : unsigned int numposts;
: : #ifdef CONV_PASS
: : char passwd[ OLDPASSLEN];
: : char unused_padding[ 2];
: : #endif
: : char username[ NAMELEN];
: : unsigned int club_read_rights[ MAXCLUB>>5];
: : unsigned int club_write_rights[ MAXCLUB>>5];
: : unsigned char md5passwd[ MD5PASSLEN];
: : #ifndef OS_64BIT
: : unsigned int userlevel;
: : #endif
: : time_t lastlogin;
: : time_t stay;
: : #ifdef OS_64BIT /* align 8 bytes... */
: : unsigned int userlevel;
: : #endif
: : int signature;
: : unsigned int userdefine[ 2];
: : time_t notedate;
: : int noteline;
: : int notemode;
: : time_t exittime;
: : /* 生日数据转移到 userdata 结构中 */
: : unsigned int usedspace; /* used space of user's mailbox, in bytes */
: : #ifdef HAVE_USERMONEY
: : int money;
: : int score;
: : char unused[ 20];
: : #endif
: : };
:
:
: --
: ╭︿︿︿╮╭︿︿︿╮╭︿︿︿╮╭︿︿︿╮╭︿︿︿╮
: {/-◎◎-\}{/-◎◎-\}{/-◎◎-\}{/-◎◎-\}{/-◎◎-\}
: ( (oo) ) ( (oo) ) ( (oo) ) ( (oo) ) ( (oo) )
: ︶ ︶ ︶ ︶ ︶
:
:
: ※ 来源:·水木社区 newsmth.net·[FROM: 61.182.213.*]
--
FROM 211.151.90.*
我r.....
就是因为cpu所以以前附件不正常,然后换的新机器...考!服了
【 在 atppp (Big Mouse) 的大作中提到: 】
: sparc是big endian
: 80x86是little endian...
: 看起来问题就是这了...
: ...................
--
FROM 211.151.90.*
恩,把userec的字节序换了就都能登录了
不过.DIR的数据结构不太清楚,是不是就是fileheader?
另外版面文章的具体结构在哪里定义?
【 在 atppp (Big Mouse) 的大作中提到: 】
: sparc是big endian
: 80x86是little endian...
: 看起来问题就是这了...
: ...................
--
FROM 211.151.90.*
【 在 atppp (Big Mouse) 的大作中提到: 】
: 是
: 文章就是纯文本的阿...
是指带附件的,具体在哪里写了?
: 不过貌似要大小endian转换的话,还有好多磁盘数据文件都要转
拣几个最主要的转了算了.版面不转的话,直接fixdir,term能看,但是Re:都变成了●,所有文章是同一个主题.web看不了.
: ...................
--
FROM 211.151.90.*
etn core告诉我说
带附件的文章,正文和附件中间有一段存附件大小的,这个要搞一下..
【 在 atppp (Big Mouse) 的大作中提到: 】
: 附件结构没有大小endian转换的问题,那里面的int是大endian,而且无论什么机器上都是
--
FROM 211.151.90.*
got it!!
thanks
!
【 在 tombcy (tombcy) 的大作中提到: 】
: 附件得
: 版面 ctl+g 6 附件 ,看 acore 的 m文章
: 精华区 4 2 4 3,你也看看吧
: ...................
--
FROM 211.151.90.*
恩都搞定了
带附件的文章不用转
转了 .DIR .DINGDIR .DIGEST .BOARDS .PASSWDS
删了 .ORIGIN .MARK
删了 .favboard
其他的没管了
【 在 atppp (Big Mouse) 的大作中提到: 】
: 附件结构没有大小endian转换的问题,那里面的int是大endian,而且无论什么机器上都是
--
FROM 211.151.90.*
见我re的a core的文章,呵呵
【 在 tombcy (tombcy) 的大作中提到: 】
: 附件为什么不转了?
--
FROM 211.151.90.*