diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-08 10:33:00 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-08 10:33:00 +0800 |
commit | bf85ed1d1979c65a6bb93ae965dd50282e6326a5 (patch) | |
tree | 4876079b39216faf595aa52b439b82443862c383 /util | |
parent | 3345b9246e647a9080038ad91c2440de864147f3 (diff) | |
download | pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.tar pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.tar.gz pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.tar.bz2 pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.tar.lz pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.tar.xz pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.tar.zst pttbbs-bf85ed1d1979c65a6bb93ae965dd50282e6326a5.zip |
remove personal ident for registration.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2580 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/cleanident.c | 19 | ||||
-rw-r--r-- | util/indexuser.c | 6 |
2 files changed, 19 insertions, 6 deletions
diff --git a/util/cleanident.c b/util/cleanident.c new file mode 100644 index 00000000..0d32374c --- /dev/null +++ b/util/cleanident.c @@ -0,0 +1,19 @@ +/* $Id$ */ +#include "bbs.h" + +int main(int argc, char **argv) +{ + userec_t usr; + int fd, i; + if( argc == 1 || (fd = open(argv[1], O_RDWR)) < 0 ){ + fprintf(stderr, "usage: cleanident path_to_passwd\n"); + return 1; + } + for( i = 0 ; read(fd, &usr, sizeof(usr)) == sizeof(usr) ; ++ i ){ + memset(usr.pad0, 0, sizeof(usr.pad0)); + if( lseek(fd, i * sizeof(usr), SEEK_SET) != -1 ) + write(fd, &usr, sizeof(usr)); + } + printf("%d users cleaned\n", i); + return 0; +} diff --git a/util/indexuser.c b/util/indexuser.c index cc5ba78a..9807197b 100644 --- a/util/indexuser.c +++ b/util/indexuser.c @@ -32,7 +32,6 @@ int main(int argc, char **argv) system("rm -rf "INDEXPATH"/ident"); mkdir(INDEXPATH"/realname",0700); mkdir(INDEXPATH"/email",0700); - mkdir(INDEXPATH"/ident",0700); for(j = 1; j <= MAX_USERS; j++) { passwd_query(j, &u); if(!u.userid[0]) continue; @@ -46,11 +45,6 @@ int main(int argc, char **argv) sprintf(buf,INDEXPATH"/email/%X",string_hash(u.email)); append_record(buf, (fileheader_t*)&j, sizeof(j)); } - if(u.ident[0]) - { - sprintf(buf,INDEXPATH"/ident/%X",string_hash(u.ident)); - append_record(buf, (fileheader_t*)&j, sizeof(j)); - } } return 0; } |