Jelajahi Sumber

* Rename TMPPASS to PASS1 and USERENTRY_PASS to PASS2

Bryan Drewery 17 tahun lalu
induk
melakukan
262e8d9f1e
3 mengubah file dengan 9 tambahan dan 10 penghapusan
  1. 6 7
      src/userent.c
  2. 2 2
      src/userrec.c
  3. 1 1
      src/users.h

+ 6 - 7
src/userent.c

@@ -52,7 +52,7 @@ void init_userent()
   add_entry_type(&USERENTRY_ARCH);
   add_entry_type(&USERENTRY_OSVER);
   add_entry_type(&USERENTRY_PASS);
-  add_entry_type(&USERENTRY_TMPPASS);
+  add_entry_type(&USERENTRY_PASS1);
   add_entry_type(&USERENTRY_SECPASS);
   add_entry_type(&USERENTRY_HOSTS);
   add_entry_type(&USERENTRY_STATS);
@@ -606,11 +606,10 @@ struct user_entry_type USERENTRY_PASS =
   def_get,
   pass_set,
   NULL,
-  "PASS1"
+  "PASS2"
 };
 
-/* FIXME: remove after 1.2.3 */
-static bool tmppass_set(struct userrec *u, struct user_entry *e, void *buf)
+static bool pass1_set(struct userrec *u, struct user_entry *e, void *buf)
 {
   register char *pass = (char *) buf;
 
@@ -632,11 +631,11 @@ static bool tmppass_set(struct userrec *u, struct user_entry *e, void *buf)
       e->u.extra = encrypt_string(u->handle, pass);
   }
   if (!noshare)
-    shareout("c TMPPASS %s %s\n", u->handle, pass ? pass : "");
+    shareout("c PASS1 %s %s\n", u->handle, pass ? pass : "");
   return 1;
 }
 
-struct user_entry_type USERENTRY_TMPPASS =
+struct user_entry_type USERENTRY_PASS1 =
 {
   0,
   def_gotshare,
@@ -646,7 +645,7 @@ struct user_entry_type USERENTRY_TMPPASS =
   def_get,
   tmppass_set,
   NULL,
-  "TMPPASS"
+  "PASS1"
 };
 
 

+ 2 - 2
src/userrec.c

@@ -291,7 +291,7 @@ bool user_has_host(const char *handle, struct userrec *u, char *host)
 
 void convert_password(struct userrec *u)
 {
-  char *oldpass = (char *) get_user(&USERENTRY_TMPPASS, u);
+  char *oldpass = (char *) get_user(&USERENTRY_PASS1, u);
 
   if (oldpass && oldpass[0]) {
     char *pass = NULL;
@@ -310,7 +310,7 @@ void convert_password(struct userrec *u)
 
     /* clear old record */
     noshare = 1;
-    set_user(&USERENTRY_TMPPASS, u, NULL);
+    set_user(&USERENTRY_PASS1, u, NULL);
     noshare = 0;
   }
   

+ 1 - 1
src/users.h

@@ -47,7 +47,7 @@ extern struct user_entry_type USERENTRY_COMMENT, USERENTRY_LASTON,
  USERENTRY_INFO, USERENTRY_BOTADDR, USERENTRY_HOSTS,
  USERENTRY_PASS, USERENTRY_STATS, USERENTRY_ADDED, USERENTRY_MODIFIED,
  USERENTRY_SET, USERENTRY_SECPASS, USERENTRY_USERNAME, USERENTRY_NODENAME, USERENTRY_OS,
- USERENTRY_TMPPASS, USERENTRY_ARCH, USERENTRY_OSVER;
+ USERENTRY_PASS1, USERENTRY_ARCH, USERENTRY_OSVER;
 
 struct laston_info {
   time_t laston;