Updated exec functions

This commit is contained in:
Michiel Broek 2004-08-13 14:30:17 +00:00
parent bd740ae688
commit f7aa43b328
3 changed files with 8 additions and 5 deletions

View File

@ -21,6 +21,11 @@ v0.61.4 11-Aug-2004
Fixed counter in log that should show the number of linked Fixed counter in log that should show the number of linked
messages. messages.
mbsebbs:
The exec_nosuid function for doors now also has a extra small
delay just like all other execute functions to prevent problems
on fast machines.
mbuser: mbuser:
Fixed permissions. Fixed permissions.

View File

@ -57,7 +57,7 @@ int _execute(char **args, char *in, char *out, char *err)
if ((pid = fork()) == 0) { if ((pid = fork()) == 0) {
/* /*
* A delay in the child to prevent it returns before the main * A delay in the child to prevent it returns before the main
* process sess it ever started. * process sees it ever started.
*/ */
msleep(150); msleep(150);
@ -106,11 +106,8 @@ int _execute(char **args, char *in, char *out, char *err)
switch (rc) { switch (rc) {
case -1: case -1:
/*
* Seems to be a problem on fast systems, hope it is ok.
*/
if (errno == ECHILD) { if (errno == ECHILD) {
Syslog('+', "Execute: no child process, this seems well"); Syslog('+', "Execute: no child process");
return 0; return 0;
} else { } else {
WriteError("$Wait returned %d, status %d,%d", rc,status>>8,status&0xff); WriteError("$Wait returned %d, status %d,%d", rc,status>>8,status&0xff);

View File

@ -323,6 +323,7 @@ int exec_nosuid(char *mandato)
if (pid == -1) if (pid == -1)
return 1; return 1;
if (pid == 0) { if (pid == 0) {
msleep(150);
char *argv[4]; char *argv[4];
argv[0] = (char *)"sh"; argv[0] = (char *)"sh";
argv[1] = (char *)"-c"; argv[1] = (char *)"-c";