发现编译安装没什么问题
但是转化.PASSWDS好像不正确
原来的用户无法登录
有些郁闷
老的struct.h如下
struct userec {
char userid[IDLEN + 2];
char flags[2];
time_t firstlogin;
char lasthost[16];
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];
unsigned userlevel;
time_t lastlogin;
time_t stay;
int signature;
unsigned int userdefine;
time_t notedate;
int noteline;
int notemode;
time_t exittime;
#ifdef HAVE_BIRTHDAY
char gender;
unsigned char birthyear;
unsigned char birthmonth;
unsigned char birthday;
#endif
unsigned int usedspace; /* used space of user's mailbox, in bytes */
};
cnv_passwd_define2.c的struct userec1里面没有最后关于生日定义的这几行
main里面的转化部分如下
while (fread(&bh, sizeof(struct userec1), 1, fp)) {
memset(&bhnew, 0, sizeof(struct userec2));
memcpy(&bhnew, &bh, sizeof(struct userec1));
bhnew.flags = bh.flags[0];
bhnew.title = 0;
bhnew.userdefine[1] = -1;
bhnew.notedate = bh.notedate;
bhnew.noteline = bh.noteline;
bhnew.notemode = bh.notemode;
bhnew.exittime = bh.exittime;
bhnew.usedspace = bh.usedspace;
fwrite(&bhnew, sizeof(struct userec2), 1, fp2);
printf("ok \n");
}
运行后发现.PASSWDS跟.PASSWDS.OLD相比,在第一组FF FF FF FF后面又增加了四个字节
的FF,大概是userdefine增加的吧,我不是很清楚。
--
FROM 219.224.195.142