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/cleanident.c | |
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/cleanident.c')
-rw-r--r-- | util/cleanident.c | 19 |
1 files changed, 19 insertions, 0 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; +} |