forked from enlightenment/terminology
parent
e099b4a8d9
commit
1a15b87491
|
@ -1411,9 +1411,7 @@ termpty_new(const char *cmd, int w, int h, int backscroll)
|
||||||
ty->pid = fork();
|
ty->pid = fork();
|
||||||
if (!ty->pid)
|
if (!ty->pid)
|
||||||
{
|
{
|
||||||
char **args, *shell;
|
char **args;
|
||||||
struct passwd *pw;
|
|
||||||
uid_t uid;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
|
@ -1429,12 +1427,15 @@ termpty_new(const char *cmd, int w, int h, int backscroll)
|
||||||
|
|
||||||
if (ioctl(ty->fd, TIOCSCTTY, NULL) < 0) exit(1);
|
if (ioctl(ty->fd, TIOCSCTTY, NULL) < 0) exit(1);
|
||||||
|
|
||||||
uid = getuid();
|
if (!cmd) cmd = getenv("SHELL");
|
||||||
pw = getpwuid(uid);
|
if (!cmd)
|
||||||
if (!pw) shell = "/bin/sh";
|
{
|
||||||
shell = pw->pw_shell;
|
uid_t uid = getuid();
|
||||||
if (!shell) shell = "/bin/sh";
|
struct passwd *pw = getpwuid(uid);
|
||||||
if (!cmd) cmd = shell;
|
if (pw) cmd = pw->pw_shell;
|
||||||
|
}
|
||||||
|
if (!cmd) cmd = "/bin/sh";
|
||||||
|
|
||||||
args = malloc(2 * sizeof(char *));
|
args = malloc(2 * sizeof(char *));
|
||||||
args[0] = (char *)cmd;
|
args[0] = (char *)cmd;
|
||||||
args[1] = NULL;
|
args[1] = NULL;
|
||||||
|
|
Loading…
Reference in New Issue