mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-03 00:27:15 +00:00
cli: manager, tape, debug: avoid setting up auth context for printdoc
as otherwise build fails in a clean environment, where no API auth key is available. This whole printdoc command injection is quite ugly and causes headache in general though, we'd be better off if we could do away with that.. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
15b5e60568
commit
783e88c2df
@ -23,7 +23,10 @@ fn main() {
|
||||
let mut rpcenv = CliEnvironment::new();
|
||||
rpcenv.set_auth_id(Some(format!("{}@pam", username)));
|
||||
|
||||
proxmox_backup::auth_helpers::setup_auth_context(true);
|
||||
let args: Vec<String> = std::env::args().take(2).collect();
|
||||
if args.len() < 2 || args[1] != "printdoc" {
|
||||
proxmox_backup::auth_helpers::setup_auth_context(true);
|
||||
}
|
||||
|
||||
run_cli_command(
|
||||
cmd_def,
|
||||
|
@ -490,7 +490,9 @@ async fn run() -> Result<(), Error> {
|
||||
let mut rpcenv = CliEnvironment::new();
|
||||
rpcenv.set_auth_id(Some(String::from("root@pam")));
|
||||
|
||||
proxmox_backup::auth_helpers::setup_auth_context(true);
|
||||
if args.len() < 2 || args[1] != "printdoc" {
|
||||
proxmox_backup::auth_helpers::setup_auth_context(true);
|
||||
}
|
||||
|
||||
run_async_cli_command(cmd_def, rpcenv).await; // this call exit(-1) on error
|
||||
|
||||
|
@ -1113,7 +1113,10 @@ fn main() {
|
||||
let mut rpcenv = CliEnvironment::new();
|
||||
rpcenv.set_auth_id(Some(String::from("root@pam")));
|
||||
|
||||
proxmox_backup::auth_helpers::setup_auth_context(true);
|
||||
let args: Vec<String> = std::env::args().take(2).collect();
|
||||
if args.len() < 2 || args[1] != "printdoc" {
|
||||
proxmox_backup::auth_helpers::setup_auth_context(true);
|
||||
}
|
||||
|
||||
proxmox_async::runtime::main(run_async_cli_command(cmd_def, rpcenv));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user