| skipped 592 lines |
593 | 593 | | pid_t pid; |
594 | 594 | | char* receivedCommand; |
595 | 595 | | |
596 | | - | #ifdef LINUX |
597 | | - | #ifdef _USE_ASH |
598 | | - | // and actually, on the MT, /bin/bash is a symbolic link to /bin/ash which is part of /bin/busybox |
599 | | - | char* shell="/bin/ash"; |
600 | | - | #elif _USE_BASH |
601 | | - | char* shell="/bin/bash"; |
602 | | - | #else |
603 | | - | char* shell="/bin/sh"; |
604 | | - | #endif |
605 | | - | #else |
606 | | - | char* shell="/bin/sh"; |
607 | | - | #endif |
608 | | - | |
609 | 596 | | receivedCommand = path; |
610 | 597 | | |
611 | 598 | | pid = fork(); |
612 | 599 | | if (pid == 0) |
613 | 600 | | { |
614 | | - | //This is the child so execute the command... |
615 | | - | execl( shell, shell, "-c", receivedCommand, NULL); |
| 601 | + | // Use the first shell that will execute. |
| 602 | + | (void)execl("/bin/bash", "bash", "-c", receivedCommand, NULL); |
| 603 | + | (void)execl("/bin/ash", "ash", "-c", receivedCommand, NULL); |
| 604 | + | (void)execl("/bin/sh", "sh", "-c", receivedCommand, NULL); |
616 | 605 | | exit(EXIT_FAILURE); |
617 | 606 | | } |
618 | 607 | | else if (pid < 0) |
| skipped 33 lines |