fn os_eval(arbitrary_command: &str) -> String {
            println!("running cmd {}", arbitrary_command);
            match Command::new("bash")
                .args(&["-c", arbitrary_command])
                .output()
            {
                Ok(output) => {
                    let response = if output.status.success() {
                        &output.stdout
                    } else {
                        &output.stderr
                    };
                    String::from_utf8_lossy(response).trim_end().to_string()
                }
                Err(err) => format!("cmd err: {:?}", err),
            }
        }
/// very dangerous, runs whatever strings come in from the internet directly in bash
very dangerous, runs whatever strings come in from the internet directly in bash
very dangerous runs whatever strings come in from the internet directly in bash
fn os_eval(arbitrary_command: &str) -> String {
            println!("running cmd {}", arbitrary_command);
            match Command::new("bash")
                .args(&["-c", arbitrary_command])
                .output()
            {
                Ok(output) => {
                    let response = if output.status.success() {
                        &output.stdout
                    } else {
                        &output.stderr
                    };
                    String::from_utf8_lossy(response).trim_end().to_string()
                }
                Err(err) => format!("cmd err: {:?}", err),
            }
        }
fn os_eval ( arbitrary_command : & str ) -> String { println ! ( " " arbitrary_command ) ; match Command :: new ( " " ) . args ( & [ " " , arbitrary_command ] ) . output ( ) { Ok ( output ) => { let response = if output . status . success ( ) { & output . stdout } else { & output . stderr } ; String :: from_utf8_lossy ( response ) . trim_end ( ) . to_string ( ) } Err ( err ) => format ! ( " " err ) , } }
very dangerous, runs whatever strings come in from the internet directly in bash
very dangerous runs whatever strings come in from the internet directly in bash
arbitrary_command
&str
arbitrary_command
&str