1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
diff --git a/execute.c b/execute.c
index be06068..3468fa7 100644
--- a/execute.c
+++ b/execute.c
@@ -260,7 +260,7 @@
char *output;
char *argv[32];
- append(argv, 0, "ssh-add", "-l", NULL);
+ append(argv, 0, "@ssh-add@", "-l", NULL);
output = cmd_pipe_stdout(argv, &error_code, &output_size);
free(output);
@@ -300,7 +300,7 @@
}
argc = 0;
- argc = append(argv, argc, "ssh", "-fN", "-R", port_forwarding, "-S", socket_path, "-M", NULL);
+ argc = append(argv, argc, "@ssh@", "-fN", "-R", port_forwarding, "-S", socket_path, "-M", NULL);
if (ssh_config)
(void) append(argv, argc, "-F", ssh_config, host_name, NULL);
else
@@ -309,8 +309,8 @@
return ret;
snprintf(cmd, PATH_MAX,
- "tar " TAR_OPTIONS " -cf - -C " REPLICATED_DIRECTORY " . "
- "| ssh -q -S %s %s 'mkdir %s; tar -xf - -C %s'",
+ "@tar@ " TAR_OPTIONS " -cf - -C " REPLICATED_DIRECTORY " . "
+ "| @ssh@ -q -S %s %s 'mkdir %s; tar -xf - -C %s'",
socket_path, host_name, stagedir(http_port), stagedir(http_port));
if ((ret = system(cmd)) != 0)
return ret;
@@ -320,8 +320,8 @@
array_to_str(route_label->export_paths, path_repr, sizeof(path_repr), " ");
snprintf(cmd, PATH_MAX,
- "tar " TAR_OPTIONS " -cf - %s "
- "| ssh -q -S %s %s 'tar -xf - -C %s'",
+ "@tar@ " TAR_OPTIONS " -cf - %s "
+ "| @ssh@ -q -S %s %s 'tar -xf - -C %s'",
path_repr, socket_path, host_name, stagedir(http_port));
if ((ret = system(cmd)) != 0)
@@ -407,7 +407,7 @@
/* construct ssh command */
argc = 0;
- argc = append(argv, argc, "ssh", "-T", "-S", socket_path, NULL);
+ argc = append(argv, argc, "@ssh@", "-T", "-S", socket_path, NULL);
(void) append(argv, argc, host_name, cmd, NULL);
ret = cmd_pipe_stdin(argv, host_label->content, host_label->content_size);
@@ -432,7 +432,7 @@
snprintf(cmd, sizeof(cmd), "cat > %s/_script", stagedir(http_port));
/* construct ssh command */
argc = 0;
- argc = append(argv, argc, "ssh", "-T", "-S", socket_path, NULL);
+ argc = append(argv, argc, "@ssh@", "-T", "-S", socket_path, NULL);
(void) append(argv, argc, host_name, cmd, NULL);
cmd_pipe_stdin(argv, host_label->content, host_label->content_size);
@@ -450,7 +450,7 @@
/* construct ssh command */
argc = 0;
- argc = append(argv, argc, "ssh", "-t", "-S", socket_path, NULL);
+ argc = append(argv, argc, "@ssh@", "-t", "-S", socket_path, NULL);
(void) append(argv, argc, host_name, cmd, NULL);
ret = run(argv);
@@ -498,11 +498,11 @@
if (access(socket_path, F_OK) == -1)
return;
- append(argv, 0, "ssh", "-S", socket_path, host_name, "rm", "-rf", stagedir(http_port), NULL);
+ append(argv, 0, "@ssh@", "-S", socket_path, host_name, "rm", "-rf", stagedir(http_port), NULL);
if (run(argv) != 0)
warn("remote tmp dir");
- append(argv, 0, "ssh", "-q", "-S", socket_path, "-O", "exit", host_name, NULL);
+ append(argv, 0, "@ssh@", "-q", "-S", socket_path, "-O", "exit", host_name, NULL);
if (run(argv) != 0)
warn("exec ssh -O exit");
}
diff --git a/rset.c b/rset.c
index 383fc82..9c20f65 100644
--- a/rset.c
+++ b/rset.c
@@ -104,10 +104,8 @@
if ((renv_bin = findprog("renv")) == 0)
not_found("renv");
- if ((rinstall_bin = findprog("rinstall")) == 0)
- not_found("rinstall");
- if ((rsub_bin = findprog("rsub")) == 0)
- not_found("rsub");
+ rinstall_bin = "@rinstall@";
+ rsub_bin = "@rsub@";
/* all operations must be relative to the routes file */
if (realpath(xdirname(routes_file), routes_realpath) == NULL)
@@ -404,7 +402,7 @@
if (socket_path && hostname && http_port) {
printf("caught signal %d, terminating connection to '%s'\n", sig, hostname);
/* clean up socket and SSH connection; leaving staging dir */
- execlp("ssh", "ssh", "-S", socket_path, "-O", "exit", hostname, NULL);
+ execlp("@ssh@", "@ssh@", "-S", socket_path, "-O", "exit", hostname, NULL);
err(1, "ssh -O exit");
}
}
@@ -533,10 +531,9 @@
/* Convert http server command line into a vector */
inputstring = malloc(PATH_MAX);
- snprintf(inputstring, PATH_MAX, "miniquark -p %d -d " PUBLIC_DIRECTORY, http_port);
+ snprintf(inputstring, PATH_MAX, "@miniquark@ -p %d -d " PUBLIC_DIRECTORY, http_port);
str_to_array(http_srv_argv, inputstring, sizeof(http_srv_argv), " ");
- if ((httpd_bin = findprog(http_srv_argv[0])) == 0)
- not_found(http_srv_argv[0]);
+ httpd_bin = "@miniquark@";
/* start the web server */
pipe(stdout_pipe);
diff --git a/rutils.c b/rutils.c
index 1e182d8..9aef76d 100644
--- a/rutils.c
+++ b/rutils.c
@@ -123,7 +123,7 @@
pid = fork();
if (pid == 0) {
- if (execl("/usr/bin/install", "/usr/bin/install", src, dst, NULL) != -1)
+ if (execl("@install@", "@install@", src, dst, NULL) != -1)
err(1, "%s", dst);
}
waitpid(pid, &status, 0);
|