MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / formatWithSudo

Function formatWithSudo

programs/install/Install.cpp:193–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191
192
193static 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
209int mainEntryClickHouseInstall(int argc, char ** argv);

Callers 6

Install.cppFile · 0.85
catchFunction · 0.85
mainEntryClickHouseStartFunction · 0.85
mainEntryClickHouseStopFunction · 0.85

Calls 2

shellQuoteFunction · 0.85
formatFunction · 0.50

Tested by

no test coverage detected