summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2019-02-12 18:06:26 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2019-02-12 18:06:26 +0000
commite556314cb8672350c9ba1ce03a5e9eed3d405c87 (patch)
tree43fb95b3a969a9c6af918498367fba4965d79664
parent753e231e8427e6a8d750d673276ee40b5d215b9f (diff)
sync
commit b55c5ce631d8fd557d665e25e31191b33c15f829 Author: kristaps <> Date: Mon Feb 11 23:27:23 2019 +0000 Pass down -g and also order flags. and the extern.h chunk from commit 472ad2fab2692579a5773d78d6934b03c1098fb2 Author: kristaps <> Date: Mon Feb 11 20:45:22 2019 +0000
-rw-r--r--usr.bin/rsync/extern.h3
-rw-r--r--usr.bin/rsync/fargs.c30
2 files changed, 18 insertions, 15 deletions
diff --git a/usr.bin/rsync/extern.h b/usr.bin/rsync/extern.h
index 1fe39e7f93a..3d4c828fff4 100644
--- a/usr.bin/rsync/extern.h
+++ b/usr.bin/rsync/extern.h
@@ -1,4 +1,4 @@
-/* $Id: extern.h,v 1.4 2019/02/12 14:09:59 deraadt Exp $ */
+/* $Id: extern.h,v 1.5 2019/02/12 18:06:25 benno Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -104,6 +104,7 @@ struct opts {
int preserve_times; /* -t */
int preserve_perms; /* -p */
int preserve_links; /* -l */
+ int preserve_gids; /* -g */
int del; /* --delete */
char *rsync_path; /* --rsync-path */
char *ssh_prog; /* --rsh or -e */
diff --git a/usr.bin/rsync/fargs.c b/usr.bin/rsync/fargs.c
index 95a589e590c..b31c1ec50b7 100644
--- a/usr.bin/rsync/fargs.c
+++ b/usr.bin/rsync/fargs.c
@@ -1,4 +1,4 @@
-/* $Id: fargs.c,v 1.6 2019/02/12 14:09:59 deraadt Exp $ */
+/* $Id: fargs.c,v 1.7 2019/02/12 18:06:25 benno Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -44,7 +44,7 @@ fargs_cmdline(struct sess *sess, const struct fargs *f)
argsz += 1; /* dot separator */
argsz += 1; /* sink file */
argsz += 5; /* per-mode maximum */
- argsz += 10; /* shared args */
+ argsz += 11; /* shared args */
argsz += 1; /* NULL pointer */
argsz += f->sourcesz;
@@ -70,6 +70,20 @@ fargs_cmdline(struct sess *sess, const struct fargs *f)
/* Shared arguments. */
+ if (sess->opts->del)
+ args[i++] = "--delete";
+ if (sess->opts->preserve_gids)
+ args[i++] = "-g";
+ if (sess->opts->preserve_links)
+ args[i++] = "-l";
+ if (sess->opts->dry_run)
+ args[i++] = "-n";
+ if (sess->opts->preserve_perms)
+ args[i++] = "-p";
+ if (sess->opts->recursive)
+ args[i++] = "-r";
+ if (sess->opts->preserve_times)
+ args[i++] = "-t";
if (sess->opts->verbose > 3)
args[i++] = "-v";
if (sess->opts->verbose > 2)
@@ -78,18 +92,6 @@ fargs_cmdline(struct sess *sess, const struct fargs *f)
args[i++] = "-v";
if (sess->opts->verbose > 0)
args[i++] = "-v";
- if (sess->opts->dry_run)
- args[i++] = "-n";
- if (sess->opts->preserve_times)
- args[i++] = "-t";
- if (sess->opts->preserve_perms)
- args[i++] = "-p";
- if (sess->opts->recursive)
- args[i++] = "-r";
- if (sess->opts->preserve_links)
- args[i++] = "-l";
- if (sess->opts->del)
- args[i++] = "--delete";
/* Terminate with a full-stop for reasons unknown. */