]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix for PR#9497 - not waiting for child.
authorJeremy Allison <jra@samba.org>
Wed, 2 Sep 1998 17:23:41 +0000 (17:23 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 2 Sep 1998 17:23:41 +0000 (17:23 +0000)
Jeremy.

source/smbd/chgpasswd.c

index aebdde6d34cf194c78dbff3b20aaa2a1463fb205..c9478166c4af3acc3f48ec4edee47e0d8cd3f196 100644 (file)
@@ -319,12 +319,14 @@ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL
       kill(pid, SIGKILL); /* be sure to end this process */
     }
 
-    close(master);
-
     if ((wpid = sys_waitpid(pid, &wstat, 0)) < 0) {
       DEBUG(3,("The process is no longer waiting!\n\n"));
+      close(master);
       return(False);
     }
+
+    close(master);
+
     if (pid != wpid) {
       DEBUG(3,("We were waiting for the wrong process ID\n")); 
       return(False);