| 96 | } |
| 97 | |
| 98 | void print_child_argv(const char *prefix, char **cmd) |
| 99 | { |
| 100 | int cnt = 0; |
| 101 | rprintf(FCLIENT, "%s ", prefix); |
| 102 | for (; *cmd; cmd++) { |
| 103 | /* Look for characters that ought to be quoted. This |
| 104 | * is not a great quoting algorithm, but it's |
| 105 | * sufficient for a log message. */ |
| 106 | if (strspn(*cmd, "abcdefghijklmnopqrstuvwxyz" |
| 107 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| 108 | "0123456789" |
| 109 | ",.-_=+@/") != strlen(*cmd)) { |
| 110 | rprintf(FCLIENT, "\"%s\" ", *cmd); |
| 111 | } else { |
| 112 | rprintf(FCLIENT, "%s ", *cmd); |
| 113 | } |
| 114 | cnt++; |
| 115 | } |
| 116 | rprintf(FCLIENT, " (%d args)\n", cnt); |
| 117 | } |
| 118 | |
| 119 | /* This returns 0 for success, 1 for a symlink if symlink time-setting |
| 120 | * is not possible, or -1 for any other error. */ |
no test coverage detected