-/* $OpenBSD: blocks.c,v 1.20 2021/06/30 13:10:04 claudio Exp $ */
+/* $OpenBSD: blocks.c,v 1.21 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
size_t pos = 0, sz;
sz = sizeof(int32_t) + /* index */
- sizeof(int32_t) + /* block count */
- sizeof(int32_t) + /* block length */
- sizeof(int32_t) + /* checksum length */
- sizeof(int32_t); /* block remainder */
+ sizeof(int32_t) + /* block count */
+ sizeof(int32_t) + /* block length */
+ sizeof(int32_t) + /* checksum length */
+ sizeof(int32_t); /* block remainder */
assert(sz == 20);
io_buffer_int(buf, &pos, sz, idx);
/* Put the entire send routine into a buffer. */
sz = sizeof(int32_t) + /* block count */
- sizeof(int32_t) + /* block length */
- sizeof(int32_t) + /* checksum length */
- sizeof(int32_t); /* block remainder */
+ sizeof(int32_t) + /* block length */
+ sizeof(int32_t) + /* checksum length */
+ sizeof(int32_t); /* block remainder */
assert(sz <= sizeof(buf));
if (!io_read_buf(sess, fd, buf, sz)) {
-/* $OpenBSD: fargs.c,v 1.21 2021/10/29 08:00:59 claudio Exp $ */
+/* $OpenBSD: fargs.c,v 1.22 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
const char *
alt_base_mode(int mode)
{
- switch(mode) {
+ switch (mode) {
case BASE_MODE_COMPARE:
return "--compare-dest";
case BASE_MODE_COPY:
addargs(&args, "--min-size=%lld", sess->opts->min_size);
/* only add --compare-dest, etc if this is the sender */
- if (sess->opts->alt_base_mode != 0 &&
+ if (sess->opts->alt_base_mode != 0 &&
f->mode == FARGS_SENDER) {
for (j = 0; j < MAX_BASEDIR; j++) {
if (sess->opts->basedir[j] == NULL)
-/* $OpenBSD: flist.c,v 1.35 2021/10/22 09:59:35 claudio Exp $ */
+/* $OpenBSD: flist.c,v 1.36 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2019 Florian Obser <florian@openbsd.org>
if (sess->mplex_reads &&
io_read_check(fdin) &&
- !io_read_flush(sess, fdin)) {
+ !io_read_flush(sess, fdin)) {
ERRX1("io_read_flush");
goto out;
}
/* Conditional part: devices & special files. */
if ((sess->opts->devices && (S_ISBLK(f->st.mode) ||
- S_ISCHR(f->st.mode))) ||
+ S_ISCHR(f->st.mode))) ||
(sess->opts->specials && (S_ISFIFO(f->st.mode) ||
S_ISSOCK(f->st.mode)))) {
if (!io_write_int(sess, fdout, f->st.rdev)) {
/* Conditional part: devices & special files. */
if ((sess->opts->devices && (S_ISBLK(ff->st.mode) ||
- S_ISCHR(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)) {
-/* $OpenBSD: main.c,v 1.62 2021/10/29 08:00:59 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.63 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
{ "devices", no_argument, &opts.devices, 1 },
{ "no-devices", no_argument, &opts.devices, 0 },
{ "dry-run", no_argument, &opts.dry_run, 1 },
- { "exclude", required_argument, NULL, OP_EXCLUDE },
+ { "exclude", required_argument, NULL, OP_EXCLUDE },
{ "exclude-from", required_argument, NULL, OP_EXCLUDE_FROM },
{ "group", no_argument, &opts.preserve_gids, 1 },
{ "no-group", no_argument, &opts.preserve_gids, 0 },
{ "help", no_argument, NULL, 'h' },
- { "include", required_argument, NULL, OP_INCLUDE },
+ { "include", required_argument, NULL, OP_INCLUDE },
{ "include-from", required_argument, NULL, OP_INCLUDE_FROM },
{ "links", no_argument, &opts.preserve_links, 1 },
{ "max-size", required_argument, NULL, OP_MAX_SIZE },
struct sess sess;
struct fargs *fargs;
char **args;
- const char *errstr;
+ const char *errstr;
/* Global pledge. */
-/* $OpenBSD: rules.c,v 1.3 2021/11/03 08:30:14 claudio Exp $ */
+/* $OpenBSD: rules.c,v 1.4 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
*
struct rule {
char *pattern;
- enum rule_type type;
+ enum rule_type type;
#ifdef NOTYET
- unsigned int modifiers;
+ unsigned int modifiers;
#endif
short numseg;
unsigned char anchored;
{
const char *mod;
size_t i;
-
+
mod = memchr(command, ',', len);
if (mod != NULL) {
/* XXX modifiers not yet implemented */
nseg++;
r->numseg = nseg;
- /* check if this pattern only matches against the basename */
+ /* check if this pattern only matches against the basename */
if (nseg == 1 && !r->anchored)
r->fileonly = 1;
return -1;
type = def;
pattern = line;
- } else
+ } else
pattern = line + len + 1;
if (*pattern == '\0' && type != RULE_CLEAR)
struct rule *r;
size_t i;
- basename = strrchr(path, '/');
+ basename = strrchr(path, '/');
if (basename != NULL)
basename += 1;
else
basename = path;
-
+
for (i = 0; i < numrules; i++) {
r = &rules[i];
-/* $OpenBSD: server.c,v 1.14 2021/06/30 13:10:04 claudio Exp $ */
+/* $OpenBSD: server.c,v 1.15 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
/* Begin by making descriptors non-blocking. */
if (!fcntl_nonblock(fdin) ||
- !fcntl_nonblock(fdout)) {
+ !fcntl_nonblock(fdout)) {
ERRX1("fcntl_nonblock");
goto out;
}
-/* $OpenBSD: uploader.c,v 1.32 2021/10/29 08:00:59 claudio Exp $ */
+/* $OpenBSD: uploader.c,v 1.33 2021/11/03 14:42:12 deraadt Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2019 Florian Obser <florian@openbsd.org>
*/
static int
check_file(int rootfd, const struct flist *f, struct stat *st)
-{
+{
if (fstatat(rootfd, f->path, st, AT_SYMLINK_NOFOLLOW) == -1) {
if (errno == ENOENT)
return 3;
/* Make sure the block metadata buffer is big enough. */
u->bufsz =
- sizeof(int32_t) + /* identifier */
- sizeof(int32_t) + /* block count */
- sizeof(int32_t) + /* block length */
- sizeof(int32_t) + /* checksum length */
- sizeof(int32_t) + /* block remainder */
- blk.blksz *
- (sizeof(int32_t) + /* short checksum */
- blk.csum); /* long checksum */
+ sizeof(int32_t) + /* identifier */
+ sizeof(int32_t) + /* block count */
+ sizeof(int32_t) + /* block length */
+ sizeof(int32_t) + /* checksum length */
+ sizeof(int32_t) + /* block remainder */
+ blk.blksz *
+ (sizeof(int32_t) + /* short checksum */
+ blk.csum); /* long checksum */
if (u->bufsz > u->bufmax) {
if ((bufp = realloc(u->buf, u->bufsz)) == NULL) {