2 * Logging and utility functions.
4 * Copyright (C) 1998-2001 Andrew Tridgell <tridge@samba.org>
5 * Copyright (C) 2000-2001 Martin Pool <mbp@samba.org>
6 * Copyright (C) 2003-2009 Wayne Davison
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, visit the http://fsf.org website.
30 extern int am_generator
;
31 extern int local_server
;
34 extern int checksum_len
;
35 extern int allow_8bit_chars
;
36 extern int protocol_version
;
37 extern int always_checksum
;
38 extern int preserve_times
;
39 extern int msgs2stderr
;
40 extern int stdout_format_has_i
;
41 extern int stdout_format_has_o_or_i
;
42 extern int logfile_format_has_i
;
43 extern int logfile_format_has_o_or_i
;
44 extern int receiver_symlink_times
;
45 extern int64 total_data_written
;
46 extern int64 total_data_read
;
47 extern mode_t orig_umask
;
48 extern char *auth_user
;
49 extern char *stdout_format
;
50 extern char *logfile_format
;
51 extern char *logfile_name
;
53 extern iconv_t ic_chck
;
56 extern iconv_t ic_recv
;
58 extern char curr_dir
[MAXPATHLEN
];
59 extern char *full_module_path
;
60 extern unsigned int module_dirlen
;
61 extern char sender_file_sum
[MAX_DIGEST_LEN
];
62 extern const char undetermined_hostname
[];
64 static int log_initialised
;
65 static int logfile_was_closed
;
66 static FILE *logfile_fp
;
69 int got_xfer_error
= 0;
70 int output_needs_newline
= 0;
71 int send_msgs_to_gen
= 0;
73 static int64 initial_data_written
;
74 static int64 initial_data_read
;
79 } const rerr_names
[] = {
80 { RERR_SYNTAX
, "syntax or usage error" },
81 { RERR_PROTOCOL
, "protocol incompatibility" },
82 { RERR_FILESELECT
, "errors selecting input/output files, dirs" },
83 { RERR_UNSUPPORTED
, "requested action not supported" },
84 { RERR_STARTCLIENT
, "error starting client-server protocol" },
85 { RERR_SOCKETIO
, "error in socket IO" },
86 { RERR_FILEIO
, "error in file IO" },
87 { RERR_STREAMIO
, "error in rsync protocol data stream" },
88 { RERR_MESSAGEIO
, "errors with program diagnostics" },
89 { RERR_IPC
, "error in IPC code" },
90 { RERR_CRASHED
, "sibling process crashed" },
91 { RERR_TERMINATED
, "sibling process terminated abnormally" },
92 { RERR_SIGNAL1
, "received SIGUSR1" },
93 { RERR_SIGNAL
, "received SIGINT, SIGTERM, or SIGHUP" },
94 { RERR_WAITCHILD
, "waitpid() failed" },
95 { RERR_MALLOC
, "error allocating core memory buffers" },
96 { RERR_PARTIAL
, "some files/attrs were not transferred (see previous errors)" },
97 { RERR_VANISHED
, "some files vanished before they could be transferred" },
98 { RERR_DEL_LIMIT
, "the --max-delete limit stopped deletions" },
99 { RERR_TIMEOUT
, "timeout in data send/receive" },
100 { RERR_CONTIMEOUT
, "timeout waiting for daemon connection" },
101 { RERR_CMD_FAILED
, "remote shell failed" },
102 { RERR_CMD_KILLED
, "remote shell killed" },
103 { RERR_CMD_RUN
, "remote command could not be run" },
104 { RERR_CMD_NOTFOUND
,"remote command not found" },
109 * Map from rsync error code to name, or return NULL.
111 static char const *rerr_name(int code
)
114 for (i
= 0; rerr_names
[i
].name
; i
++) {
115 if (rerr_names
[i
].code
== code
)
116 return rerr_names
[i
].name
;
121 static void logit(int priority
, const char *buf
)
123 if (logfile_was_closed
)
126 fprintf(logfile_fp
, "%s [%d] %s",
127 timestring(time(NULL
)), (int)getpid(), buf
);
130 syslog(priority
, "%s", buf
);
134 static void syslog_init()
136 static int been_here
= 0;
137 int options
= LOG_PID
;
144 options
|= LOG_NDELAY
;
148 openlog("rsyncd", options
, lp_syslog_facility(module_id
));
150 openlog("rsyncd", options
);
154 logit(LOG_INFO
, "rsyncd started\n");
158 static void logfile_open(void)
160 mode_t old_umask
= umask(022 | orig_umask
);
161 logfile_fp
= fopen(logfile_name
, "a");
164 int fopen_errno
= errno
;
165 /* Rsync falls back to using syslog on failure. */
167 rsyserr(FERROR
, fopen_errno
,
168 "failed to open log-file %s", logfile_name
);
169 rprintf(FINFO
, "Ignoring \"log file\" setting.\n");
173 void log_init(int restart
)
175 if (log_initialised
) {
178 if (strcmp(logfile_name
, lp_log_file(module_id
)) != 0) {
185 } else if (*logfile_name
)
186 return; /* unchanged, non-empty "log file" names */
187 else if (lp_syslog_facility(-1) != lp_syslog_facility(module_id
))
190 return; /* unchanged syslog settings */
194 /* This looks pointless, but it is needed in order for the
195 * C library on some systems to fetch the timezone info
196 * before the chroot. */
197 timestring(time(NULL
));
199 /* Optionally use a log file instead of syslog. (Non-daemon
200 * rsyncs will have already set logfile_name, as needed.) */
201 if (am_daemon
&& !logfile_name
)
202 logfile_name
= lp_log_file(module_id
);
203 if (logfile_name
&& *logfile_name
)
209 void logfile_close(void)
212 logfile_was_closed
= 1;
218 void logfile_reopen(void)
220 if (logfile_was_closed
) {
221 logfile_was_closed
= 0;
226 static void filtered_fwrite(FILE *f
, const char *buf
, int len
, int use_isprint
)
228 const char *s
, *end
= buf
+ len
;
229 for (s
= buf
; s
< end
; s
++) {
231 && *s
== '\\' && s
[1] == '#'
236 && ((use_isprint
&& !isPrint(s
))
237 || *(uchar
*)s
< ' '))) {
238 if (s
!= buf
&& fwrite(buf
, s
- buf
, 1, f
) != 1)
239 exit_cleanup(RERR_MESSAGEIO
);
240 fprintf(f
, "\\#%03o", *(uchar
*)s
);
244 if (buf
!= end
&& fwrite(buf
, end
- buf
, 1, f
) != 1)
245 exit_cleanup(RERR_MESSAGEIO
);
248 /* this is the underlying (unformatted) rsync debugging function. Call
249 * it with FINFO, FERROR_*, FWARNING, FLOG, or FCLIENT. Note: recursion
250 * can happen with certain fatal conditions. */
251 void rwrite(enum logcode code
, const char *buf
, int len
, int is_utf8
)
253 int trailing_CR_or_NL
;
254 FILE *f
= msgs2stderr
? stderr
: stdout
;
256 iconv_t ic
= is_utf8
&& ic_recv
!= (iconv_t
)-1 ? ic_recv
: ic_chck
;
259 iconv_t ic
= ic_chck
;
264 exit_cleanup(RERR_MESSAGEIO
);
275 } else if (send_msgs_to_gen
) {
277 /* Pass the message to our sibling in native charset. */
278 send_msg((enum msgcode
)code
, buf
, len
, 0);
282 if (code
== FERROR_SOCKET
) /* This gets simplified for a non-sibling. */
284 else if (code
== FERROR_UTF8
) {
291 else if (am_daemon
|| logfile_name
) {
294 int priority
= code
== FINFO
|| code
== FLOG
? LOG_INFO
: LOG_WARNING
;
299 if (!log_initialised
)
301 strlcpy(msg
, buf
, MIN((int)sizeof msg
, len
+ 1));
302 logit(priority
, msg
);
305 if (code
== FLOG
|| (am_daemon
&& !am_server
))
307 } else if (code
== FLOG
)
310 if (quiet
&& code
== FINFO
)
314 enum msgcode msg
= (enum msgcode
)code
;
315 if (protocol_version
< 30) {
316 if (msg
== MSG_ERROR
)
317 msg
= MSG_ERROR_XFER
;
318 else if (msg
== MSG_WARNING
)
321 /* Pass the message to the non-server side. */
322 if (send_msg(msg
, buf
, len
, !is_utf8
))
325 /* TODO: can we send the error to the user somehow? */
347 fprintf(stderr
, "Unknown logcode in rwrite(): %d [%s]\n", (int)code
, who_am_i());
348 exit_cleanup(RERR_MESSAGEIO
);
351 if (output_needs_newline
) {
353 output_needs_newline
= 0;
356 trailing_CR_or_NL
= len
&& (buf
[len
-1] == '\n' || buf
[len
-1] == '\r')
359 if (len
&& buf
[0] == '\r') {
366 if (ic
!= (iconv_t
)-1) {
371 INIT_CONST_XBUF(outbuf
, convbuf
);
372 INIT_XBUF(inbuf
, (char*)buf
, len
, (size_t)-1);
375 iconvbufs(ic
, &inbuf
, &outbuf
, inbuf
.pos
? 0 : ICB_INIT
);
378 filtered_fwrite(f
, convbuf
, outbuf
.len
, 0);
381 if (!ierrno
|| ierrno
== E2BIG
)
383 fprintf(f
, "\\#%03o", CVAL(inbuf
.buf
, inbuf
.pos
++));
388 filtered_fwrite(f
, buf
, len
, !allow_8bit_chars
);
390 if (trailing_CR_or_NL
) {
391 fputc(trailing_CR_or_NL
, f
);
396 /* This is the rsync debugging function. Call it with FINFO, FERROR_*,
397 * FWARNING, FLOG, or FCLIENT. */
398 void rprintf(enum logcode code
, const char *format
, ...)
401 char buf
[BIGPATHBUFLEN
];
404 va_start(ap
, format
);
405 len
= vsnprintf(buf
, sizeof buf
, format
, ap
);
408 /* Deal with buffer overruns. Instead of panicking, just
409 * truncate the resulting string. (Note that configure ensures
410 * that we have a vsnprintf() that doesn't ever return -1.) */
411 if (len
> sizeof buf
- 1) {
412 static const char ellipsis
[] = "[...]";
414 /* Reset length, and zero-terminate the end of our buffer */
415 len
= sizeof buf
- 1;
418 /* Copy the ellipsis to the end of the string, but give
419 * us one extra character:
421 * v--- null byte at buf[sizeof buf - 1]
423 * -> abcd[...]00 <-- now two null bytes at end
425 * If the input format string has a trailing newline,
426 * we copy it into that extra null; if it doesn't, well,
427 * all we lose is one byte. */
428 memcpy(buf
+len
-sizeof ellipsis
, ellipsis
, sizeof ellipsis
);
429 if (format
[strlen(format
)-1] == '\n') {
434 rwrite(code
, buf
, len
, 0);
437 /* This is like rprintf, but it also tries to print some
438 * representation of the error code. Normally errcode = errno.
440 * Unlike rprintf, this always adds a newline and there should not be
441 * one in the format string.
443 * Note that since strerror might involve dynamically loading a
444 * message catalog we need to call it once before chroot-ing. */
445 void rsyserr(enum logcode code
, int errcode
, const char *format
, ...)
448 char buf
[BIGPATHBUFLEN
];
451 strlcpy(buf
, RSYNC_NAME
": ", sizeof buf
);
452 len
= (sizeof RSYNC_NAME
": ") - 1;
454 va_start(ap
, format
);
455 len
+= vsnprintf(buf
+ len
, sizeof buf
- len
, format
, ap
);
458 if (len
< sizeof buf
) {
459 len
+= snprintf(buf
+ len
, sizeof buf
- len
,
460 ": %s (%d)\n", strerror(errcode
), errcode
);
462 if (len
>= sizeof buf
)
463 exit_cleanup(RERR_MESSAGEIO
);
465 rwrite(code
, buf
, len
, 0);
468 void rflush(enum logcode code
)
472 if (am_daemon
|| code
== FLOG
)
475 if (!am_server
&& (code
== FINFO
|| code
== FCLIENT
))
483 void remember_initial_stats(void)
485 initial_data_read
= total_data_read
;
486 initial_data_written
= total_data_written
;
489 /* A generic logging routine for send/recv, with parameter substitiution. */
490 static void log_formatted(enum logcode code
, const char *format
, const char *op
,
491 struct file_struct
*file
, const char *fname
, int iflags
,
494 char buf
[MAXPATHLEN
+1024], buf2
[MAXPATHLEN
], fmt
[32];
502 /* We expand % codes one by one in place in buf. We don't
503 * copy in the terminating null of the inserted strings, but
504 * rather keep going until we reach the null of the format. */
505 total
= strlcpy(buf
, format
, sizeof buf
);
506 if (total
> MAXPATHLEN
) {
507 rprintf(FERROR
, "log-format string is WAY too long!\n");
508 exit_cleanup(RERR_MESSAGEIO
);
513 for (p
= buf
; (p
= strchr(p
, '%')) != NULL
; ) {
523 while (isDigit(p
) && c
- fmt
< (int)(sizeof fmt
) - 8)
534 /* Note for %h and %a: it doesn't matter what fd we pass to
535 * client_{name,addr} because rsync_module will already have
536 * forced the answer to be cached (assuming, of course, for %h
537 * that lp_reverse_lookup(module_id) is true). */
541 n
= lp_reverse_lookup(module_id
)
542 ? client_name(0) : undetermined_hostname
;
550 strlcat(fmt
, "s", sizeof fmt
);
551 snprintf(buf2
, sizeof buf2
, fmt
,
552 do_big_num(F_LENGTH(file
), humanize
, NULL
));
556 strlcat(fmt
, "u", sizeof fmt
);
557 snprintf(buf2
, sizeof buf2
, fmt
,
558 uid_ndx
? F_OWNER(file
) : 0);
562 if (!gid_ndx
|| file
->flags
& FLAG_SKIP_GROUP
)
565 strlcat(fmt
, "u", sizeof fmt
);
566 snprintf(buf2
, sizeof buf2
, fmt
,
572 strlcat(fmt
, "ld", sizeof fmt
);
573 snprintf(buf2
, sizeof buf2
, fmt
,
578 n
= c
= timestring(file
->modtime
);
579 while ((c
= strchr(c
, ' ')) != NULL
)
583 c
= buf2
+ MAXPATHLEN
- PERMSTRING_SIZE
- 1;
584 permstring(c
, file
->mode
);
585 n
= c
+ 1; /* skip the type char */
593 strlcpy(c
, fname
, MAXPATHLEN
);
595 c
= f_name(file
, NULL
);
596 if (am_sender
&& F_PATHNAME(file
)) {
597 pathjoin(buf2
, sizeof buf2
,
598 F_PATHNAME(file
), c
);
599 clean_fname(buf2
, 0);
601 strlcpy(c
, buf2
, MAXPATHLEN
);
605 } else if (am_daemon
&& *c
!= '/') {
606 pathjoin(buf2
, sizeof buf2
,
607 curr_dir
+ module_dirlen
, c
);
608 clean_fname(buf2
, 0);
610 strlcpy(c
, buf2
, MAXPATHLEN
);
624 strlcpy(c
, fname
, MAXPATHLEN
);
626 c
= f_name(file
, NULL
);
627 if (S_ISDIR(file
->mode
))
628 strlcat(c
, "/", MAXPATHLEN
);
632 if (hlink
&& *hlink
) {
634 strlcpy(buf2
, " => ", sizeof buf2
);
635 } else if (S_ISLNK(file
->mode
) && !fname
) {
637 strlcpy(buf2
, " -> ", sizeof buf2
);
642 strlcpy(buf2
, " ", sizeof buf2
);
644 strlcat(fmt
, "s", sizeof fmt
);
645 snprintf(buf2
+ 4, sizeof buf2
- 4, fmt
, n
);
649 n
= lp_name(module_id
);
652 n
= timestring(time(NULL
));
655 n
= full_module_path
;
661 if (!(iflags
& ITEM_TRANSFER
))
664 b
= total_data_written
- initial_data_written
;
666 b
= total_data_read
- initial_data_read
;
667 strlcat(fmt
, "s", sizeof fmt
);
668 snprintf(buf2
, sizeof buf2
, fmt
,
669 do_big_num(b
, humanize
, NULL
));
673 if (!(iflags
& ITEM_TRANSFER
))
676 b
= total_data_written
- initial_data_written
;
678 b
= total_data_read
- initial_data_read
;
679 strlcat(fmt
, "s", sizeof fmt
);
680 snprintf(buf2
, sizeof buf2
, fmt
,
681 do_big_num(b
, humanize
, NULL
));
685 if (protocol_version
>= 30
686 && (iflags
& ITEM_TRANSFER
687 || (always_checksum
&& S_ISREG(file
->mode
)))) {
689 const char *sum
= iflags
& ITEM_TRANSFER
690 ? sender_file_sum
: F_SUM(file
);
691 c
= buf2
+ checksum_len
*2;
693 for (i
= checksum_len
; --i
>= 0; ) {
697 *--c
= x1
<= 9 ? x1
+ '0' : x1
+ 'a' - 10;
698 *--c
= x2
<= 9 ? x2
+ '0' : x2
+ 'a' - 10;
701 memset(buf2
, ' ', checksum_len
*2);
702 buf2
[checksum_len
*2] = '\0';
707 if (iflags
& ITEM_DELETED
) {
711 n
= c
= buf2
+ MAXPATHLEN
- 32;
712 c
[0] = iflags
& ITEM_LOCAL_CHANGE
713 ? iflags
& ITEM_XNAME_FOLLOWS
? 'h' : 'c'
714 : !(iflags
& ITEM_TRANSFER
) ? '.'
715 : !local_server
&& *op
== 's' ? '<' : '>';
716 if (S_ISLNK(file
->mode
)) {
719 c
[4] = !(iflags
& ITEM_REPORT_TIME
) ? '.'
720 : !preserve_times
|| !receiver_symlink_times
721 || (iflags
& ITEM_REPORT_TIMEFAIL
) ? 'T' : 't';
723 c
[1] = S_ISDIR(file
->mode
) ? 'd'
724 : IS_SPECIAL(file
->mode
) ? 'S'
725 : IS_DEVICE(file
->mode
) ? 'D' : 'f';
726 c
[3] = !(iflags
& ITEM_REPORT_SIZE
) ? '.' : 's';
727 c
[4] = !(iflags
& ITEM_REPORT_TIME
) ? '.'
728 : !preserve_times
? 'T' : 't';
730 c
[2] = !(iflags
& ITEM_REPORT_CHANGE
) ? '.' : 'c';
731 c
[5] = !(iflags
& ITEM_REPORT_PERMS
) ? '.' : 'p';
732 c
[6] = !(iflags
& ITEM_REPORT_OWNER
) ? '.' : 'o';
733 c
[7] = !(iflags
& ITEM_REPORT_GROUP
) ? '.' : 'g';
734 c
[8] = !(iflags
& ITEM_REPORT_ATIME
) ? '.' : 'u';
735 c
[9] = !(iflags
& ITEM_REPORT_ACL
) ? '.' : 'a';
736 c
[10] = !(iflags
& ITEM_REPORT_XATTR
) ? '.' : 'x';
739 if (iflags
& (ITEM_IS_NEW
|ITEM_MISSING_DATA
)) {
740 char ch
= iflags
& ITEM_IS_NEW
? '+' : '?';
742 for (i
= 2; c
[i
]; i
++)
744 } else if (c
[0] == '.' || c
[0] == 'h' || c
[0] == 'c') {
746 for (i
= 2; c
[i
]; i
++) {
751 for (i
= 2; c
[i
]; i
++)
758 /* "n" is the string to be inserted in place of this % code. */
761 if (n
!= buf2
&& fmt
[1]) {
762 strlcat(fmt
, "s", sizeof fmt
);
763 snprintf(buf2
, sizeof buf2
, fmt
, n
);
768 /* Subtract the length of the escape from the string's size. */
771 if (len
+ total
>= (size_t)sizeof buf
) {
773 "buffer overflow expanding %%%c -- exiting\n",
775 exit_cleanup(RERR_MESSAGEIO
);
778 /* Shuffle the rest of the string along to make space for n */
779 if (len
!= (size_t)(p
- s
+ 1))
780 memmove(s
+ len
, p
+ 1, total
- (s
- buf
) + 1);
783 /* Insert the contents of string "n", but NOT its null. */
787 /* Skip over inserted string; continue looking */
791 rwrite(code
, buf
, total
, 0);
794 /* Return 1 if the format escape is in the log-format string (e.g. look for
795 * the 'b' in the "%9b" format escape). */
796 int log_format_has(const char *format
, char esc
)
803 for (p
= format
; (p
= strchr(p
, '%')) != NULL
; ) {
804 for (p
++; *p
== '\''; p
++) {} /*SHARED ITERATOR*/
809 while (*p
== '\'') p
++;
818 /* Log the transfer of a file. If the code is FCLIENT, the output just goes
819 * to stdout. If it is FLOG, it just goes to the log file. Otherwise we
821 void log_item(enum logcode code
, struct file_struct
*file
, int iflags
, const char *hlink
)
823 const char *s_or_r
= am_sender
? "send" : "recv";
825 if (code
!= FLOG
&& stdout_format
&& !am_server
)
826 log_formatted(FCLIENT
, stdout_format
, s_or_r
, file
, NULL
, iflags
, hlink
);
827 if (code
!= FCLIENT
&& logfile_format
&& *logfile_format
)
828 log_formatted(FLOG
, logfile_format
, s_or_r
, file
, NULL
, iflags
, hlink
);
831 void maybe_log_item(struct file_struct
*file
, int iflags
, int itemizing
,
834 int significant_flags
= iflags
& SIGNIFICANT_ITEM_FLAGS
;
835 int see_item
= itemizing
&& (significant_flags
|| *buf
836 || stdout_format_has_i
> 1 || (INFO_GTE(NAME
, 2) && stdout_format_has_i
));
837 int local_change
= iflags
& ITEM_LOCAL_CHANGE
&& significant_flags
;
839 if (logfile_name
&& !dry_run
&& see_item
840 && (significant_flags
|| logfile_format_has_i
))
841 log_item(FLOG
, file
, iflags
, buf
);
842 } else if (see_item
|| local_change
|| *buf
843 || (S_ISDIR(file
->mode
) && significant_flags
)) {
844 enum logcode code
= significant_flags
|| logfile_format_has_i
? FINFO
: FCLIENT
;
845 log_item(code
, file
, iflags
, buf
);
849 void log_delete(const char *fname
, int mode
)
852 union file_extras ex
[4]; /* just in case... */
853 struct file_struct file
;
854 } x
; /* Zero-initialized due to static declaration. */
855 int len
= strlen(fname
);
860 if (!INFO_GTE(DEL
, 1) && !stdout_format
)
862 else if (am_server
&& protocol_version
>= 29 && len
< MAXPATHLEN
) {
864 len
++; /* directories include trailing null */
865 send_msg(MSG_DELETED
, fname
, len
, am_generator
);
867 fmt
= stdout_format_has_o_or_i
? stdout_format
: "deleting %n";
868 log_formatted(FCLIENT
, fmt
, "del.", &x
.file
, fname
, ITEM_DELETED
, NULL
);
871 if (!logfile_name
|| dry_run
|| !logfile_format
)
874 fmt
= logfile_format_has_o_or_i
? logfile_format
: "deleting %n";
875 log_formatted(FLOG
, fmt
, "del.", &x
.file
, fname
, ITEM_DELETED
, NULL
);
879 * Called when the transfer is interrupted for some reason.
881 * Code is one of the RERR_* codes from errcode.h, or terminating
884 void log_exit(int code
, const char *file
, int line
)
887 rprintf(FLOG
,"sent %s bytes received %s bytes total size %s\n",
888 comma_num(stats
.total_written
),
889 comma_num(stats
.total_read
),
890 comma_num(stats
.total_size
));
891 } else if (am_server
!= 2) {
894 name
= rerr_name(code
);
896 name
= "unexplained error";
898 /* VANISHED is not an error, only a warning */
899 if (code
== RERR_VANISHED
) {
900 rprintf(FWARNING
, "rsync warning: %s (code %d) at %s(%d) [%s=%s]\n",
901 name
, code
, file
, line
, who_am_i(), RSYNC_VERSION
);
903 rprintf(FERROR
, "rsync error: %s (code %d) at %s(%d) [%s=%s]\n",
904 name
, code
, file
, line
, who_am_i(), RSYNC_VERSION
);