diff options
author | job <job@openbsd.org> | 2021-03-31 19:45:16 +0000 |
---|---|---|
committer | job <job@openbsd.org> | 2021-03-31 19:45:16 +0000 |
commit | 3bf4cfb65c8c9b2b3ad3d67fa1ef4cb0ec9d7017 (patch) | |
tree | 8ddd731a2cebe9b61620fa607d467bf1cfd1a0dd /usr.bin | |
parent | tweak column widths of a .Bl -column table (diff) | |
download | wireguard-openbsd-3bf4cfb65c8c9b2b3ad3d67fa1ef4cb0ec9d7017.tar.xz wireguard-openbsd-3bf4cfb65c8c9b2b3ad3d67fa1ef4cb0ec9d7017.zip |
Add option to suppress the Message of the Day
Fine deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rsync/extern.h | 3 | ||||
-rw-r--r-- | usr.bin/rsync/main.c | 11 | ||||
-rw-r--r-- | usr.bin/rsync/rsync.1 | 6 | ||||
-rw-r--r-- | usr.bin/rsync/socket.c | 5 |
4 files changed, 17 insertions, 8 deletions
diff --git a/usr.bin/rsync/extern.h b/usr.bin/rsync/extern.h index 6f94fa3256c..b18213d2d31 100644 --- a/usr.bin/rsync/extern.h +++ b/usr.bin/rsync/extern.h @@ -1,4 +1,4 @@ -/* $Id: extern.h,v 1.35 2021/03/22 11:14:42 claudio Exp $ */ +/* $Id: extern.h,v 1.36 2021/03/31 19:45:16 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -115,6 +115,7 @@ struct opts { int del; /* --delete */ int devices; /* --devices */ int specials; /* --specials */ + int no_motd; /* --no-motd */ int numeric_ids; /* --numeric-ids */ int one_file_system; /* -x */ char *rsync_path; /* --rsync-path */ diff --git a/usr.bin/rsync/main.c b/usr.bin/rsync/main.c index 00b9f0ea27f..54254805652 100644 --- a/usr.bin/rsync/main.c +++ b/usr.bin/rsync/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.52 2021/03/22 11:16:05 claudio Exp $ */ +/* $Id: main.c,v 1.53 2021/03/31 19:45:16 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -311,6 +311,7 @@ main(int argc, char *argv[]) { "verbose", no_argument, &verbose, 1 }, { "no-verbose", no_argument, &verbose, 0 }, { "address", required_argument, NULL, 4 }, + { "no-motd", no_argument, NULL, 6 }, { NULL, 0, NULL, 0 }}; /* Global pledge. */ @@ -392,6 +393,9 @@ main(int argc, char *argv[]) if (errstr != NULL) errx(1, "timeout is %s: %s", errstr, optarg); break; + case 6: + opts.no_motd = 1; + break; case 'h': default: goto usage; @@ -524,8 +528,9 @@ main(int argc, char *argv[]) usage: fprintf(stderr, "usage: %s" " [-aDglnoprtvx] [-e program] [--address=sourceaddr] [--del]\n" - "\t[--numeric-ids] [--port=portnumber] [--rsync-path=program]\n" - "\t[--timeout=seconds] [--version] source ... directory\n", + "\t[--no-motd] [--numeric-ids] [--port=portnumber] " + "[--rsync-path=program]\n\t[--timeout=seconds] [--version] " + "source ... directory\n", getprogname()); exit(1); } diff --git a/usr.bin/rsync/rsync.1 b/usr.bin/rsync/rsync.1 index 97eaeb7d5de..2381df7d47d 100644 --- a/usr.bin/rsync/rsync.1 +++ b/usr.bin/rsync/rsync.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rsync.1,v 1.22 2020/11/24 16:54:44 claudio Exp $ +.\" $OpenBSD: rsync.1,v 1.23 2021/03/31 19:45:16 job 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: November 24 2020 $ +.Dd $Mdocdate: March 31 2021 $ .Dt OPENRSYNC 1 .Os .Sh NAME @@ -93,6 +93,8 @@ not exist, it will be broken. Do not actually modify the destination. Mainly useful in combination with .Fl v . +.It Fl -no-motd +Do not display the Message of the Day. .It Fl -numeric-ids Ignore user and group names, use numeric user and group IDs only. Has no effect unless diff --git a/usr.bin/rsync/socket.c b/usr.bin/rsync/socket.c index 86ecc204f48..f740c2dff2a 100644 --- a/usr.bin/rsync/socket.c +++ b/usr.bin/rsync/socket.c @@ -1,4 +1,4 @@ -/* $Id: socket.c,v 1.28 2020/08/19 11:10:42 kn Exp $ */ +/* $Id: socket.c,v 1.29 2021/03/31 19:45:16 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -236,7 +236,8 @@ protocol_line(struct sess *sess, __attribute__((unused)) const char *host, int major, minor; if (strncmp(cp, "@RSYNCD: ", 9)) { - LOG1("%s", cp); + if (sess->opts->no_motd == 0) + LOG1("%s", cp); return 0; } |