summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/AngelConvert.c36
-rw-r--r--util/bbsmail.c2
2 files changed, 37 insertions, 1 deletions
diff --git a/util/AngelConvert.c b/util/AngelConvert.c
new file mode 100644
index 00000000..94c42cb4
--- /dev/null
+++ b/util/AngelConvert.c
@@ -0,0 +1,36 @@
+#include "bbs.h"
+
+int main(){
+ int i;
+ int orig_fd, new_fd;
+ userec_t u;
+ int count = 0;
+
+ orig_fd = open(BBSHOME "/.PASSWD", O_RDONLY);
+ if( orig_fd < 0 ){
+ perror("opening " BBSHOME "/.PASSWD for reading");
+ return 1;
+ }
+ printf("Reading from " BBSHOME "/.PASSWD\n");
+
+ new_fd = open(BBSHOME "/PASSWD.NEW", O_WRONLY);
+ if( new_fd < 0 ){
+ perror("opening " BBSHOME "/PASSWD.NEW for writing");
+ return 1;
+ }
+ printf("Writing to " BBSHOME "/PASSWD.NEW\n");
+
+ while(read(orig_fd, &u, sizeof(userec_t)) == sizeof(userec_t)){
+ u.uflag2 &= 0x03ff; // clear 0x400 and 0x1000
+ if( u.userlevel & OLD_PERM_NOOUTMAIL )
+ u.uflag2 |= REJ_OUTTAMAIL;
+ u.userlevel &= ~PERM_ANGEL;
+ write(new_fd, &u, sizeof(userec_t));
+ ++count;
+ }
+
+ close(orig_fd);
+ close(new_fd);
+ printf("Done, totally %d accounts transfered\n", count);
+ return 0;
+}
diff --git a/util/bbsmail.c b/util/bbsmail.c
index a58d5763..dd015099 100644
--- a/util/bbsmail.c
+++ b/util/bbsmail.c
@@ -93,7 +93,7 @@ int mail2bbs(char *userid)
return -1;//EX_NOUSER;
}
- if( xuser.userlevel & PERM_NOOUTMAIL )
+ if( xuser.uflag2 & REJ_OUTTAMAIL )
return -1; //不接受站外信
sprintf(filename, BBSHOME "/home/%c/%s", userid[0], userid);