Johan Sørensen schrieb: > The argument is an executable script that will receive the path to the repos > the client wishes to clone as an argument. It is then the responsibility of the > script to return a zero-terminated string on its stdout with the real path of > the target repository. > > This buys us a lot of flexibility when it comes to managing different > repositories, possibly located in many different dirs, but with a uniform > url-structure to the outside world. It's the first time that I see a deamon with this feature - except perhaps Apache's ModRewrite. Are you sure you are not working around your problem at the wrong place? Doesn't --interpolated-path already solve your problem? If not, then you at least you must describe in the documentation the use-cases when --path-filter should be preferred. Your implementation does not pass the target hostname to the script, but it should; otherwise you lose flexibility (for virtual hosting). > +static char *run_path_filter_script(char *requested_dir) { > + pid_t pid; > + char result[256]; /* arbitary */ > + char *real_path; > + int pipe_out[2]; > + int exit_code = 1; > + > + pipe(pipe_out); > + > + loginfo("Executing path filter script: '%s %s'", path_filter_script, requested_dir); > + > + switch ((pid = fork())) { > + case -1: > + logerror("path filter script fork() failed: %s", strerror(errno)); > + return NULL; > + case 0: > + close(pipe_out[0]); > + dup2(pipe_out[1], 1); > + close(pipe_out[1]); > + > + execl(path_filter_script, path_filter_script, requested_dir, NULL); Use start_command()/finish_command() instead of rolling your own fork/exec combo. -- Hannes -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html