-/* $OpenBSD: extern.h,v 1.46 2023/11/23 11:59:53 job Exp $ */
+/* $OpenBSD: extern.h,v 1.47 2023/11/27 11:30:49 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
int one_file_system; /* -x */
int ignore_times; /* -I */
int ignore_dir_times; /* -O */
+ int ignore_link_times; /* -J */
int size_only; /* --size-only */
int alt_base_mode;
off_t max_size; /* --max-size */
-/* $OpenBSD: fargs.c,v 1.25 2023/11/23 11:59:53 job Exp $ */
+/* $OpenBSD: fargs.c,v 1.26 2023/11/27 11:30:49 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
if (f->mode == FARGS_SENDER) {
if (sess->opts->ignore_dir_times)
addargs(&args, "-O");
+ if (sess->opts->ignore_link_times)
+ addargs(&args, "-J");
if (sess->opts->size_only)
addargs(&args, "--size-only");
-/* $OpenBSD: main.c,v 1.70 2023/11/27 10:14:19 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.71 2023/11/27 11:30:49 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
{ "numeric-ids", no_argument, &opts.numeric_ids, 1 },
{ "omit-dir-times", no_argument, &opts.ignore_dir_times, 1 },
{ "no-O", no_argument, &opts.ignore_dir_times, 0 },
- { "no-omit-dir-times", no_argument, &opts.ignore_dir_times, 0 },
+ { "no-omit-dir-times", no_argument, &opts.ignore_dir_times, 0 },
+ { "omit-link-times", no_argument, &opts.ignore_link_times, 1 },
+ { "no-J", no_argument, &opts.ignore_link_times, 0 },
+ { "no-omit-link-times", no_argument, &opts.ignore_link_times, 0 },
{ "owner", no_argument, &opts.preserve_uids, 1 },
{ "no-owner", no_argument, &opts.preserve_uids, 0 },
{ "perms", no_argument, &opts.preserve_perms, 1 },
opts.max_size = opts.min_size = -1;
- while ((c = getopt_long(argc, argv, "aDe:ghIlnOoprtVvxz", lopts, &lidx))
- != -1) {
+ while ((c = getopt_long(argc, argv, "aDe:ghIJlnOoprtVvxz",
+ lopts, &lidx)) != -1) {
switch (c) {
case 'D':
opts.devices = 1;
case 'I':
opts.ignore_times = 1;
break;
+ case 'J':
+ opts.ignore_link_times = 1;
+ break;
case 'l':
opts.preserve_links = 1;
break;
exit(rc);
usage:
fprintf(stderr, "usage: %s"
- " [-aDgIlnOoprtVvx] [-e program] [--address=sourceaddr]\n"
+ " [-aDgIJlnOoprtVvx] [-e program] [--address=sourceaddr]\n"
"\t[--contimeout=seconds] [--compare-dest=dir] [--del] [--exclude]\n"
"\t[--exclude-from=file] [--include] [--include-from=file]\n"
"\t[--no-motd] [--numeric-ids] [--port=portnumber]\n"
-/* $OpenBSD: receiver.c,v 1.31 2021/10/24 21:24:17 deraadt Exp $ */
+/* $OpenBSD: receiver.c,v 1.32 2023/11/27 11:30:49 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
/* Conditionally adjust file modification time. */
- if (sess->opts->preserve_times) {
+ if (sess->opts->preserve_times &&
+ !(S_ISLNK(f->st.mode) && sess->opts->ignore_link_times)) {
ts[0].tv_nsec = UTIME_NOW;
ts[1].tv_sec = f->st.mtime;
ts[1].tv_nsec = 0;