summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-02-14 18:31:02 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-02-14 18:31:02 +0000
commit6fc143ab5ebed5e88aa9d010c21e8143b21f3678 (patch)
tree749b633a94c3f0278b0fca9dd719871d9ab9d0a5 /usr.bin
parentb906197eb887236acfcf06dac9801272fa8e3b2e (diff)
sync with kristaps, commit 71065b31649480ceb1ee6942232d673bf8ab70c8
Enable -o.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rsync/main.c5
-rw-r--r--usr.bin/rsync/rsync.111
-rw-r--r--usr.bin/rsync/uploader.c8
3 files changed, 16 insertions, 8 deletions
diff --git a/usr.bin/rsync/main.c b/usr.bin/rsync/main.c
index 9bee24424c0..5bd8e896a57 100644
--- a/usr.bin/rsync/main.c
+++ b/usr.bin/rsync/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.14 2019/02/14 18:28:23 florian Exp $ */
+/* $Id: main.c,v 1.15 2019/02/14 18:31:01 florian Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -325,7 +325,6 @@ main(int argc, char *argv[])
opts.dry_run = 1;
break;
case 'o':
- /* XXX: not finished yet. */
opts.preserve_uids = 1;
break;
case 'p':
@@ -459,7 +458,7 @@ main(int argc, char *argv[])
close(fds[0]);
return c ? EXIT_SUCCESS : EXIT_FAILURE;
usage:
- fprintf(stderr, "usage: %s [-glnprtv] "
+ fprintf(stderr, "usage: %s [-glnoprtv] "
"[-e ssh-prog] [--delete] [--rsync-path=prog] src ... dst\n",
getprogname());
return EXIT_FAILURE;
diff --git a/usr.bin/rsync/rsync.1 b/usr.bin/rsync/rsync.1
index 3ee5c4548f2..d468bdcfd3e 100644
--- a/usr.bin/rsync/rsync.1
+++ b/usr.bin/rsync/rsync.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rsync.1,v 1.3 2019/02/12 19:16:41 benno Exp $
+.\" $OpenBSD: rsync.1,v 1.4 2019/02/14 18:31:01 florian Exp $
.\"
.\" Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: February 12 2019 $
+.Dd $Mdocdate: February 14 2019 $
.Dt RSYNC 1
.Os
.Sh NAME
@@ -22,7 +22,7 @@
.Nd synchronise local and remote files
.Sh SYNOPSIS
.Nm rsync
-.Op Fl glnprtv
+.Op Fl glnoprtv
.Op Fl -delete
.Op Fl -rsync-path Ar prog
.Ar source ...
@@ -59,6 +59,11 @@ not exist, it will be broken.
.It Fl n
Dry-run mode.
Does not actually modify the destination.
+.It Fl o
+Set user identifier to match the source.
+This behaves like
+.Fl g
+and only works if run as root.
.It Fl p
Set destination file or directory permissions to match the source when
it is updated.
diff --git a/usr.bin/rsync/uploader.c b/usr.bin/rsync/uploader.c
index efa2439c3c9..7bd04d1a629 100644
--- a/usr.bin/rsync/uploader.c
+++ b/usr.bin/rsync/uploader.c
@@ -1,4 +1,4 @@
-/* $Id: uploader.c,v 1.5 2019/02/14 18:29:08 florian Exp $ */
+/* $Id: uploader.c,v 1.6 2019/02/14 18:31:01 florian Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -237,7 +237,10 @@ pre_link(struct upload *p, struct sess *sess)
free(b);
}
- /* Optionally preserve times/perms on the symlink. */
+ /*
+ * Optionally preserve times/perms on the symlink.
+ * FIXME: run rsync_set_metadata()?
+ */
if (sess->opts->preserve_times) {
tv[0].tv_sec = time(NULL);
@@ -364,6 +367,7 @@ post_dir(struct sess *sess, const struct upload *u, size_t idx)
/*
* Update the modification time if we're a new directory *or* if
* we're preserving times and the time has changed.
+ * FIXME: run rsync_set_metadata()?
*/
if (u->newdir[idx] ||