Source-Changes-HG archive

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

[src/netbsd-2]: src/usr.sbin/rpc.statd Pull up following revision(s) (request...



details:   https://anonhg.NetBSD.org/src/rev/b1b819fa4fa1
branches:  netbsd-2
changeset: 564329:b1b819fa4fa1
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Nov 06 00:28:53 2005 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #5967):
        usr.sbin/rpc.statd/stat_proc.c: revision 1.7
When forking, we keep a reference to the status db file, and if the
memory copy of the file is dirty, is will be synced when the child exists.
But the parent may have done changes to the database in the meantime, resulting
in a db corruption.
Fix this by calling sync_file() just before the fork. The child will still have
a reference to the db, but won't try to write it on exit.

diffstat:

 usr.sbin/rpc.statd/stat_proc.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r a0bab1353bed -r b1b819fa4fa1 usr.sbin/rpc.statd/stat_proc.c
--- a/usr.sbin/rpc.statd/stat_proc.c    Sun Nov 06 00:24:15 2005 +0000
+++ b/usr.sbin/rpc.statd/stat_proc.c    Sun Nov 06 00:28:53 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stat_proc.c,v 1.6 2000/06/09 14:02:12 fvdl Exp $       */
+/*     $NetBSD: stat_proc.c,v 1.6.8.1 2005/11/06 00:28:53 riz Exp $    */
 
 /*
  * Copyright (c) 1995
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: stat_proc.c,v 1.6 2000/06/09 14:02:12 fvdl Exp $");
+__RCSID("$NetBSD: stat_proc.c,v 1.6.8.1 2005/11/06 00:28:53 riz Exp $");
 #endif
 
 #include <errno.h>
@@ -337,6 +337,7 @@
        if (!lp) /* We know this host, but have no outstanding requests. */
                return (&dummy);
 
+       sync_file();
        pid = fork();
        if (pid == -1) {
                syslog(LOG_ERR, "Unable to fork notify process - %s",



Home | Main Index | Thread Index | Old Index