Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37859496
en ru br
ALT Linux repos
S:0.18-alt0.pre1.3
5.0: 0.18-alt0.pre1.1
4.1: 0.18-alt0.pre1.0.M41.1
4.0: 0.17-ipl5mdk.1
3.0: 0.17-ipl5mdk

Group :: Networking/File transfer
RPM: ftp

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: netkit-ftp-0.17-fedora-segv.patch
Download


--- netkit-ftp-0.17/ftp/ftp.c.segv	2004-06-14 11:04:38.000000000 -0400
+++ netkit-ftp-0.17/ftp/ftp.c	2004-06-14 11:06:46.000000000 -0400
@@ -472,6 +472,8 @@
 					return (0);
 				}
 				lostpeer(0);
+				fclose(cout);
+				cout = NULL;
 				if (verbose) {
 					printf("421 Service not available, remote server has closed connection\n");
 					(void) fflush(stdout);
@@ -529,7 +531,14 @@
 			cpend = 0;
 		(void) signal(SIGINT,oldintr);
 		if (code == 421 || originalcode == 421)
+		{
 			lostpeer(0);
+			if(cout)
+			{
+				fclose(cout);
+				cout = NULL;
+			}
+		}
 		if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)
 			(*oldintr)(SIGINT);
 		return (n - '0');
@@ -1790,6 +1799,11 @@
 			if (ptabflg)
 				code = -1;
 			lostpeer(0);
+			if(cout != NULL)
+			{
+				fclose(cout);
+				cout = NULL;
+			}
 		}
 		(void) getreply(0);
 		(void) getreply(0);
@@ -1815,6 +1829,11 @@
 			perror("reset");
 			code = -1;
 			lostpeer(0);
+			if(cout != NULL)
+			{
+				fclose(cout);
+				cout = NULL;
+			}
 		}
 		else if (nfnd) {
 			(void) getreply(0);
@@ -1897,6 +1916,11 @@
 		if (ptabflg)
 			code = -1;
 		lostpeer(0);
+		if(cout != NULL)
+		{
+			fclose(cout);
+			cout = NULL;
+		}
 	}
 	if (din && FD_ISSET(fileno(din), &mask)) {
 		while (read(fileno(din), buf, BUFSIZ) > 0)
--- netkit-ftp-0.17/ftp/main.c.segv	2004-06-14 11:03:18.000000000 -0400
+++ netkit-ftp-0.17/ftp/main.c	2004-06-14 11:03:42.000000000 -0400
@@ -235,8 +235,6 @@
 	if (connected) {
 		if (cout != NULL) {
 			shutdown(fileno(cout), 1+1);
-			fclose(cout);
-			cout = NULL;
 		}
 		if (data >= 0) {
 			shutdown(data, 1+1);
@@ -249,8 +247,6 @@
 	if (connected) {
 		if (cout != NULL) {
 			shutdown(fileno(cout), 1+1);
-			fclose(cout);
-			cout = NULL;
 		}
 		connected = 0;
 	}
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin