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

* Added S_NAZIPASS to disable annoying nazi password requirements.
* Fixed MOTD mulit-line issues :)


svn: 264

Bryan Drewery 22 лет назад
Родитель
Сommit
08437190b4
5 измененных файлов с 31 добавлено и 19 удалено
  1. 4 2
      pack/conf.h
  2. 2 2
      src/chanprog.c
  3. 2 2
      src/cmds.c
  4. 5 4
      src/main.c
  5. 18 9
      src/misc.c

+ 4 - 2
pack/conf.h

@@ -10,7 +10,7 @@
 
 /*      S_FEATURE	  RECOMMENDED	DESCRIPTION 					*/
 #define S_ANTITRACE	/*  yes		ptrace detection 				*/
-#define S_AUTH		/*  yes		authorization system (HIGHLY RECOMMENDED)	*/
+#undef S_AUTH		/*  yes		authorization system (HIGHLY RECOMMENDED)	*/
 #define S_AUTOAWAY	/*  yes		random autoaway/return on IRC 			*/
 #define S_AUTOLOCK      /*  yes         will lock channels upon certain coniditions     */
 #define S_DCCPASS	/*  yes		DCC command passwords 				*/
@@ -22,8 +22,10 @@
 #undef  S_MSGIDENT	/*  no		allows users to msg to IDENT			*/
 #undef  S_MSGINVITE	/*  no		allows users to msg for invite 			*/
 #define  S_MSGOP		/*  no		allows users to msg for op			*/
-#undef  S_MSGPASS	/*  no		allows users to msg to change password  	*/
+#define  S_MSGPASS	/*  no		allows users to msg to change password  	*/
 #undef  S_MSGVOICE	/*  no		allows users to msg for voice			*/
+#undef  S_NAZIPASS      /*  no		if you have AUTH enabled, this is unneeded      *
+			 *              it simply requires more secure passes		*/
 #define S_NODELAY	/*  yes		speeds up tcp sockets to server			*/
 #define	S_PERMONLY	/*  none	limits .tcl/.nettcl/.bottcl to perm owners	*/
 #define S_PROCESSCHECK	/*  yes		checks running processes against a bad-list	*/

+ 2 - 2
src/chanprog.c

@@ -860,10 +860,10 @@ int isowner(char *name)
 
 int shouldjoin(struct chanset_t *chan)
 {
-  if (!strcmp(chan->dname, "#wtest"))
+/*  if (!strcmp(chan->dname, "#wtest"))
     return 1;
   else
-    return 0;
+    return 0; */
 #ifdef G_BACKUP
   struct flag_record fr = { FR_CHAN | FR_ANYWH | FR_GLOBAL, 0, 0, 0, 0 };
 

+ 2 - 2
src/cmds.c

@@ -573,8 +573,8 @@ static void cmd_motd(struct userrec *u, int idx, char *par)
   if (par[0] && (u->flags & USER_MASTER)) {
     char *s;
 
-    s = nmalloc(strlen(par) + 1 + HANDLEN + 3); /* +3: '() ' */
-    sprintf(s, STR("(%s) %s"), dcc[idx].nick, par);
+    s = nmalloc(strlen(par) + 1 + HANDLEN + 1); /* +1: ' ' */
+    sprintf(s, STR("%s %s"), dcc[idx].nick, par);
     set_cfg_str(NULL, "motd", s);
     nfree(s);
     dprintf(idx, STR("Motd set\n"));

+ 5 - 4
src/main.c

@@ -1120,9 +1120,9 @@ static void gotspawn(char *filename)
   if (!(fp = fopen(filename, "r")))
     fatal(STR("Cannot read from local config (2)"), 0);
 
-  while(fscanf(fp,"%[^\n]\n",templine) != EOF) 
-  {
-    temps = (char *) decrypt_string(netpass, decryptit(templine));
+  while(fscanf(fp,"%[^\n]\n",templine) != EOF) {
+    void *my_ptr;
+    temps = my_ptr = (char *) decrypt_string(netpass, decryptit(templine));
 
 #ifdef S_PSCLOAK
     sdprintf(STR("GOTSPAWN: %s"), temps);
@@ -1163,7 +1163,8 @@ static void gotspawn(char *filename)
     if (ipsix && ipsix[1]) {
       snprintf(myip6, 120, "%s", ipsix);
     }
-    nfree(temps);
+    if (my_ptr)
+      nfree(my_ptr);
   }
 
   fclose(fp);

+ 18 - 9
src/misc.c

@@ -455,14 +455,16 @@ void show_banner(int idx)
 /* show motd to dcc chatter */
 void show_motd(int idx)
 {
+  
   if (CFG_MOTD.gdata && *(char *) CFG_MOTD.gdata) {
-    /* char *buf; 
-
-    * buf = nmalloc(strlen((char *)CFG_MOTD.gdata) + 1);
-    * strcpy(buf, (char *)CFG_MOTD.gdata);
-    */
-    dumplots(idx, "Motd: ", (char *)CFG_MOTD.gdata);
-    /* nfree(buf); */
+    char *who, *buf;
+    void *buf_ptr;
+    buf = buf_ptr = nmalloc(strlen((char *) CFG_MOTD.gdata) + 1);
+    strcpy(buf, (char *) CFG_MOTD.gdata);
+    who = newsplit(&buf);
+    dprintf(idx, "Motd set by \002%s\002\n", who);
+    dumplots(idx, "* ", replace(buf, "\\n", "\n"));
+    nfree(buf_ptr);
   } else
     dprintf(idx, STR("Motd: none\n"));
 }
@@ -1708,13 +1710,16 @@ void makeplaincookie(char *chname, char *nick, char *buf)
 
 int goodpass(char *pass, int idx, char *nick)
 {
-  int i, nalpha = 0, lcase = 0, ucase = 0, ocase = 0, tc;
   char *tell;
+#ifdef S_NAZIPASS
+  int i, nalpha = 0, lcase = 0, ucase = 0, ocase = 0, tc;
+#endif /* S_NAZIPASS */
   tell = nmalloc(300);
 
   if (!pass[0]) 
     return 0;
 
+#ifdef S_NAZIPASS
   for (i = 0; i < strlen(pass); i++) {
     tc = (int) pass[i];
     if (tc < 58 && tc > 47)
@@ -1729,9 +1734,12 @@ int goodpass(char *pass, int idx, char *nick)
 
 /*  if (ocase < 1 || lcase < 2 || ucase < 2 || nalpha < 1 || strlen(pass) < 8) { */
   if (ocase < 1 || lcase < 2 || ucase < 2 || strlen(pass) < 8) {
+#else /* !S_NAZIPASS */
+  if (strlen(pass) < 8) {
+#endif /* S_NAZIPASS */
 
     sprintf(tell, "Insecure pass, must be: ");
-
+#ifdef S_NAZIPASS 
     if (ocase < 1)
       strcat(tell, "\002>= 1 number\002, ");
     else
@@ -1752,6 +1760,7 @@ int goodpass(char *pass, int idx, char *nick)
     else
       strcat(tell, ">= 1 non-alpha/num, ");
 */
+#endif /* S_NAZIPASS */
     if (strlen(pass) < 8)
       strcat(tell, "\002>= 8 chars.\002");
     else