From d00edbdbd10efdd918837b5958dba4577be59e84 Mon Sep 17 00:00:00 2001 From: scw Date: Tue, 18 May 2004 09:14:32 +0000 Subject: Many changes in structure. Add sex restriction. git-svn-id: http://opensvn.csie.org/pttbbs/branches/scw.angel@1999 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/AngelConvert.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'util') diff --git a/util/AngelConvert.c b/util/AngelConvert.c index 04b4ac09..4d5cea07 100644 --- a/util/AngelConvert.c +++ b/util/AngelConvert.c @@ -6,25 +6,24 @@ int main(){ userec_t u; int count = 0; - orig_fd = open(BBSHOME "/.PASSWD", O_RDONLY); + orig_fd = open(BBSHOME "/.PASSWDS", O_RDONLY); if( orig_fd < 0 ){ - perror("opening " BBSHOME "/.PASSWD for reading"); + perror("opening " BBSHOME "/.PASSWDS for reading"); return 1; } - printf("Reading from " BBSHOME "/.PASSWD\n"); + printf("Reading from " BBSHOME "/.PASSWDS\n"); - new_fd = open(BBSHOME "/PASSWD.NEW", O_WRONLY); + new_fd = open(BBSHOME "/PASSWDS.NEW", O_WRONLY | O_CREAT | O_TRUNC, 0600); if( new_fd < 0 ){ - perror("opening " BBSHOME "/PASSWD.NEW for writing"); + perror("opening " BBSHOME "/PASSWDS.NEW for writing"); return 1; } - printf("Writing to " BBSHOME "/PASSWD.NEW\n"); + printf("Writing to " BBSHOME "/PASSWDS.NEW\n"); while(read(orig_fd, &u, sizeof(userec_t)) == sizeof(userec_t)){ - u.uflag2 &= 0x03ff; // clear 0x400 and 0x1000 + u.uflag2 &= 0x03ff; // clear 0x400, 0x800, and 0x3000 if( u.userlevel & OLD_PERM_NOOUTMAIL ) u.uflag2 |= REJ_OUTTAMAIL; - u.uflag2 |= BEING_ANGEL; u.userlevel &= ~PERM_ANGEL; bzero(u.myangel, IDLEN + 1); write(new_fd, &u, sizeof(userec_t)); -- cgit v1.2.3