diff options
author | 2019-02-12 19:10:28 +0000 | |
---|---|---|
committer | 2019-02-12 19:10:28 +0000 | |
commit | 8778f60e2b22c7e184fba148c0634de557cf4e9a (patch) | |
tree | 65ad3eeb7fbdd463d492f4634d6ea54b009d3331 | |
parent | sync (diff) | |
download | wireguard-openbsd-8778f60e2b22c7e184fba148c0634de557cf4e9a.tar.xz wireguard-openbsd-8778f60e2b22c7e184fba148c0634de557cf4e9a.zip |
sync
commit 3a43d6aace5e83d7e9550086661b5354486171b9
Author: kristaps <>
Date: Tue Feb 12 00:01:22 2019 +0000
Actually do group reassignment, which might fail if the group doesn't exist
or we can't change to it.
-rw-r--r-- | usr.bin/rsync/downloader.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/rsync/downloader.c b/usr.bin/rsync/downloader.c index d243897fb39..2d5d4ab7f83 100644 --- a/usr.bin/rsync/downloader.c +++ b/usr.bin/rsync/downloader.c @@ -1,4 +1,4 @@ -/* $Id: downloader.c,v 1.4 2019/02/11 21:41:22 deraadt Exp $ */ +/* $Id: downloader.c,v 1.5 2019/02/12 19:10:28 benno Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -568,6 +568,18 @@ rsync_downloader(struct download *p, struct sess *sess, int *ofd) goto out; } + if (sess->opts->preserve_gids) { + if (fchown(p->fd, -1, f->st.gid) == -1) { + if (errno != EPERM) { + ERR(sess, "%s: fchown", p->fname); + goto out; + } + WARNX(sess, "%s: gid not available to user: %u", + f->path, f->st.gid); + } else + LOG4(sess, "%s: updated gid", f->path); + } + /* Conditionally adjust file modification time. */ if (sess->opts->preserve_times) { |