Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/9233a4caff2c
branches:  netbsd-3
changeset: 577441:9233a4caff2c
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Nov 05 00:50:18 2005 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #932):
        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 819fd32bb4b9 -r 9233a4caff2c usr.sbin/rpc.statd/stat_proc.c
--- a/usr.sbin/rpc.statd/stat_proc.c    Sat Nov 05 00:49:05 2005 +0000
+++ b/usr.sbin/rpc.statd/stat_proc.c    Sat Nov 05 00:50:18 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.10.1 2005/11/05 00:50:18 tron 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.10.1 2005/11/05 00:50:18 tron 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