This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] temp file not removed in nscd


When using nscd without the persistent database and without sharing, the temporary file is not removed on exit. This is due to the unlink operation being guarded by the sharing conditional. The path below corrects this.

Jerome



--- glibc-cvs/nscd/connections.c	2004-10-04 18:38:27.000000000 +0200
+++ glibc-cvs.new/nscd/connections.c	2004-10-14 17:23:45.088154024 +0200
@@ -327,9 +327,10 @@

 		/* We do not need the file name anymore after we
 		   opened another file descriptor in read-only mode.  */
-		if (fd != -1 && dbs[cnt].shared)
+		if (fd != -1)
 		  {
-		    ro_fd = open (fname, O_RDONLY);
+		    if (dbs[cnt].shared)
+		      ro_fd = open (fname, O_RDONLY);

 		    unlink (fname);
 		  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]