]>
Commit | Line | Data |
---|---|---|
ae43c103 | 1 | #include "includes.h" |
2 | #include "xmalloc.h" | |
3 | #include "log.h" | |
4 | ||
5 | #define BINDIR "/bin" | |
6 | #define LIBEXEC "/libexec" | |
7 | #define SSHDIR "/etc/ssh" | |
8 | ||
9 | char *SSH_PRNG_COMMAND_FILE; | |
10 | char *_PATH_SSH_SYSTEM_HOSTFILE; | |
11 | char *_PATH_SSH_SYSTEM_HOSTFILE2; | |
12 | char *_PATH_SERVER_CONFIG_FILE; | |
13 | char *_PATH_HOST_CONFIG_FILE; | |
14 | char *_PATH_HOST_KEY_FILE; | |
15 | char *_PATH_HOST_DSA_KEY_FILE; | |
16 | char *_PATH_HOST_RSA_KEY_FILE; | |
17 | char *_PATH_DH_MODULI; | |
18 | char *_PATH_DH_PRIMES; | |
19 | char *_PATH_SSH_PROGRAM; | |
20 | char *_PATH_SSH_SYSTEM_RC; | |
21 | char *_PATH_SSH_HOSTS_EQUIV; | |
22 | char *_PATH_SFTP_SERVER; | |
23 | ||
24 | static char * | |
25 | compose(const char str1[], const char str2[], const char str3[]) | |
26 | { | |
27 | int len; | |
28 | char *result; | |
29 | ||
30 | len = strlen(str1) + strlen(str2) + strlen(str3) + 1; | |
31 | result = xmalloc(len); | |
32 | snprintf(result, len, "%s%s%s", str1, str2, str3); | |
33 | ||
34 | return result; | |
35 | } | |
36 | ||
37 | void | |
38 | init_pathnames() | |
39 | { | |
40 | char *gl; | |
41 | ||
42 | gl = getenv("GLOBUS_LOCATION"); | |
43 | if (gl == NULL) { | |
44 | fatal("GLOBUS_LOCATION environment variable undefined."); | |
45 | } | |
46 | ||
47 | SSH_PRNG_COMMAND_FILE = compose(gl, SSHDIR, "/ssh_prng_cmds"); | |
48 | _PATH_SSH_SYSTEM_HOSTFILE = compose(gl, SSHDIR, "/ssh_known_hosts"); | |
49 | _PATH_SSH_SYSTEM_HOSTFILE2 = compose(gl, SSHDIR, "/ssh_known_hosts2"); | |
50 | _PATH_SERVER_CONFIG_FILE = compose(gl, SSHDIR, "/sshd_config"); | |
51 | _PATH_HOST_CONFIG_FILE = compose(gl, SSHDIR, "/ssh_config"); | |
52 | _PATH_HOST_KEY_FILE = compose(gl, SSHDIR, "/ssh_host_key"); | |
53 | _PATH_HOST_DSA_KEY_FILE = compose(gl, SSHDIR, "/ssh_host_dsa_key"); | |
54 | _PATH_HOST_RSA_KEY_FILE = compose(gl, SSHDIR, "/ssh_host_rsa_key"); | |
55 | _PATH_DH_MODULI = compose(gl, SSHDIR, "/moduli"); | |
56 | _PATH_DH_PRIMES = compose(gl, SSHDIR, "/primes"); | |
57 | _PATH_SSH_PROGRAM = compose(gl, BINDIR, "/ssh"); | |
58 | _PATH_SSH_SYSTEM_RC = compose(gl, SSHDIR, "/sshrc"); | |
59 | _PATH_SSH_HOSTS_EQUIV = compose(gl, SSHDIR, "/shosts.equiv"); | |
60 | _PATH_SFTP_SERVER = compose(gl, LIBEXEC, "/sftp-server"); | |
61 | } |