Skip to content

[sec-core] bug: "agent-sec-cli harden --scan --config"命令带非法的配置报错,返回值不应该为0 #820

@zhangtaibo

Description

@zhangtaibo

Component

sec-core

What happened?

"agent-sec-cli harden --scan --config"命令带非法的配置报错,返回值不应该为0
详细见如下命令,报错后,返回值应该非0

[root@iZj6chp3byox7hzohnmhi6Z ~]# agent-sec-cli harden --scan --config "this_config_does_not_exist_xyz"
[ERROR 15:24:39] modules/seharden/profile.lua:201: Failed to read profile file '/etc/loongshield/seharden/this_config_does_not_exist_xyz.yml': cannot obtain information from file '/etc/loongshield/seharden/this_config_does_not_exist_xyz.yml': No such file or directory
[root@iZj6chp3byox7hzohnmhi6Z ~]# echo $?
0

Diagnostic Output

Additional Context

No response

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions