version 1.14, 2019/02/16 05:06:30 |
version 1.15, 2019/02/16 10:48:05 |
|
|
* information that affects subsequent transmissions. |
* information that affects subsequent transmissions. |
*/ |
*/ |
#define FLIST_MODE_SAME 0x0002 /* mode is repeat */ |
#define FLIST_MODE_SAME 0x0002 /* mode is repeat */ |
|
#define FLIST_RDEV_SAME 0x0004 /* rdev is repeat */ |
#define FLIST_UID_SAME 0x0008 /* uid is repeat */ |
#define FLIST_UID_SAME 0x0008 /* uid is repeat */ |
#define FLIST_GID_SAME 0x0010 /* gid is repeat */ |
#define FLIST_GID_SAME 0x0010 /* gid is repeat */ |
#define FLIST_NAME_SAME 0x0020 /* name is repeat */ |
#define FLIST_NAME_SAME 0x0020 /* name is repeat */ |
|
|
errno = ent->fts_errno; |
errno = ent->fts_errno; |
WARN(sess, "%s", ent->fts_path); |
WARN(sess, "%s", ent->fts_path); |
} else if (ent->fts_info == FTS_DEFAULT) { |
} else if (ent->fts_info == FTS_DEFAULT) { |
|
if ((sess->opts->devices && (S_ISBLK(ent->fts_statp->st_mode) || |
|
S_ISCHR(ent->fts_statp->st_mode))) || |
|
(sess->opts->specials && |
|
(S_ISFIFO(ent->fts_statp->st_mode) || |
|
S_ISSOCK(ent->fts_statp->st_mode)))) { |
|
return 1; |
|
} |
WARNX(sess, "%s: skipping special", ent->fts_path); |
WARNX(sess, "%s: skipping special", ent->fts_path); |
} else if (ent->fts_info == FTS_NS) { |
} else if (ent->fts_info == FTS_NS) { |
errno = ent->fts_errno; |
errno = ent->fts_errno; |
|
|
f->st.gid = st->st_gid; |
f->st.gid = st->st_gid; |
f->st.size = st->st_size; |
f->st.size = st->st_size; |
f->st.mtime = st->st_mtime; |
f->st.mtime = st->st_mtime; |
|
f->st.rdev = st->st_rdev; |
} |
} |
|
|
void |
void |
|
|
} |
} |
} |
} |
|
|
|
if (S_ISBLK(f->st.mode) || S_ISCHR(f->st.mode) || |
|
S_ISFIFO(f->st.mode) || S_ISSOCK(f->st.mode)) { |
|
if (!io_write_int(sess, fdout, f->st.rdev)) { |
|
ERRX1(sess, "io_write_int"); |
|
goto out; |
|
} |
|
} |
|
|
if (S_ISREG(f->st.mode)) |
if (S_ISREG(f->st.mode)) |
sess->total_size += f->st.size; |
sess->total_size += f->st.size; |
} |
} |
|
|
ff->st.gid = fflast->st.gid; |
ff->st.gid = fflast->st.gid; |
} |
} |
|
|
|
/* handle devices & special files*/ |
|
|
|
if ((sess->opts->devices && (S_ISBLK(ff->st.mode) || |
|
S_ISCHR(ff->st.mode))) || |
|
(sess->opts->specials && (S_ISFIFO(ff->st.mode) || |
|
S_ISSOCK(ff->st.mode)))) { |
|
if (!(FLIST_RDEV_SAME & flag)) { |
|
if (!io_read_int(sess, fd, &ival)) { |
|
ERRX1(sess, "io_read_int"); |
|
goto out; |
|
} |
|
ff->st.rdev = ival; |
|
} else if (fflast == NULL) { |
|
ERRX(sess, "same mode without last entry"); |
|
goto out; |
|
} else |
|
ff->st.rdev = fflast->st.rdev; |
|
} |
|
|
/* Conditional part: link. */ |
/* Conditional part: link. */ |
|
|
if (S_ISLNK(ff->st.mode) && |
if (S_ISLNK(ff->st.mode) && |
|
|
} |
} |
|
|
LOG3(sess, "%s: received file metadata: " |
LOG3(sess, "%s: received file metadata: " |
"size %jd, mtime %jd, mode %o", |
"size %jd, mtime %jd, mode %o, rdev (%d, %d)", |
ff->path, (intmax_t)ff->st.size, |
ff->path, (intmax_t)ff->st.size, |
(intmax_t)ff->st.mtime, ff->st.mode); |
(intmax_t)ff->st.mtime, ff->st.mode, |
|
major(ff->st.rdev), minor(ff->st.rdev)); |
|
|
if (S_ISREG(ff->st.mode)) |
if (S_ISREG(ff->st.mode)) |
sess->total_size += ff->st.size; |
sess->total_size += ff->st.size; |