version 1.135, 2006/03/25 18:41:45 |
version 1.136, 2006/03/28 01:53:43 |
|
|
|
|
if (ac == 0 && !c_flag && !s_flag) { |
if (ac == 0 && !c_flag && !s_flag) { |
shell = getenv("SHELL"); |
shell = getenv("SHELL"); |
if (shell != NULL && strncmp(shell + strlen(shell) - 3, "csh", 3) == 0) |
if (shell != NULL && |
|
strncmp(shell + strlen(shell) - 3, "csh", 3) == 0) |
c_flag = 1; |
c_flag = 1; |
} |
} |
if (k_flag) { |
if (k_flag) { |
|
const char *errstr = NULL; |
|
|
pidstr = getenv(SSH_AGENTPID_ENV_NAME); |
pidstr = getenv(SSH_AGENTPID_ENV_NAME); |
if (pidstr == NULL) { |
if (pidstr == NULL) { |
fprintf(stderr, "%s not set, cannot kill agent\n", |
fprintf(stderr, "%s not set, cannot kill agent\n", |
SSH_AGENTPID_ENV_NAME); |
SSH_AGENTPID_ENV_NAME); |
exit(1); |
exit(1); |
} |
} |
pid = atoi(pidstr); |
pid = (int)strtonum(pidstr, 2, INT_MAX, &errstr); |
if (pid < 1) { |
if (errstr) { |
fprintf(stderr, "%s=\"%s\", which is not a good PID\n", |
fprintf(stderr, |
SSH_AGENTPID_ENV_NAME, pidstr); |
"%s=\"%s\", which is not a good PID: %s\n", |
|
SSH_AGENTPID_ENV_NAME, pidstr, errstr); |
exit(1); |
exit(1); |
} |
} |
if (kill(pid, SIGTERM) == -1) { |
if (kill(pid, SIGTERM) == -1) { |