diff options
author | arved <arved@FreeBSD.org> | 2006-08-07 01:38:15 +0800 |
---|---|---|
committer | arved <arved@FreeBSD.org> | 2006-08-07 01:38:15 +0800 |
commit | fca8b5e754f7fe30d780f4069074cd9fc374afeb (patch) | |
tree | ab3223da3d9df6d36dcf406dca5cb5b1068f10a2 /shells/scponly | |
parent | ea35e9e2ddf25f1c21411d8fed659e740f8727cd (diff) | |
download | freebsd-ports-gnome-fca8b5e754f7fe30d780f4069074cd9fc374afeb.tar.gz freebsd-ports-gnome-fca8b5e754f7fe30d780f4069074cd9fc374afeb.tar.zst freebsd-ports-gnome-fca8b5e754f7fe30d780f4069074cd9fc374afeb.zip |
Unbreak rsync comatibility when long opts ("--server", "--sender"
and "--delete" in this case) specified.
PR: 96295
Suggested by: ueda _at_ drweb dot jp
Obtained from: https://lists.ccs.neu.edu/pipermail/scponly/2006-March/001287.html
Approved by: rushani (maintainer)
Diffstat (limited to 'shells/scponly')
-rw-r--r-- | shells/scponly/Makefile | 4 | ||||
-rw-r--r-- | shells/scponly/files/patch-helper.c | 97 |
2 files changed, 100 insertions, 1 deletions
diff --git a/shells/scponly/Makefile b/shells/scponly/Makefile index 5be3e5c409ff..fc2b66296706 100644 --- a/shells/scponly/Makefile +++ b/shells/scponly/Makefile @@ -71,6 +71,7 @@ PORTNAME= scponly PORTVERSION= 4.6 +PORTREVISION= 1 CATEGORIES= shells MASTER_SITES= http://www.sublimation.org/scponly/ \ ${MASTER_SITE_SOURCEFORGE} @@ -85,6 +86,8 @@ MAN8= scponly.8 GNU_CONFIGURE= yes PLIST_SUB+= SCPONLY_CHROOT="@comment " +PATCH_STRIP= -p1 + .include <bsd.port.pre.mk> .if defined(SCPONLY_DEFAULT_CHDIR) && !empty(SCPONLY_DEFAULT_CHDIR) @@ -105,7 +108,6 @@ CONFIGURE_ARGS+=--enable-chrooted-binary .endif .if defined(WITH_SCPONLY_RSYNC) -BROKEN= The Rsync compatibility is broken BUILD_DEPENDS+= rsync:${PORTSDIR}/net/rsync RUN_DEPENDS+= ${BUILD_DEPENDS} CONFIGURE_ARGS+=--enable-rsync-compat diff --git a/shells/scponly/files/patch-helper.c b/shells/scponly/files/patch-helper.c new file mode 100644 index 000000000000..875de04fc1ce --- /dev/null +++ b/shells/scponly/files/patch-helper.c @@ -0,0 +1,97 @@ +--- scponly-4.6/helper.c.orig Tue Jan 31 22:04:16 2006 ++++ scponly-4.6/helper.c Thu Mar 23 00:53:01 2006 +@@ -133,6 +133,78 @@ + char **tmpptr=av; + int ch; + int ac=0; ++ char **av2 = NULL; ++ ++ /* ++ * first count the arguments in the vector ++ */ ++ tmpptr=av; ++ while (*tmpptr!=NULL) ++ { ++ *tmpptr++; ++ ac++; ++ } ++ ++#ifdef PROG_RSYNC ++ if (exact_match(PROG_RSYNC, av[0])) ++ { ++ /* ++ * these are the long opts (beginning "--") which we ++ * allow for rsync ++ */ ++ char *permitted_long_opts[] = { ++ "--server", ++ "--sender", ++ "--delete", ++ NULL /* last element must be NULL */ ++ }; ++ ++ /* ++ * make a copy of the args excluding any permitted long ++ * options ++ */ ++ int i, j; ++ av2 = malloc(ac * sizeof *av2); ++ av2[0] = av[0]; ++ for (i = 1, j = 1; i < ac; ++i) ++ { ++ if (0 == strncmp(av[i], "--", 2)) ++ { ++ char **p; ++ /* ++ * test against permitted opts ++ */ ++ for (p = permitted_long_opts; *p; ++p) ++ { ++ if (exact_match(av[i], *p)) ++ break; ++ } ++ ++ if (*p) ++ { ++ /* ++ * permitted; skip this one ++ */ ++ continue; ++ } ++ else ++ { ++ /* ++ * no match ++ */ ++ syslog(LOG_ERR, "option %s is not permitted for use with %s (%s)", ++ av[i], cmdarg->name, logstamp()); ++ return 1; ++ } ++ } ++ av2[j++] = av[i]; ++ ++ } ++ av2[j] = NULL; ++ ac = j; ++ av = av2; ++ } ++#endif /* PROG_RSYNC */ + + while (cmdarg != NULL) + { +@@ -151,15 +223,6 @@ + */ + if (1 == cmdarg->getoptflag) + { +- /* +- * first count the arguments in the vector +- */ +- tmpptr=av; +- while (*tmpptr!=NULL) +- { +- *tmpptr++; +- ac++; +- } + /* + * now use getopt to look for our problem option + */ |