rsync- buffer overflow/broken pipe with critical filename-lenght using cwrsync at server-side

2009-04-22 Thread Thilo Janssen

hi everybody,
i?ve a problem with rsync runnig.

constellation:
rsyncserver is cwrsync at win2k-machine (without cygwin-beta against 
long filename-problem), client is a linux-ubuntu box.


log from the server: (i just change names with xxx, no special charakters)
this error happens all the time again,

/overflow: flags=0xba l1=240 l2=22 
lastname=transfer/stasql/Transfer/xDB/Paletten-Service/Kunden/x 
xxx Care neu/Sonstiges/Additional agreement xx. xx-Dateien/WG 
Vereinfachung Handling von gebrauchten u. defekten Paletten - neuer 
Palettenpreis 750 â,¬Stck.-Dateien/themedata.thmx/


/2009/04/15 12:43:18 [2280] ERROR: buffer overflow in receive_file_entry 
[receiver]/


/2009/04/15 12:43:18 [2280] rsync error: error allocating core memory 
buffers (code 22) at util.c(121) [receiver=2.6.9]/


Logfile from client:

/122200 files...
overflow: flags=0xba l1=240 l2=22 
lastname=transfer/stasql/Transfer/xDB/Paletten-Service/Kunden/x 
xxx Care neu/Sonstiges/Additional agreement xx. xx-Dateien/WG 
Vereinfachung Handling von gebrauchten u. defekten Paletten - neuer 
Palettenpreis 750 \#342\#202\#254Stck.-Dateien/themedata.thmx
rsync: writefd_unbuffered failed to write 4092 bytes [sender]: Broken pipe (32)
ERROR: buffer overflow in receive_file_entry [receiver]
rsync error: error allocating core memory buffers (code 22) at util.c(121) 
[receiver=2.6.9]
rsync: connection unexpectedly closed (4 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(454) 
[sender=2.6.9]/


First i thought the failure happens because of the 
256-characters-limitations of cygwin.dll. But normaly then the error 
must say: filename too long.
And second problem: i count the characters 254 at server-side :) 1 
too less for this problem.
Next idea: the special characters at the end? --> 750 *â,¬*Stck. When I 
look at the end of the client-log, there it looks like this: 750 
\#342\#202\#254Stck

now there ar more characters then the 255 alounds...

My question:
is the problem the lenght of the filename ( why is there another error 
and not the "normal" error 91?) ? or is it because of the special 
characters? or is it because of something completely different?


thx for any help!!!
greets,
cptkoma

Ps: sorry for my bad english. didn?t use this language for a long time :)
Ps2: sorry about this bad filename... its customers-choise, not mine...



--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[PATCH] allow to disable SLP with runtime option

2009-04-22 Thread Petr Uzel
Hi everyone,

I'd like to propose a patch for review. It enhances rsync when
patched and compiled with slp support.

It adds a new global boolean option, 'disable slp', which can be used to disable
SLP advertisements at runtime. The idea behind this patch is to allow
distributors to build rsync with SLP support compiled in, but to allow
the users to turn it off without recompiling rsync on their own.


The patch applies to rsync-3.0.6pre1 with slp.diff applied.


I'd highly appreciate any feedback.



Index: rsync-3.0.6pre1/loadparm.c
===
--- rsync-3.0.6pre1.orig/loadparm.c 2009-04-22 12:47:39.0 +0200
+++ rsync-3.0.6pre1/loadparm.c  2009-04-22 13:30:39.0 +0200
@@ -111,6 +111,7 @@ typedef struct
int rsync_port;
 #ifdef HAVE_LIBSLP
int slp_refresh;
+   BOOL disable_slp;
 #endif
 } global;
 
@@ -305,6 +306,7 @@ static struct parm_struct parm_table[] =
  {"port",  P_INTEGER,P_GLOBAL,&Globals.rsync_port, NULL,0},
 #ifdef HAVE_LIBSLP
  {"slp refresh",   P_INTEGER,P_GLOBAL,&Globals.slp_refresh,NULL,0},
+ {"disable slp",P_BOOL,   P_GLOBAL,&Globals.disable_slp,
NULL,0},
 #endif
  {"socket options",P_STRING, P_GLOBAL,&Globals.socket_options, NULL,0},
 
