From f05f993eb72937bbd446a4758b7f0232de764889 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 4 Feb 2004 03:28:22 +0000 Subject: [PATCH] If we're dumping the file list (i.e. verbose > 3), mention the uid and/or gid (depending on applicability). --- flist.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/flist.c b/flist.c index ff9d7741..22f688d1 100644 --- a/flist.c +++ b/flist.c @@ -31,6 +31,7 @@ extern struct stats stats; extern int verbose; extern int do_progress; +extern int am_root; extern int am_server; extern int always_checksum; extern int module_id; @@ -1433,13 +1434,20 @@ static void clean_flist(struct file_list *flist, int strip_root, int no_dups) return; for (i = 0; i < flist->count; i++) { - rprintf(FINFO, "[%s] i=%d %s %s %s mode=0%o len=%.0f\n", - who_am_i(), i, - NS(flist->files[i]->basedir), - NS(flist->files[i]->dirname), - NS(flist->files[i]->basename), - (int) flist->files[i]->mode, - (double) flist->files[i]->length); + char uidbuf[16], gidbuf[16]; + struct file_struct *file = flist->files[i]; + if (am_root && preserve_uid) + sprintf(uidbuf, " uid=%ld", (long)file->uid); + else + *uidbuf = '\0'; + if (preserve_gid) + sprintf(gidbuf, " gid=%ld", (long)file->gid); + else + *gidbuf = '\0'; + rprintf(FINFO, "[%s] i=%d %s %s %s mode=0%o len=%.0f%s%s\n", + who_am_i(), i, NS(file->basedir), NS(file->dirname), + NS(file->basename), (int) file->mode, + (double) file->length, uidbuf, gidbuf); } } -- 2.34.1