summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-02 17:23:41 +0000
committerJeremy Allison <jra@samba.org>1998-09-02 17:23:41 +0000
commite817d836bba3aaf0f732d66bc5a4383a7f7005db (patch)
tree65275660198aadef9e60a7238bf0b823b9cb081f
parent72c383f4b7bcce5374632dc972df16ab0e2542b9 (diff)
downloadsamba-e817d836bba3aaf0f732d66bc5a4383a7f7005db.tar.gz
Fix for PR#9497 - not waiting for child.
Jeremy.
-rw-r--r--source/smbd/chgpasswd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index aebdde6d34c..c9478166c4a 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -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);