version 1.162.2.1, 2005/09/04 18:40:10 |
version 1.162.2.2, 2006/02/03 02:53:45 |
|
|
#include "readconf.h" |
#include "readconf.h" |
#include "atomicio.h" |
#include "atomicio.h" |
#include "misc.h" |
#include "misc.h" |
|
|
#include "dns.h" |
#include "dns.h" |
|
|
char *client_version_string = NULL; |
char *client_version_string = NULL; |
char *server_version_string = NULL; |
char *server_version_string = NULL; |
|
|
int matching_host_key_dns = 0; |
static int matching_host_key_dns = 0; |
|
|
/* import */ |
/* import */ |
extern Options options; |
extern Options options; |
|
|
file_key = key_new(host_key->type); |
file_key = key_new(host_key->type); |
|
|
/* |
/* |
* Check if the host key is present in the user\'s list of known |
* Check if the host key is present in the user's list of known |
* hosts or in the systemwide list. |
* hosts or in the systemwide list. |
*/ |
*/ |
host_file = user_hostfile; |
host_file = user_hostfile; |
|
|
error("Please contact your system administrator."); |
error("Please contact your system administrator."); |
|
|
xfree(fp); |
xfree(fp); |
|
} |
|
|
|
/* |
|
* Execute a local command |
|
*/ |
|
int |
|
ssh_local_cmd(const char *args) |
|
{ |
|
char *shell; |
|
pid_t pid; |
|
int status; |
|
|
|
if (!options.permit_local_command || |
|
args == NULL || !*args) |
|
return (1); |
|
|
|
if ((shell = getenv("SHELL")) == NULL) |
|
shell = _PATH_BSHELL; |
|
|
|
pid = fork(); |
|
if (pid == 0) { |
|
debug3("Executing %s -c \"%s\"", shell, args); |
|
execl(shell, shell, "-c", args, (char *)NULL); |
|
error("Couldn't execute %s -c \"%s\": %s", |
|
shell, args, strerror(errno)); |
|
_exit(1); |
|
} else if (pid == -1) |
|
fatal("fork failed: %.100s", strerror(errno)); |
|
while (waitpid(pid, &status, 0) == -1) |
|
if (errno != EINTR) |
|
fatal("Couldn't wait for child: %s", strerror(errno)); |
|
|
|
if (!WIFEXITED(status)) |
|
return (1); |
|
|
|
return (WEXITSTATUS(status)); |
} |
} |