mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
The /stand directory now disappears out from under sysinstall while
it is running during installations. The vsystem() function does get used after this happens (e.g. if you manually configure the network interface and ask it to enable the interface) so it needs to be a little smarter about whether it uses /stand/sh or /bin/sh. MFC after: 3 days
This commit is contained in:
parent
f62ed2dc45
commit
d44cf58f45
2 changed files with 4 additions and 2 deletions
|
|
@ -408,6 +408,7 @@ vsystem(char *fmt, ...)
|
|||
sig_t intsave, quitsave;
|
||||
char *cmd;
|
||||
int i;
|
||||
struct stat sb;
|
||||
|
||||
cmd = (char *)alloca(FILENAME_MAX);
|
||||
cmd[0] = '\0';
|
||||
|
|
@ -438,7 +439,7 @@ vsystem(char *fmt, ...)
|
|||
close(1); open("/dev/null", O_WRONLY);
|
||||
dup2(1, 2);
|
||||
}
|
||||
if (RunningAsInit)
|
||||
if (stat("/stand/sh", &sb) == 0)
|
||||
execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL);
|
||||
else
|
||||
execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
|
||||
|
|
|
|||
|
|
@ -408,6 +408,7 @@ vsystem(char *fmt, ...)
|
|||
sig_t intsave, quitsave;
|
||||
char *cmd;
|
||||
int i;
|
||||
struct stat sb;
|
||||
|
||||
cmd = (char *)alloca(FILENAME_MAX);
|
||||
cmd[0] = '\0';
|
||||
|
|
@ -438,7 +439,7 @@ vsystem(char *fmt, ...)
|
|||
close(1); open("/dev/null", O_WRONLY);
|
||||
dup2(1, 2);
|
||||
}
|
||||
if (RunningAsInit)
|
||||
if (stat("/stand/sh", &sb) == 0)
|
||||
execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL);
|
||||
else
|
||||
execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue