Virtual machine Management Terminal User Interface
修订版 | bf32d1ba9d65afca6a16da650cae3227fd632197 (tree) |
---|---|
时间 | 2023-04-01 22:23:34 |
作者 | ![]() |
Commiter | Koine Yuusuke(koinec) |
WorkBackup
@@ -36,13 +36,14 @@ | ||
36 | 36 | #define VMTUI_CONFIG_EXTERN extern |
37 | 37 | #endif |
38 | 38 | |
39 | -#define SHELL_DEFAULT_PATH "/bin/sh" | |
40 | -#define SHELL_DEFAULT_PATH_LEN 7 | |
41 | -#define OPENSSH_DEFAULT_PATH "/usr/bin/ssh" | |
42 | -#define SUDO_DEFAULT_PATH "/usr/local/bin/sudo" | |
43 | -#define VNCVIEWER_DEFAULT_PATH "/usr/local/bin/vncviewer" | |
44 | -#define XTERMINAL_DEFAULT_PATH "/usr/local/bin/xterm" | |
45 | -#define VMBHYVE_DEFAULT_PATH "/usr/local/sbin/vm" | |
39 | +#define SHELL_DEFAULT_PATH "/bin/sh" | |
40 | +#define SHELL_DEFAULT_PATH_LEN 7 | |
41 | +#define OPENSSH_DEFAULT_PATH "/usr/bin/ssh" | |
42 | +#define SUDO_DEFAULT_PATH "/usr/local/bin/sudo" | |
43 | +#define VNCVIEWER_DEFAULT_PATH "/usr/local/bin/vncviewer" | |
44 | +#define XTERMINAL_DEFAULT_PATH "/usr/local/bin/xterm" | |
45 | +#define VMBHYVE_DEFAULT_PATH "/usr/local/sbin/vm" | |
46 | +#define VMBHYVE_DEFAULT_PATH_LEN 18 | |
46 | 47 | |
47 | 48 | #endif |
48 | 49 |
@@ -222,22 +222,38 @@ int | ||
222 | 222 | i_remain -= i_len; |
223 | 223 | pstr_now += i_len; |
224 | 224 | |
225 | - strncpy( pstr_now, " | /usr/local/bin/sudo -S -v; ", i_remain ); | |
226 | - i_remain -= 30; | |
227 | - pstr_now += 30; | |
225 | + strncpy( pstr_now, " | ", i_remain ); | |
226 | + i_remain -= 3; | |
227 | + pstr_now += 3; | |
228 | + | |
229 | + strncpy( pstr_now, p_hvisor->sudo.path.str_path, i_remain ); | |
230 | + i_remain -= p_hvisor->sudo.path.i_len; | |
231 | + pstr_now += p_hvisor->sudo.path.i_len; | |
232 | + | |
233 | + strncpy( pstr_now, " -S -v; ", i_remain ); | |
234 | + i_remain -= 8; | |
235 | + pstr_now += 8; | |
228 | 236 | } |
229 | 237 | |
230 | - strncpy( pstr_now, "/usr/local/bin/sudo -s ", i_remain ); | |
231 | - i_remain -= 23; | |
232 | - pstr_now += 23; | |
238 | + strncpy( pstr_now, p_hvisor->sudo.path.str_path, i_remain ); | |
239 | + i_remain -= p_hvisor->sudo.path.i_len; | |
240 | + pstr_now += p_hvisor->sudo.path.i_len; | |
241 | + | |
242 | + strncpy( pstr_now, " -s ", i_remain ); | |
243 | + i_remain -= 4; | |
244 | + pstr_now += 4; | |
233 | 245 | |
234 | 246 | // XXX sudo option |
235 | 247 | |
236 | 248 | } |
237 | 249 | |
238 | - strncpy( pstr_now, "/usr/local/sbin/vm console ", i_remain ); | |
239 | - i_remain -= 27; | |
240 | - pstr_now += 27; | |
250 | + strncpy( pstr_now, VMBHYVE_DEFAULT_PATH, VMBHYVE_DEFAULT_PATH_LEN ); | |
251 | + i_remain -= VMBHYVE_DEFAULT_PATH_LEN; | |
252 | + pstr_now += VMBHYVE_DEFAULT_PATH_LEN; | |
253 | + | |
254 | + strncpy( pstr_now, " console ", i_remain ); | |
255 | + i_remain -= 9; | |
256 | + pstr_now += 9; | |
241 | 257 | |
242 | 258 | i_len = strnlen( str_vmname, GUEST_MAXLEN_NAME ); |
243 | 259 | strncpy( pstr_now, str_vmname, i_remain ); |
@@ -248,7 +264,6 @@ int | ||
248 | 264 | strncpy( pstr_now, "\"", i_remain ); |
249 | 265 | i_remain -= 1 + 1; |
250 | 266 | pstr_now += 1 + 1; |
251 | - | |
252 | 267 | } |
253 | 268 | |
254 | 269 | HVisor_Release( p_hvisor ); |