@@ -402,6 +404,7 @@ FN_GLOBAL_STRING(lp_socket_options, &Glo
 FN_GLOBAL_INTEGER(lp_rsync_port, &Globals.rsync_port)
 #ifdef HAVE_LIBSLP
 FN_GLOBAL_INTEGER(lp_slp_refresh, &Globals.slp_refresh)
+FN_GLOBAL_BOOL(lp_disable_slp, &Globals.disable_slp)
 #endif
 
 FN_LOCAL_STRING(lp_auth_users, auth_users)
Index: rsync-3.0.6pre1/clientserver.c
===
--- rsync-3.0.6pre1.orig/clientserver.c 2009-04-22 12:47:39.0 +0200
+++ rsync-3.0.6pre1/clientserver.c  2009-04-22 13:36:35.0 +0200
@@ -1065,9 +1065,11 @@ int daemon_main(void)
 * local address??? */
 
 #ifdef HAVE_LIBSLP
-   if (register_services()) {
-   rprintf(FINFO,
-   "Couldn't register with service discovery protocol, 
continuing anyway\n");
+   if (!lp_disable_slp()) {
+   if (register_services()) {
+   rprintf(FINFO,
+   "Couldn't register with service discovery 
protocol, continuing anyway\n");
+   }
}
 #endif
 
Index: rsync-3.0.6pre1/rsyncd.conf.yo
===
--- rsync-3.0.6pre1.orig/rsyncd.conf.yo 2009-04-22 12:47:39.0 +0200
+++ rsync-3.0.6pre1/rsyncd.conf.yo  2009-04-22 15:17:07.0 +0200
@@ -113,6 +113,10 @@ set to more than 65535, then 65535 is us
 Using 3600 (one hour) is a good number if you tend to change your
 configuration.
 
+dit(bf(disable slp)) This parameter is used to turn off service advertisements
+completely, and is only applicable if you have Service Location Protocol
+support compiled in. The default is no.
+
 enddit()
 
 manpagesection(MODULE PARAMETERS)


-- 
Best regards / s pozdravem

Petr Uzel, Packages maintainer
-
SUSE LINUX, s.r.o.  e-mail: pu...@suse.cz
Lihovarská 1060/12  tel: +420 284 028 964
190 00 Prague 9 fax: +420 284 028 951
Czech Republic  http://www.suse.cz
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


rsync windows acl

2009-04-22 Thread David de Lama
>> Rsync's man page inidcates support for ACLs, but does not mention what
>> ACL model is supported.
>
>Rsync supports POSIX ACLs as described at http://acl.bestbits.at/ .
>
>> > - Rsync uses Unix-like UIDs and GIDs. [...]
>
>> Presumably, if rsync supports ACLs, it supports the NFSv4 style
>> "user at domain" or "group at domain" identifiers instead of or in addition
>> to UID/GIDs.
>
>POSIX ACLs just use UIDs/GIDs, so that's all rsync supports (though it
>can map them from one system to another by name).
>
>-- 
>Matt



Hi @all!
Thanks for that quick answers.
I first copy the files from a Win-Client to a Linux-Server with rsync. After 
that I (try to) use robocopy to transfer the ACLs.
But I don't know where and what is copied. Because I don't see anything on the 
Linux-Server.
Could someone help me out? Or give me some kind of "howto"?
Thanks again.

David




Pt! Schon vom neuen WEB.DE MultiMessenger gehört? 
Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: [Code study] lp_motd_file defination? Help

2009-04-22 Thread Daniel.Li
On Wed, 2009-04-22 at 10:14 +0200, Paul Slootman wrote:
> On Wed 22 Apr 2009, Daniel.Li wrote:
> > 
> > Currently, I read this in clientserver.c, line 148.
> > 
> > motd = lp_motd_file();
> > 
> > I have googled, but didn't the definition of char *lp_motd_file(void).
> 
> > $ grep "lp_motd_file" . -R
> > ./proto.h:char *lp_motd_file(void);
> > ./loadparm.c:FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)
> 
> So look in loadparm.c ...  I'm guessing this is for some school course?
> If you're reasonably able to read code, that code snippet shouldn't be
> hard to understand, and if not, ask your teacher, not us :-)

Sorry, I'm in a hurry. I just wanna get a full picture of program flow
and basic APIs of algorithm. 

We are planning to implement a feature, which will enable us to restore
to any backup point.

Is it possible for us to do so?\

Any idea is mostly appreciated. Thanks.
> 
> 
> Paul
-- 
Daniel

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


DO NOT REPLY [Bug 3653] Reduce the need for the "vanished files" warning

2009-04-22 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3653





--- Comment #15 from o...@yadan.net  2009-04-22 03:51 CST ---
I ended up using the following script for snapback2 (which exits with the same
error codes as rsync if rsync fails:

# cat /etc/cron.daily/snapback2
#! /bin/sh
OUT=`/usr/bin/snapback2 2>&1`
RET=$?
if [ "$RET" != "23" -a "$RET" != "0" -a "$RET" != 24 ]; then
echo "$OUT"
exit $RET
fi

this is a workaround, it would still be great to be able to tell rsync to
ignore vanished files.


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug, or are watching the QA contact.
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


DO NOT REPLY [Bug 3653] Reduce the need for the "vanished files" warning

2009-04-22 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=3653





--- Comment #14 from rv-rsyncbugzi...@eychenne.org  2009-04-22 03:39 CST 
---
I also find this warning annoying, I really vote for this patch.


-- 
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the QA contact for the bug, or are watching the QA contact.
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: [Code study] lp_motd_file defination? Help

2009-04-22 Thread Daniel.Li
On Wed, 2009-04-22 at 15:54 +0800, Daniel.Li wrote:
> Dear List,
> 
> Currently, I read this in clientserver.c, line 148.
> 
> motd = lp_motd_file();
> 
> I have googled, but didn't the definition of char *lp_motd_file(void).
> Can anyone help to explain the following code segment. Many thanks.

I got this, just take a closer look at those macros

FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)
#define FN_LOCAL_STRING(fn_name,val) \
char *fn_name(int i)
{return((LP_SNUM_OK(i)&&pSERVICE(i)->val)?pSERVICE(i)->val :
(sDefault.val?sDefault.val:""));}

So, char *lp_motd_file(void) is as below. Well, I still didn't have a
clear picture about below function. Any help is mostly appreciated.:)

