Просмотр исходного кода

* Fixed a problem with dcc authing not being validated correctly
* Fixed some *possible* problems with msgop/pass/invite/ident checking.


svn: 1655

Bryan Drewery 21 лет назад
Родитель
Сommit
b26bf5b2e5
3 измененных файлов с 14 добавлено и 15 удалено
  1. 2 0
      doc/UPDATES
  2. 5 5
      src/cfg.h
  3. 7 10
      src/dcc.c

+ 2 - 0
doc/UPDATES

@@ -31,6 +31,8 @@ This is a summary of ChangeLog basically.
 * Fixed random secpass being set 1 char too long.
 * Fixed cmd_ch(sec)pass <rand> to display "[random]" now isntead of "[something]"
 * SECPASS only displays for same user and +a/perm_owner now.
+* Fixed a problem with dcc authing not being validated correctly
+* Fixed some *possible* problems with msgop/pass/invite/ident checking.
 
 1.2
 * No longer displaying SALTS on ./bin -v

+ 5 - 5
src/cfg.h

@@ -51,11 +51,11 @@ extern struct cfg_entry		**cfg;
 #define LAG_THRESHOLD (CFG_LAGTHRESHOLD.gdata ? atoi(CFG_LAGTHRESHOLD.gdata) : 15)
 #define OPREQ_COUNT (CFG_OPREQUESTS.gdata ? atoi( CFG_OPREQUESTS.gdata ) : 2)
 #define OPREQ_SECONDS (CFG_OPREQUESTS.gdata ? atoi( strchr(CFG_OPREQUESTS.gdata, ':') + 1 ) : 5)
-#define msgop CFG_MSGOP.ldata ? CFG_MSGOP.ldata : CFG_MSGOP.gdata ? CFG_MSGOP.gdata : ""
-#define msgpass CFG_MSGPASS.ldata ? CFG_MSGPASS.ldata : CFG_MSGPASS.gdata ? CFG_MSGPASS.gdata : ""
-#define msginvite CFG_MSGINVITE.ldata ? CFG_MSGINVITE.ldata : CFG_MSGINVITE.gdata ? CFG_MSGINVITE.gdata : ""
-#define msgident CFG_MSGIDENT.ldata ? CFG_MSGIDENT.ldata : CFG_MSGIDENT.gdata ? CFG_MSGIDENT.gdata : ""
+#define msgop (CFG_MSGOP.ldata ? CFG_MSGOP.ldata : CFG_MSGOP.gdata ? CFG_MSGOP.gdata : "")
+#define msgpass (CFG_MSGPASS.ldata ? CFG_MSGPASS.ldata : CFG_MSGPASS.gdata ? CFG_MSGPASS.gdata : "")
+#define msginvite (CFG_MSGINVITE.ldata ? CFG_MSGINVITE.ldata : CFG_MSGINVITE.gdata ? CFG_MSGINVITE.gdata : "")
+#define msgident (CFG_MSGIDENT.ldata ? CFG_MSGIDENT.ldata : CFG_MSGIDENT.gdata ? CFG_MSGIDENT.gdata : "")
 #define kill_threshold (CFG_KILLTHRESHOLD.gdata ? atoi(CFG_KILLTHRESHOLD.gdata) : 0)
-#define dccauth CFG_DCCAUTH.ldata ? 1 : CFG_DCCAUTH.gdata ? 1 : 0
+#define dccauth (CFG_DCCAUTH.ldata ? 1 : CFG_DCCAUTH.gdata ? 1 : 0)
 
 #endif /* !_CFG_H */

+ 7 - 10
src/dcc.c

@@ -295,8 +295,7 @@ cont_link(int idx, char *buf, int ii)
 
 /* FIXME: remove after 1.2.2 */
 /* need to support the posibility of old hubs being up */
-#ifdef READY
-  if (ii == 2) {
+  if (1 || ii == 2) {
     dprintf(idx, "%s\n", conf.bot->nick);
 
     int snum = findanysnum(dcc[idx].sock);
@@ -308,14 +307,11 @@ cont_link(int idx, char *buf, int ii)
 
     /* wait for "elink" now */
   } else if (ii == 3) {			/* new hub response */
-#endif
     dprintf(idx, "-%s\n", conf.bot->nick);
     dcc[idx].newbot = 1;
 
     /* wait for "neg?" now */
-#ifdef READY
   }
-#endif
 
 
   /* now we wait to negotiate an encryption */
@@ -644,14 +640,15 @@ dcc_chat_secpass(int idx, char *buf, int atr)
 {
   int badauth = 0;
 
-  if (dccauth) {
-    if (!atr)
-      return;
+  if (!atr)
+    return;
 
+  strip_telnet(dcc[idx].sock, buf, &atr);
+  atr = dcc[idx].user ? dcc[idx].user->flags : 0;
+
+  if (dccauth) {
     char check[MD5_HASH_LENGTH + 7] = "";
 
-    strip_telnet(dcc[idx].sock, buf, &atr);
-    atr = dcc[idx].user ? dcc[idx].user->flags : 0;
     egg_snprintf(check, sizeof check, "+Auth %s", dcc[idx].hash);
     badauth = strcmp(check, buf);
     /* +secpass */