19 const std::string &fqrn,
20 const std::string &path_hooks) {
26 std::set<int> preserve_fildes;
27 preserve_fildes.insert(0);
28 preserve_fildes.insert(1);
29 preserve_fildes.insert(2);
30 std::map<int, int> map_fildes;
31 map_fildes[pipe_stdin[0]] = 0;
32 std::vector<std::string> cmd_line;
33 cmd_line.push_back(
"/bin/sh");
48 const std::string callout = func +
"() { :; }\n" +
". " + path_hooks +
"\n"
49 + func +
" " + fqrn +
"\n";
50 WritePipe(pipe_stdin[1], callout.data(), callout.length());
int CallServerHook(const std::string &func, const std::string &fqrn, const std::string &path_hooks="/etc/cvmfs/cvmfs_server_hooks.sh")
bool ManagedExec(const std::vector< std::string > &command_line, const std::set< int > &preserve_fildes, const std::map< int, int > &map_fildes, const bool drop_credentials, const bool clear_env, const bool double_fork, pid_t *child_pid)
int WaitForChild(pid_t pid, const std::vector< int > &sig_ok)
void MakePipe(int pipe_fd[2])
bool FileExists(const std::string &path)
void WritePipe(int fd, const void *buf, size_t nbyte)
void ClosePipe(int pipe_fd[2])