version 1.161, 2023/07/10 12:00:08 |
version 1.162, 2024/05/15 09:59:12 |
|
|
static __dead void |
static __dead void |
client_exec(const char *shell, const char *shellcmd) |
client_exec(const char *shell, const char *shellcmd) |
{ |
{ |
const char *name, *ptr; |
char *argv0; |
char *argv0; |
|
|
|
log_debug("shell %s, command %s", shell, shellcmd); |
log_debug("shell %s, command %s", shell, shellcmd); |
|
argv0 = shell_argv0(shell, !!(client_flags & CLIENT_LOGIN)); |
ptr = strrchr(shell, '/'); |
|
if (ptr != NULL && *(ptr + 1) != '\0') |
|
name = ptr + 1; |
|
else |
|
name = shell; |
|
if (client_flags & CLIENT_LOGIN) |
|
xasprintf(&argv0, "-%s", name); |
|
else |
|
xasprintf(&argv0, "%s", name); |
|
setenv("SHELL", shell, 1); |
setenv("SHELL", shell, 1); |
|
|
proc_clear_signals(client_proc, 1); |
proc_clear_signals(client_proc, 1); |