Fix: NNTPC: nntpcache-1.0.7.1 bug ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I believe I have found why nntpcache is bugging.
> Note: That the 'INN' server will still think it is in nyx.help even
> after a 'listgroup' as nntpcache does not explicitly do a
> 'group alt.games.ftp.verge'
> The result of this bug is that nntpcache thinks it has got a list of articles
> from the correct group when in fact they came from another group.
> 
> I'm testing a patch (a poor hacked up one, but it seems to correct this 
> particular bug ok - a better structured one is needed).
> 
> patch nntpcache.c -
> 1113a1114
> >                               CMDgroup (buf);

Hello,


	Thanks to Paul for finding the source of the problem.

	I've fixed this one with correct responses and statistics.
I'm including the patch below - i.e. do NOT patch the nntpcache.c, but
use the attached one.

	Regards,


---------------------------------------------------------------------------
----                                                                   ----
----   Marian Durkovic                        network  manager         ----
----                                                                   ----
----   Slovak Technical University            Phone: + 421 7 3596-666  ----
----   Computer Centre, Nam. Slobody 17       Fax:   + 421 7 394-351   ----
----   812 43 Bratislava, Slovak Republic     E-mail: marian@bts.sk    ----
----                                                                   ----
---------------------------------------------------------------------------




--- group.c.bak	Thu Nov 13 15:51:29 1997
+++ group.c	Sun Nov 16 14:52:54 1997
@@ -134,7 +134,7 @@
 	return TRUE;
 }
 
-X (bool attachGroup (char *group))
+X (bool attachGroup (char *group, bool sendclient))
 {
 	int hi, lo, msgs, gt = 0; /* stop gcc whinging */
 	struct newsgroup *n;
@@ -169,7 +169,8 @@
 		{
 			if (time(NULL) - gt < scfg->group_timeout)
 			{
-				emitf ("%d %d %d %d %s\r\n", NNTP_GROUPOK_VAL, msgs, lo, hi, group);
+				if (sendclient)
+					emitf ("%d %d %d %d %s\r\n", NNTP_GROUPOK_VAL, msgs, lo, hi, group);
 				if (scfg->group)
 					free(scfg->group);
 				scfg->group = Sstrdup(group);
@@ -187,7 +188,7 @@
 		emitrn (NNTP_NOSUCHGROUP);
 		return FALSE;
 	}
-	if (!attachGroupTalk(group, n, scfg, TRUE))
+	if (!attachGroupTalk(group, n, scfg, sendclient))
 		return FALSE;
 good:
 	CurrentGroupNode = n;
@@ -262,7 +263,7 @@
 		if (!auth && con.groupSecurity)
 			return FALSE;
 	}
-	if (attachGroup (attempted_group))
+	if (attachGroup (attempted_group,TRUE))
 	{
 		CurrentGroupAuth = auth;
 		if (auth)
@@ -280,18 +281,36 @@
 	char *group;
 	char buf[MAX_LINE];
 	struct server_cfg *scfg;
+	struct authent *auth = NULL;
 	Stats->listgroup++;
-	sscanf(args, "*s %127[\r\n\t ]", gr);
-	if (*gr)
+	sscanf(args, "%*s %127[^\r\n \t]", gr);
+	if (*gr && strcmp(CurrentGroup,gr))
 	{
+		Stats->group++;
+		GroupsEntered++;
+		if (CurrentGroupArtRead && CurrentGroupScfg && CurrentGroupScfg->group)
+			log (("%s group %s %d", ClientHostNormal, CurrentGroupScfg->group, CurrentGroupArtRead));
+		ArtRead+=CurrentGroupArtRead;
+		CurrentGroupArtRead = 0;
 		if (!safeGroup(gr))
 		{
 			emitrn (NNTP_NOSUCHGROUP);
 			return;
 		}
-		if (con.groupSecurity && !authGroup (gr, TRUE))
-			return;
-		group = gr;
+		if (con.groupSecurity || con.contentFilters)
+		{
+			auth=authGroup (gr, TRUE);
+			if (!auth && con.groupSecurity)
+				return;
+		}
+		if (attachGroup (gr,FALSE))
+		{
+			CurrentGroupAuth = auth;
+			if (auth)
+				CurrentGroupXoverIsFilt = xoverIsFilt (auth);
+			else
+				CurrentGroupXoverIsFilt = FALSE;
+		} else return;
 	} else
 	{
 		if (!*CurrentGroup)
@@ -299,8 +318,8 @@
 			emitrn (NNTP_NOTINGROUP);
 			return;
 		}
-		group = CurrentGroup;
 	}
+	group = CurrentGroup;
 	scfg = getServerGroup(group);
 	if (!scfg)
 	{



[Index of Archives]     [Yosemite]     [Yosemite Campsites]     [Bugtraq]     [Linux]     [Trn]

Powered by Linux