pid_t pid;
uid_t uid = current_user.ut.uid;
gid_t gid = current_user.ut.gid;
+ void (*saved_handler)(int);
/*
* Lose any elevated privileges.
* SIGCLD signals as it also eats the exit status code. JRA.
*/
- CatchChildLeaveStatus();
+ saved_handler = CatchChildLeaveStatus();
if ((pid=fork()) < 0) {
DEBUG(0,("smbrun: fork failed with error %s\n", strerror(errno) ));
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
if (outfd) {
close(*outfd);
*outfd = -1;
break;
}
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
if (wpid != pid) {
DEBUG(2,("waitpid(%d) : %s\n",(int)pid,strerror(errno)));
return status;
}
- CatchChild();
+ (void)CatchChild();
/* we are in the child. we exec /bin/sh to do the work for us. we
don't directly exec the command we want because it may be a
uid_t uid = current_user.ut.uid;
gid_t gid = current_user.ut.gid;
int ifd[2];
+ void (*saved_handler)(int);
/*
* Lose any elevated privileges.
* SIGCLD signals as it also eats the exit status code. JRA.
*/
- CatchChildLeaveStatus();
+ saved_handler = CatchChildLeaveStatus();
if ((pid=fork()) < 0) {
DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
return errno;
}
break;
}
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
if (wpid != pid) {
DEBUG(2, ("waitpid(%d) : %s\n", (int)pid, strerror(errno)));
return status;
}
- CatchChild();
+ (void)CatchChild();
/* we are in the child. we exec /bin/sh to do the work for us. we
don't directly exec the command we want because it may be a
pid_t pid, wpid;
int wstat;
bool chstat = False;
+ void (*saved_handler)(int);
if (pass == NULL) {
DEBUG(0, ("chat_with_program: user doesn't exist in the UNIX password database.\n"));
* SIGCLD signals as it also eats the exit status code. JRA.
*/
- CatchChildLeaveStatus();
+ saved_handler = CatchChildLeaveStatus();
if ((pid = fork()) < 0) {
DEBUG(3, ("chat_with_program: Cannot fork() child for password change: %s\n", pass->pw_name));
SAFE_FREE(slavedev);
close(master);
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
return (False);
}
if (wpid < 0) {
DEBUG(3, ("chat_with_program: The process is no longer waiting!\n\n"));
close(master);
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
return (False);
}
/*
* Go back to ignoring children.
*/
- CatchChild();
+ (void)CatchSignal(SIGCLD, saved_handler);
close(master);