| 191 | |
| 192 | |
| 193 | static std::string formatWithSudo(std::string command, bool needed = true) |
| 194 | { |
| 195 | if (!needed) |
| 196 | return command; |
| 197 | |
| 198 | #if defined(OS_FREEBSD) |
| 199 | /// FreeBSD does not have 'sudo' installed. |
| 200 | /// `su -c` takes a single shell command string, so quote the whole command |
| 201 | /// to keep embedded shell metacharacters from breaking the wrapper. |
| 202 | return fmt::format("su -m root -c {}", shellQuote(command)); |
| 203 | #else |
| 204 | return fmt::format("sudo {}", command); |
| 205 | #endif |
| 206 | } |
| 207 | |
| 208 | |
| 209 | int mainEntryClickHouseInstall(int argc, char ** argv); |
no test coverage detected