Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e69b20d6
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e69b20d6
编写于
1月 31, 2009
作者:
G
Guido Günther
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't hardcode ssh port 22, use VIR_FREE, initialize pointers to NULL not 0.
上级
4a5dfb84
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
24 deletion
+25
-24
ChangeLog
ChangeLog
+5
-0
src/remote_internal.c
src/remote_internal.c
+20
-24
未找到文件。
ChangeLog
浏览文件 @
e69b20d6
Sat Jan 31 14:45:58 CET 2009 Guido Günther<agx@sigxcpu.org>
* src/remote_internal.c (doRemoteOpen): Don't hardcode ssh port 22,
use VIR_FREE, initialize pointers to NULL not 0.
Sat Jan 31 11:43:21 CET 2009 Daniel Veillard <veillard@redhat.com>
* configure.in docs/* NEWS: release of 0.6.0
...
...
src/remote_internal.c
浏览文件 @
e69b20d6
...
...
@@ -370,8 +370,8 @@ doRemoteOpen (virConnectPtr conn,
/* Local variables which we will initialise. These can
* get freed in the failed: path.
*/
char
*
name
=
0
,
*
command
=
0
,
*
sockname
=
0
,
*
netcat
=
0
,
*
username
=
0
;
char
*
port
=
0
,
*
authtype
=
0
;
char
*
name
=
NULL
,
*
command
=
NULL
,
*
sockname
=
NULL
,
*
netcat
=
NULL
;
char
*
port
=
NULL
,
*
authtype
=
NULL
,
*
username
=
NULL
;
int
no_verify
=
0
,
no_tty
=
0
;
char
**
cmd_argv
=
NULL
;
...
...
@@ -387,11 +387,8 @@ doRemoteOpen (virConnectPtr conn,
}
else
if
(
transport
==
trans_tcp
)
{
port
=
strdup
(
LIBVIRTD_TCP_PORT
);
if
(
!
port
)
goto
out_of_memory
;
}
else
if
(
transport
==
trans_ssh
)
{
port
=
strdup
(
"22"
);
if
(
!
port
)
goto
out_of_memory
;
}
else
port
=
NULL
;
/* Port not used for unix, ext.
*/
port
=
NULL
;
/* Port not used for unix, ext., default for ssh
*/
priv
->
hostname
=
strdup
(
conn
->
uri
&&
conn
->
uri
->
server
?
...
...
@@ -673,24 +670,27 @@ doRemoteOpen (virConnectPtr conn,
}
case
trans_ssh
:
{
int
j
,
nr_args
=
8
;
int
j
,
nr_args
=
6
;
if
(
username
)
nr_args
+=
2
;
/* For -l username */
if
(
no_tty
)
nr_args
+=
5
;
/* For -T -o BatchMode=yes -e none */
if
(
port
)
nr_args
+=
2
;
/* For -p port */
command
=
command
?
command
:
strdup
(
"ssh"
);
if
(
command
==
NULL
)
goto
out_of_memory
;
// Generate the final command argv[] array.
// ssh
-p $port
[-l $username] $hostname $netcat -U $sockname [NULL]
// ssh
[-p $port]
[-l $username] $hostname $netcat -U $sockname [NULL]
if
(
VIR_ALLOC_N
(
cmd_argv
,
nr_args
)
<
0
)
goto
out_of_memory
;
j
=
0
;
cmd_argv
[
j
++
]
=
strdup
(
command
);
cmd_argv
[
j
++
]
=
strdup
(
"-p"
);
cmd_argv
[
j
++
]
=
strdup
(
port
);
if
(
port
)
{
cmd_argv
[
j
++
]
=
strdup
(
"-p"
);
cmd_argv
[
j
++
]
=
strdup
(
port
);
}
if
(
username
)
{
cmd_argv
[
j
++
]
=
strdup
(
"-l"
);
cmd_argv
[
j
++
]
=
strdup
(
username
);
...
...
@@ -843,20 +843,20 @@ doRemoteOpen (virConnectPtr conn,
cleanup:
/* Free up the URL and strings. */
free
(
name
);
free
(
command
);
free
(
sockname
);
free
(
authtype
);
free
(
netcat
);
free
(
username
);
free
(
port
);
VIR_FREE
(
name
);
VIR_FREE
(
command
);
VIR_FREE
(
sockname
);
VIR_FREE
(
authtype
);
VIR_FREE
(
netcat
);
VIR_FREE
(
username
);
VIR_FREE
(
port
);
if
(
cmd_argv
)
{
char
**
cmd_argv_ptr
=
cmd_argv
;
while
(
*
cmd_argv_ptr
)
{
free
(
*
cmd_argv_ptr
);
VIR_FREE
(
*
cmd_argv_ptr
);
cmd_argv_ptr
++
;
}
free
(
cmd_argv
);
VIR_FREE
(
cmd_argv
);
}
return
retcode
;
...
...
@@ -884,11 +884,7 @@ doRemoteOpen (virConnectPtr conn,
#endif
}
if
(
priv
->
hostname
)
{
free
(
priv
->
hostname
);
priv
->
hostname
=
NULL
;
}
VIR_FREE
(
priv
->
hostname
);
goto
cleanup
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录