version 1.16, 2004/04/18 23:10:26 |
version 1.17, 2004/08/23 14:26:38 |
|
|
#include "canohost.h" |
#include "canohost.h" |
#include "pathnames.h" |
#include "pathnames.h" |
#include "readconf.h" |
#include "readconf.h" |
|
#include "uidswap.h" |
|
|
/* XXX readconf.c needs these */ |
/* XXX readconf.c needs these */ |
uid_t original_real_uid; |
uid_t original_real_uid; |
|
|
key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY); |
key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY); |
key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY); |
key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY); |
|
|
seteuid(getuid()); |
if ((pw = getpwuid(getuid())) == NULL) |
setuid(getuid()); |
fatal("getpwuid failed"); |
|
pw = pwcopy(pw); |
|
|
|
permanently_set_uid(pw); |
|
|
#ifdef DEBUG_SSH_KEYSIGN |
#ifdef DEBUG_SSH_KEYSIGN |
log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); |
log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0); |
#endif |
#endif |
|
|
|
|
if (key_fd[0] == -1 && key_fd[1] == -1) |
if (key_fd[0] == -1 && key_fd[1] == -1) |
fatal("could not open any host key"); |
fatal("could not open any host key"); |
|
|
if ((pw = getpwuid(getuid())) == NULL) |
|
fatal("getpwuid failed"); |
|
pw = pwcopy(pw); |
|
|
|
SSLeay_add_all_algorithms(); |
SSLeay_add_all_algorithms(); |
for (i = 0; i < 256; i++) |
for (i = 0; i < 256; i++) |