]> andersk Git - gssapi-openssh.git/blame - openssh/pathnames.c
modified to meet GPT relocatability requirements by replacing paths fixed
[gssapi-openssh.git] / openssh / pathnames.c
CommitLineData
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
9char *SSH_PRNG_COMMAND_FILE;
10char *_PATH_SSH_SYSTEM_HOSTFILE;
11char *_PATH_SSH_SYSTEM_HOSTFILE2;
12char *_PATH_SERVER_CONFIG_FILE;
13char *_PATH_HOST_CONFIG_FILE;
14char *_PATH_HOST_KEY_FILE;
15char *_PATH_HOST_DSA_KEY_FILE;
16char *_PATH_HOST_RSA_KEY_FILE;
17char *_PATH_DH_MODULI;
18char *_PATH_DH_PRIMES;
19char *_PATH_SSH_PROGRAM;
20char *_PATH_SSH_SYSTEM_RC;
21char *_PATH_SSH_HOSTS_EQUIV;
22char *_PATH_SFTP_SERVER;
23
24static char *
25compose(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
37void
38init_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}
This page took 0.131361 seconds and 5 git commands to generate.