This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] temp file not removed in nscd
- From: Jerome Borsboom <j dot borsboom at erasmusmc dot nl>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 14 Oct 2004 17:48:22 +0200 (CEST)
- Subject: [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);
}