Source-Changes-HG archive

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

[src/netbsd-1-6]: src/usr.sbin/rpc.lockd Pull up revision 1.12 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/91a69657a61e
branches:  netbsd-1-6
changeset: 531244:91a69657a61e
user:      grant <grant%NetBSD.org@localhost>
date:      Tue Apr 06 09:32:01 2004 +0000

description:
Pull up revision 1.12 (requested by bouyer in ticket #1654):

- protect from pid reusing.
- fix a null dereference on the error.

diffstat:

 usr.sbin/rpc.lockd/lockd_lock.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r d48a568fc38c -r 91a69657a61e usr.sbin/rpc.lockd/lockd_lock.c
--- a/usr.sbin/rpc.lockd/lockd_lock.c   Tue Apr 06 08:00:37 2004 +0000
+++ b/usr.sbin/rpc.lockd/lockd_lock.c   Tue Apr 06 09:32:01 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lockd_lock.c,v 1.8.2.1 2003/06/30 02:27:38 grant Exp $ */
+/*     $NetBSD: lockd_lock.c,v 1.8.2.2 2004/04/06 09:32:01 grant Exp $ */
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -382,9 +382,13 @@
                        if (pid == fl->locker)
                                break;
                }
-               if (pid != fl->locker) {
+               if (fl == NULL) {
                        syslog(LOG_NOTICE, "unknow child %d", pid);
                } else {
+                       /*
+                        * protect from pid reusing.
+                        */
+                       fl->locker = 0;
                        if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
                                syslog(LOG_NOTICE, "child %d failed", pid);
                                /*



Home | Main Index | Thread Index | Old Index