Debian Bug report logs - #212341
rsync: Making streaming easier.

version graph

Package: rsync; Maintainer for rsync is Samuel Henrique <[email protected]>; Source for rsync is src:rsync (PTS, buildd, popcon).

Reported by: [email protected]

Date: Tue, 23 Sep 2003 11:48:02 UTC

Severity: wishlist

Found in version 2.5.6-0.1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Philip Hands <[email protected]>:
Bug#212341; Package rsync. (full text, mbox, link).


Acknowledgement sent to [email protected]:
New Bug report received and forwarded. Copy sent to Philip Hands <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Manuel Estrada Sainz <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: rsync: Making streaming easier.
Date: Tue, 23 Sep 2003 13:37:41 +0200
Package: rsync
Version: 2.5.6-0.1
Severity: wishlist

 Hi,

 As far a I know, there is no other program other than rsync that can
 access rsync servers.
 
 Making it easier to use the existing rsync program programaticaly to
 access rsync servers from other applications would be quite useful.

 There are two approaches that I can think of:

 1) Allow specifying the temp file's name for single file transfers. If
    that was possible, hacking around it to get the desired effect would
    be even easy.
    
 2) Adding --stream-to-fd parameter, so all file data gets also written
    to the specified fd. That would allow the streaming while letting
    rsync work normally.

 For instance, this is an LD_PRELOADable library that did the trick for
 me while coding apt-proxy v2:

-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <stdlib.h>

static int fd_err = -1;
static FILE *debug;
void _init(void)
{
	debug=stderr;
	/* Make sure that nothing gets spit to stdout */
	stdout = stderr;
	/* save a file descriptor for stderr because rsync seams to close it
	 * at the and I want to write some debuging messages */
	fd_err = dup(2);
	fprintf(debug, "starting\n");
}
void _fini(void)
{
	fprintf(debug, "ending\n");
}

int mkstemp(char *template)
{
	fprintf(debug, "file_template: %s\n", template);
	open(template, O_RDWR|O_CREAT, 0600);
	return 1;
}
int mkstemp64(char *template)
{
	return mkstemp(template);
}
int rename(const char *oldpath, const char *newpath)
{
	dup2(fd_err, 2);
	fprintf(debug, "newpath: %s\n", newpath);
	if(strstr(oldpath, "XXXXXX")) {
		char command[300] = "touch -r ";
		fprintf(debug, "removeing %s\n", oldpath);
		/* rsync changes the mtime on the temporal file, so use that
		 * to touch owr file */
		snprintf(command, sizeof(command), "touch -r %s %s",
				oldpath, newpath);
		system(command);
		return unlink(oldpath);
	} else{
		fprintf(debug, "renaiming %s\n\n", oldpath);
		return syscall(SYS_rename, oldpath, newpath);
	}
}

-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----

 Thanks for maintaining rsync

 	Manuel

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux hell 2.4.21-dm-debian #3 Sun Aug 17 03:33:36 CEST 2003 i686
Locale: LANG=C, LC_CTYPE=es_ES

Versions of packages rsync depends on:
ii  libc6                         2.3.2-8    GNU C Library: Shared libraries an
ii  libpopt0                      1.7-2      lib for parsing cmdline parameters

-- no debconf information


-- 
--- Manuel Estrada Sainz <[email protected]>
                         <[email protected]>
			 <[email protected]>
------------------------ <[email protected]> -------------------
Let us have the serenity to accept the things we cannot change, courage to
change the things we can, and wisdom to know the difference.



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 15:47:27 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.