Thread: [2.3.4] opt_exist breaks on long arguments (breaking rsyn 3.0)
Brought to you by:
xystrus
From: Johan B.W. de V. <jo...@bl...> - 2014-08-07 15:23:58
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Greetings, I've been trying to set up rssh with rsync 3.0.6, with some difficulty I made it work. I had to add the --protocol=29 or --protocol=26 command line argument to rsync, that was not a problem. However, I also had to modify rssh because all the patches I could find were either out of date or would not work. Since the bug I found was rather simple, I figured I could just post my solution here, hoping it'd get picket up some day. The problem is as follows: rsync should not use the -e argument, so there's a check on that (don't ask me why, but the code says so). That's why you need to use the protocol argument. However, rsync also passes the --server argument. Since the opt_exist function in util.c doesn't grasp the concept of long arguments, it sees the 'e' in 'server' and claims the -e option has been passed. The fix is rather simple (once you've gotten to this point, after maybe an hour or 3): - ----- begin rss-2.3.4/util.c.diff ----- - --- util.c Thu Aug 07 17:03:50 2014 +++ util.c~ Thu Aug 07 17:02:48 2014 @@ -139,6 +139,10 @@ /* process command line character by character */ if (!(cl[0] == '-')) return FALSE; + + /* Ignore verbose command line arguments */ + if ( (1 < len) && (cl[1] == '-') ) return FALSE; + while ( i < (len) ){ if ( cl[i] == opt ) return TRUE; i++; - ----- begin rss-2.3.4/util.c.diff ----- In this case, the "little over-zealous" really wasn't good enough. Johan de Vries -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQEcBAEBAgAGBQJT45YiAAoJELlZja9I/jIAO0UH/0p5iv3iTwMKnA9bc/iCh/rc 2TVXd9Scw8qFCTM5kj9dBXGLDICe2Rz1c0e/slLsqbAm9zXUaLGaITnEsxlcDTzy iN9U1xedLStSwsjhCQ3osz6r4QwLFIob/fuoTXagXXvWv7DfwnB5uDiPPN31M0wb CCR4039rZzlS6L5fsE0ThoDrtxu1RN5sythVmYJtkOZG6KAAyZYISwb1sxFBSqPL 6PoBPoMuHK0JapbBBS3cvW8TpuhRDz+bkbHs8cKfutSiHzVviWpFgk0E2OjnWh2U LwUNT0ImOnaNDcEK0CPBbT36ry/Ff3o/kyihg9SboQXaDX+dSgT69V9hbiPgMLE= =w7W1 -----END PGP SIGNATURE----- |
From: Russ A. <ea...@ey...> - 2014-08-07 17:24:35
Attachments:
0007-Handle-rsync-v3-e-protocol-option.patch
|
"Johan B.W. de Vries" <jo...@bl...> writes: > I've been trying to set up rssh with rsync 3.0.6, with some difficulty I > made it work. I had to add the --protocol=29 or --protocol=26 command > line argument to rsync, that was not a problem. However, I also had to > modify rssh because all the patches I could find were either out of date > or would not work. Since the bug I found was rather simple, I figured I > could just post my solution here, hoping it'd get picket up some day. The problem that you describe should be fixed by the attached patch, which is applied to the Debian package. The fix you propose could open a security vulnerability since it allows the --rsh flag to be passed to the server. (This hopefully would be okay because the code should require that the --server flag be passed, but it would be better to be safer.) With the attached patch applied, you also won't need to use the --protocol flag, since rssh will recognize -e used for protocol information. -- Russ Allbery (ea...@ey...) <http://www.eyrie.org/~eagle/> |
From: Derek M. <co...@pi...> - 2014-08-08 19:22:07
|
On Thu, Aug 07, 2014 at 05:07:14PM +0200, Johan B.W. de Vries wrote: > Since the bug I found was rather simple, I figured I could just post > my solution here, hoping it'd get picket up some day. I promise it won't. This IS NOT a bug, it is working as intended. > The problem is as follows: rsync should not use the -e argument, so > there's a check on that (don't ask me why, but the code says so). It's been discussed several times on the list; feel free to peruse the archives. -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0x81CFE75D |