Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 5b6b1fc478e114913dc114cd076118b8 > files > 9

rdist-6.1.5-27.mga3.src.rpm

--- rdist-6.1.5/src/message.c.original	Thu Dec 28 06:32:04 2000
+++ rdist-6.1.5/src/message.c	Thu Dec 28 06:36:21 2000
@@ -464,6 +464,7 @@
 	if (!msgfac->mf_fptr) {
 		register char *cp;
 		char *getenv();
+		int tempfd;
 
 		/*
 		 * Create and open a new temporary file
@@ -475,8 +476,11 @@
 		(void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP);
 
 		msgfac->mf_filename = tempfile;
-		(void) mktemp(msgfac->mf_filename);
-		if ((msgfac->mf_fptr = fopen(msgfac->mf_filename, "w"))==NULL)
+		tempfd = mkstemp(msgfac->mf_filename);
+		if (tempfd == -1)
+			fatalerr("Cannot create notify file for writing: %s: %s.",
+			      msgfac->mf_filename, SYSERR);
+		if ((msgfac->mf_fptr = fdopen(tempfd, "w"))==NULL)
 			fatalerr("Cannot open notify file for writing: %s: %s.",
 			      msgfac->mf_filename, SYSERR);
 		debugmsg(DM_MISC, "Created notify temp file '%s'",