mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-02-23 07:24:24 +01:00
Merge pull request #8549 from jodh-intel/tdx-no-root
libs: protection: x86_64: drop root requirement for querying
This commit is contained in:
@@ -13,7 +13,6 @@ use kata_sys_util::protection;
|
||||
use kata_types::config::TomlConfig;
|
||||
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use nix::unistd::Uid;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fs::File;
|
||||
use std::io::{self, Write};
|
||||
@@ -473,10 +472,6 @@ pub fn get_env_info(toml_config: &TomlConfig) -> Result<EnvInfo> {
|
||||
}
|
||||
|
||||
pub fn handle_env(env_args: EnvArgument) -> Result<()> {
|
||||
if !Uid::effective().is_root() {
|
||||
return Err(anyhow!("kata-ctl env command requires root privileges to get host information. Please run as root or use sudo"));
|
||||
}
|
||||
|
||||
let mut file: Box<dyn Write> = if let Some(path) = env_args.file {
|
||||
Box::new(
|
||||
File::create(path.as_str()).with_context(|| format!("Error creating file {}", path))?,
|
||||
|
||||
Reference in New Issue
Block a user