Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
11cdc424
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
11cdc424
编写于
8月 13, 2013
作者:
R
Ruben Kerkhof
提交者:
Eric Blake
8月 13, 2013
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virt-login-shell: improve error message grammar
and wrap some long lines Signed-off-by:
N
Eric Blake
<
eblake@redhat.com
>
上级
b777a12d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
6 deletion
+12
-6
tools/virt-login-shell.c
tools/virt-login-shell.c
+12
-6
未找到文件。
tools/virt-login-shell.c
浏览文件 @
11cdc424
...
@@ -76,7 +76,8 @@ static int virLoginShellAllowedUser(virConfPtr conf,
...
@@ -76,7 +76,8 @@ static int virLoginShellAllowedUser(virConfPtr conf,
/* Calc length and check items */
/* Calc length and check items */
for
(
pp
=
p
->
list
;
pp
;
pp
=
pp
->
next
)
{
for
(
pp
=
p
->
list
;
pp
;
pp
=
pp
->
next
)
{
if
(
pp
->
type
!=
VIR_CONF_STRING
)
{
if
(
pp
->
type
!=
VIR_CONF_STRING
)
{
virReportSystemError
(
EINVAL
,
"%s"
,
_
(
"shell must be a list of strings"
));
virReportSystemError
(
EINVAL
,
"%s"
,
_
(
"shell must be a list of strings"
));
goto
cleanup
;
goto
cleanup
;
}
else
{
}
else
{
/*
/*
...
@@ -105,7 +106,9 @@ static int virLoginShellAllowedUser(virConfPtr conf,
...
@@ -105,7 +106,9 @@ static int virLoginShellAllowedUser(virConfPtr conf,
}
}
}
}
}
}
virReportSystemError
(
EPERM
,
_
(
"%s not matched against 'allowed_users' in %s"
),
name
,
conf_file
);
virReportSystemError
(
EPERM
,
_
(
"%s not matched against 'allowed_users' in %s"
),
name
,
conf_file
);
cleanup:
cleanup:
VIR_FREE
(
gname
);
VIR_FREE
(
gname
);
return
ret
;
return
ret
;
...
@@ -128,7 +131,8 @@ static char **virLoginShellGetShellArgv(virConfPtr conf)
...
@@ -128,7 +131,8 @@ static char **virLoginShellGetShellArgv(virConfPtr conf)
/* Calc length and check items */
/* Calc length and check items */
for
(
len
=
0
,
pp
=
p
->
list
;
pp
;
len
++
,
pp
=
pp
->
next
)
{
for
(
len
=
0
,
pp
=
p
->
list
;
pp
;
len
++
,
pp
=
pp
->
next
)
{
if
(
pp
->
type
!=
VIR_CONF_STRING
)
{
if
(
pp
->
type
!=
VIR_CONF_STRING
)
{
virReportSystemError
(
EINVAL
,
"%s"
,
_
(
"shell must be a list of strings"
));
virReportSystemError
(
EINVAL
,
"%s"
,
_
(
"shell must be a list of strings"
));
goto
error
;
goto
error
;
}
}
}
}
...
@@ -248,7 +252,8 @@ main(int argc, char **argv)
...
@@ -248,7 +252,8 @@ main(int argc, char **argv)
}
}
if
(
uid
==
0
)
{
if
(
uid
==
0
)
{
virReportSystemError
(
EPERM
,
_
(
"%s must be run by non root users"
),
progname
);
virReportSystemError
(
EPERM
,
_
(
"%s must be run by non root users"
),
progname
);
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -340,11 +345,12 @@ main(int argc, char **argv)
...
@@ -340,11 +345,12 @@ main(int argc, char **argv)
if
(
ccpid
==
0
)
{
if
(
ccpid
==
0
)
{
if
(
chdir
(
homedir
)
<
0
)
{
if
(
chdir
(
homedir
)
<
0
)
{
virReportSystemError
(
errno
,
_
(
"Unable chdir(%s)"
),
homedir
);
virReportSystemError
(
errno
,
_
(
"Unable
to
chdir(%s)"
),
homedir
);
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
}
if
(
execv
(
shargv
[
0
],
(
char
*
const
*
)
shargv
)
<
0
)
{
if
(
execv
(
shargv
[
0
],
(
char
*
const
*
)
shargv
)
<
0
)
{
virReportSystemError
(
errno
,
_
(
"Unable exec shell %s"
),
shargv
[
0
]);
virReportSystemError
(
errno
,
_
(
"Unable to exec shell %s"
),
shargv
[
0
]);
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录