biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / admin / rset / paths.patch
blobaf09b0902ed033beb3351c07e8b4596a4f918aa6
1 diff --git a/execute.c b/execute.c
2 index be06068..3468fa7 100644
3 --- a/execute.c
4 +++ b/execute.c
5 @@ -242,7 +242,7 @@ verify_ssh_agent() {
6 char *output;
7 char *argv[32];
9 - append(argv, 0, "ssh-add", "-l", NULL);
10 + append(argv, 0, "@ssh-add@", "-l", NULL);
11 output = cmd_pipe_stdout(argv, &error_code, &output_size);
12 free(output);
14 @@ -282,7 +282,7 @@ start_connection(char *socket_path, Label *route_label, int http_port, const cha
17 argc = 0;
18 - argc = append(argv, argc, "ssh", "-fN", "-R", port_forwarding, "-S",
19 + argc = append(argv, argc, "@ssh@", "-fN", "-R", port_forwarding, "-S",
20 socket_path, "-M", NULL);
21 if (ssh_config)
22 (void) append(argv, argc, "-F", ssh_config, host_name, NULL);
23 @@ -292,12 +292,12 @@ start_connection(char *socket_path, Label *route_label, int http_port, const cha
24 return -1;
26 snprintf(tmp_path, sizeof(tmp_path), "mkdir " REMOTE_TMP_PATH, http_port);
27 - append(argv, 0, "ssh", "-S", socket_path, host_name, tmp_path, NULL);
28 + append(argv, 0, "@ssh@", "-S", socket_path, host_name, tmp_path, NULL);
29 if (run(argv) != 0)
30 return -1;
32 - snprintf(cmd, PATH_MAX, "tar -cf - %s -C " REPLICATED_DIRECTORY " ./ | "
33 - "exec ssh -q -S %s %s tar -xf - -C " REMOTE_TMP_PATH,
34 + snprintf(cmd, PATH_MAX, "@tar@ -cf - %s -C " REPLICATED_DIRECTORY " ./ | "
35 + "exec @ssh@ -q -S %s %s tar -xf - -C " REMOTE_TMP_PATH,
36 array_to_str(route_label->export_paths), socket_path, host_name,
37 http_port);
38 if (system(cmd) != 0) {
39 @@ -326,7 +326,7 @@ ssh_command_pipe(char *host_name, char *socket_path, Label *host_label, int http
41 /* construct ssh command */
42 argc = 0;
43 - argc = append(argv, argc, "ssh", "-T", "-S", socket_path, NULL);
44 + argc = append(argv, argc, "@ssh@", "-T", "-S", socket_path, NULL);
46 (void) append(argv, argc, host_name, cmd, NULL);
47 return cmd_pipe_stdin(argv, host_label->content, host_label->content_size);
48 @@ -344,7 +344,7 @@ ssh_command_tty(char *host_name, char *socket_path, Label *host_label, int http_
49 http_port);
50 /* construct ssh command */
51 argc = 0;
52 - argc = append(argv, argc, "ssh", "-T", "-S", socket_path, NULL);
53 + argc = append(argv, argc, "@ssh@", "-T", "-S", socket_path, NULL);
54 (void) append(argv, argc, host_name, cmd, NULL);
55 cmd_pipe_stdin(argv, host_label->content, host_label->content_size);
57 @@ -360,7 +360,7 @@ ssh_command_tty(char *host_name, char *socket_path, Label *host_label, int http_
59 /* construct ssh command */
60 argc = 0;
61 - argc = append(argv, argc, "ssh", "-t", "-S", socket_path, NULL);
62 + argc = append(argv, argc, "@ssh@", "-t", "-S", socket_path, NULL);
64 (void) append(argv, argc, host_name, cmd, NULL);
65 return run(argv);
66 @@ -375,11 +375,11 @@ end_connection(char *socket_path, char *host_name, int http_port) {
67 return;
69 snprintf(tmp_path, sizeof(tmp_path), REMOTE_TMP_PATH, http_port);
70 - append(argv, 0, "ssh", "-S", socket_path, host_name, "rm", "-rf", tmp_path , NULL);
71 + append(argv, 0, "@ssh@", "-S", socket_path, host_name, "rm", "-rf", tmp_path , NULL);
72 if (run(argv) != 0)
73 warn("remote tmp dir");
75 - append(argv, 0, "ssh", "-q", "-S", socket_path, "-O", "exit", host_name, NULL);
76 + append(argv, 0, "@ssh@", "-q", "-S", socket_path, "-O", "exit", host_name, NULL);
77 if (run(argv) != 0)
78 warn("exec ssh -O exit");
80 diff --git a/rset.c b/rset.c
81 index 383fc82..9c20f65 100644
82 --- a/rset.c
83 +++ b/rset.c
84 @@ -128,10 +128,8 @@ int main(int argc, char *argv[])
85 hostnames[i] = argv[optind+i];
86 hostnames[i] = NULL;
88 - if ((rinstall_bin = findprog("rinstall")) == 0)
89 - not_found("rinstall");
90 - if ((rsub_bin = findprog("rsub")) == 0)
91 - not_found("rsub");
92 + rinstall_bin = "@rinstall@";
93 + rsub_bin = "@rsub@";
95 /* all operations must be relative to the routes file */
96 if (realpath(xdirname(routes_file), routes_realpath) == NULL)
97 @@ -159,10 +157,9 @@ int main(int argc, char *argv[])
99 /* Convert http server command line into a vector */
100 inputstring = malloc(PATH_MAX);
101 - snprintf(inputstring, PATH_MAX, "miniquark -p %d -d " PUBLIC_DIRECTORY, http_port);
102 + snprintf(inputstring, PATH_MAX, "@miniquark@ -p %d -d " PUBLIC_DIRECTORY, http_port);
103 str_to_array(http_srv_argv, inputstring, sizeof(http_srv_argv));
104 - if ((httpd_bin = findprog(http_srv_argv[0])) == 0)
105 - not_found(http_srv_argv[0]);
106 + httpd_bin = "@miniquark@";
108 /* start the web server */
109 pipe(stdout_pipe);
110 @@ -397,7 +394,7 @@ handle_exit(int sig) {
111 printf("caught signal %d, terminating connection to '%s'\n", sig,
112 hostname);
113 /* clean up socket and SSH connection; leaving staging dir */
114 - execlp("ssh", "ssh", "-S", socket_path, "-O", "exit", hostname, NULL);
115 + execlp("@ssh@", "@ssh@", "-S", socket_path, "-O", "exit", hostname, NULL);
116 err(1, "ssh -O exit");
119 diff --git a/rutils.c b/rutils.c
120 index 1e182d8..9aef76d 100644
121 --- a/rutils.c
122 +++ b/rutils.c
123 @@ -77,7 +77,7 @@ install_if_new(const char *src, const char *dst) {
125 pid = fork();
126 if (pid == 0) {
127 - if (execl("/usr/bin/install", "/usr/bin/install", src, dst, NULL) != -1)
128 + if (execl("@install@", "@install@", src, dst, NULL) != -1)
129 err(1, "%s", dst);
131 waitpid(pid, &status, 0);