version 1.236, 2005/04/21 11:47:19 |
version 1.237, 2005/04/26 13:08:37 |
|
|
options.control_path, original_real_uid); |
options.control_path, original_real_uid); |
} |
} |
if (options.control_path != NULL && options.control_master == 0) |
if (options.control_path != NULL && options.control_master == 0) |
control_client(options.control_path); /* This doesn't return */ |
control_client(options.control_path); |
|
|
/* Open a connection to the remote host. */ |
/* Open a connection to the remote host. */ |
if (ssh_connect(host, &hostaddr, options.port, |
if (ssh_connect(host, &hostaddr, options.port, |
|
|
extern char **environ; |
extern char **environ; |
u_int flags; |
u_int flags; |
|
|
if (stdin_null_flag) { |
|
if ((fd = open(_PATH_DEVNULL, O_RDONLY)) == -1) |
|
fatal("open(/dev/null): %s", strerror(errno)); |
|
if (dup2(fd, STDIN_FILENO) == -1) |
|
fatal("dup2: %s", strerror(errno)); |
|
if (fd > STDERR_FILENO) |
|
close(fd); |
|
} |
|
|
|
memset(&addr, '\0', sizeof(addr)); |
memset(&addr, '\0', sizeof(addr)); |
addr.sun_family = AF_UNIX; |
addr.sun_family = AF_UNIX; |
addr.sun_len = offsetof(struct sockaddr_un, sun_path) + |
addr.sun_len = offsetof(struct sockaddr_un, sun_path) + |
|
|
if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) |
if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) |
fatal("%s socket(): %s", __func__, strerror(errno)); |
fatal("%s socket(): %s", __func__, strerror(errno)); |
|
|
if (connect(sock, (struct sockaddr*)&addr, addr.sun_len) == -1) |
if (connect(sock, (struct sockaddr*)&addr, addr.sun_len) == -1) { |
fatal("Couldn't connect to %s: %s", path, strerror(errno)); |
debug("Couldn't connect to %s: %s", path, strerror(errno)); |
|
close(sock); |
|
return; |
|
} |
|
|
|
if (stdin_null_flag) { |
|
if ((fd = open(_PATH_DEVNULL, O_RDONLY)) == -1) |
|
fatal("open(/dev/null): %s", strerror(errno)); |
|
if (dup2(fd, STDIN_FILENO) == -1) |
|
fatal("dup2: %s", strerror(errno)); |
|
if (fd > STDERR_FILENO) |
|
close(fd); |
|
} |
|
|
if ((term = getenv("TERM")) == NULL) |
if ((term = getenv("TERM")) == NULL) |
term = ""; |
term = ""; |
|
|