diff options
author | Wayne Davison <wayned@samba.org> | 2004-02-04 03:28:22 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2004-02-04 03:28:22 +0000 |
commit | f05f993eb72937bbd446a4758b7f0232de764889 (patch) | |
tree | 71a8d45e2546ac2412b8e4907da97c2a6b06bc37 /flist.c | |
parent | e90cdb8adfad6f925558754c6f758e27d22a5fde (diff) | |
download | rsync-f05f993eb72937bbd446a4758b7f0232de764889.tar.gz rsync-f05f993eb72937bbd446a4758b7f0232de764889.tar.bz2 rsync-f05f993eb72937bbd446a4758b7f0232de764889.zip |
If we're dumping the file list (i.e. verbose > 3), mention the uid and/or
gid (depending on applicability).
Diffstat (limited to 'flist.c')
-rw-r--r-- | flist.c | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -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); } } |