在我的厨师烹饪书中,有几个命令使用了 Mixlib::ShellOut
例如
cmd = Mixlib::ShellOut.new(format('getent group %s', 'test'))
cmd.run_command
cmd = Mixlib::ShellOut.new(format('getent pasword %s', 'test'))
cmd.run_command
不幸的是,我的构建过程一直以下列错误失败,这主要是由于我无法更改某些配置。
侦测到对Mixlib::ShellOut的调用。在你的机器上执行命令是不安全的!
有什么办法可以解决这个问题吗?
你可以使用后缀。
`ls -ltr >> logs.txt 2>&1`