Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/rpc.lockd - protect from pid reusing.



details:   https://anonhg.NetBSD.org/src/rev/1591027ca8bc
branches:  trunk
changeset: 544200:1591027ca8bc
user:      yamt <yamt%NetBSD.org@localhost>
date:      Fri Mar 14 13:46:23 2003 +0000

description:
- 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 535333c4c5a5 -r 1591027ca8bc usr.sbin/rpc.lockd/lockd_lock.c
--- a/usr.sbin/rpc.lockd/lockd_lock.c   Fri Mar 14 09:18:50 2003 +0000
+++ b/usr.sbin/rpc.lockd/lockd_lock.c   Fri Mar 14 13:46:23 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lockd_lock.c,v 1.11 2003/01/20 05:30:14 simonb Exp $   */
+/*     $NetBSD: lockd_lock.c,v 1.12 2003/03/14 13:46:23 yamt Exp $     */
 
 /*
  * Copyright (c) 2000 Manuel Bouyer.
@@ -369,9 +369,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