char *lp_motd_file(int i) {
return((LP_SNUM_OK(i)&&pSERVICE(i)->&Globals.motd_file)?
pSERVICE(i)->&Globals.motd_file : 

(sDefault.&Globals.motd_file?sDefault.&Globals.motd_file:""));
}
-- 
Daniel

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: [Code study] lp_motd_file defination? Help

2009-04-22 Thread Paul Slootman
On Wed 22 Apr 2009, Daniel.Li wrote:
> 
> Currently, I read this in clientserver.c, line 148.
> 
> motd = lp_motd_file();
> 
> I have googled, but didn't the definition of char *lp_motd_file(void).

> $ grep "lp_motd_file" . -R
> ./proto.h:char *lp_motd_file(void);
> ./loadparm.c:FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)

So look in loadparm.c ...  I'm guessing this is for some school course?
If you're reasonably able to read code, that code snippet shouldn't be
hard to understand, and if not, ask your teacher, not us :-)


Paul
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[Code study] lp_motd_file defination? Help

2009-04-22 Thread Daniel.Li
Dear List,

Currently, I read this in clientserver.c, line 148.

motd = lp_motd_file();

I have googled, but didn't the definition of char *lp_motd_file(void).
Can anyone help to explain the following code segment. Many thanks.

#line 147 ~ 160, in clientserver.c, version 3.0.5

> if (!am_client) {
> motd = lp_motd_file();
> if (motd && *motd) {
> FILE *f = fopen(motd,"r");
> while (f && !feof(f)) {
> int len = fread(buf, 1, bufsiz - 1, f);
> if (len > 0)
> write_buf(f_out, buf, len);
> }
> if (f)
> fclose(f);
> write_sbuf(f_out, "\n");
> }
> }

$ grep "lp_motd_file" . -R
./proto.h:char *lp_motd_file(void);
./loadparm.c:FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)
./clientserver.c:   motd = lp_motd_file();


-- 
Daniel

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html