• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Virtual machine Management Terminal User Interface


Commit MetaInfo

修订版bf32d1ba9d65afca6a16da650cae3227fd632197 (tree)
时间2023-04-01 22:23:34
作者Koine Yuusuke(koinec) <koinec@user...>
CommiterKoine Yuusuke(koinec)

Log Message

WorkBackup

更改概述

差异

--- a/src/config.h
+++ b/src/config.h
@@ -36,13 +36,14 @@
3636 #define VMTUI_CONFIG_EXTERN extern
3737 #endif
3838
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
4647
4748 #endif
4849
--- a/src/localexec.c
+++ b/src/localexec.c
@@ -222,22 +222,38 @@ int
222222 i_remain -= i_len;
223223 pstr_now += i_len;
224224
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;
228236 }
229237
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;
233245
234246 // XXX sudo option
235247
236248 }
237249
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;
241257
242258 i_len = strnlen( str_vmname, GUEST_MAXLEN_NAME );
243259 strncpy( pstr_now, str_vmname, i_remain );
@@ -248,7 +264,6 @@ int
248264 strncpy( pstr_now, "\"", i_remain );
249265 i_remain -= 1 + 1;
250266 pstr_now += 1 + 1;
251-
252267 }
253268
254269 HVisor_Release( p_hvisor );