--exclude-from works but "exclude from" in rsyncd.conf doesn't ?

Wayne Davison wayned at samba.org
Sat Jun 28 01:05:01 EST 2003

[The mailing-list software appears to have choked on my last reply, so
I'll try again...]

On Thu, Jun 26, 2003 at 05:05:04PM -0700, jw schultz wrote:
> I know it isn't your patch adding it but these literals are really
> more opaque than the code deserves.  I'm thinking we/i should replace
> them with #defines that indicate meaning.

That would help make the code a bit more readable, so I went ahead and
created some defines for these old literals.

> We probably shouldn't be reporting to the client that we have matched
> a server-side pattern.

It apparently doesn't.  I haven't tried to figure out exactly why, but I
tested it with huge levels of 'v', and the server doesn't report the
exclusions it's doing.

> | +       if (check_exclude_file(fname, S_ISDIR(st.st_mode) != 0, exclude_level))
> Is != 0 necessary here?

I think so -- for portability.  This bit me once long ago when some
system (I forget which) returned the literal bitfield value for these
macros (unlike on Linux, which returns truth values).  A high enough bit
value can get truncated to 0 if cast to too-small a size.  I guess I'm
paranoid about that sort of thing these days -- passing the value as an
int should _probably_ be safe, but I like to make sure that these macros
get turned into real truth values if they are assigned to a variable or
passed as an arg.

> | +       return 0 && list && name && name_is_dir;
> Maybe i'm having a brain-fart but how does this ever return
> anything but 0?

It doesn't -- it always returns 0.  It's just stub code in the test
wrapper.  The routine doesn't actually get called, so it just references
its args to avoid compiler warnings.  Yeah, I should have added some
comments to that effect -- fixed.

> The patch looks like it contains some unrelated refactoring
> work in util.c.

There's a little bit of minor improvements that I made while working on
the code for this patch.  The majority of these changes are necessary to
make sure that the server's exclusions get applied to the command-line
args that the user specifies.  Without this, the user could get past a
"- /foo/" restriction by specifying host::module/foo/file.  There are
certainly a couple brace twiddles and some minor optimizations that I
made (such as not calling strlen() over and over in a loop), but the
rest of the changes are necessary (such as the fix to push_dir() that
keeps it from adding "/." onto the end of the saved path -- that
interferes with the new root-level exclusion matching).

I've updated the patch with the result of your feedback.  Thanks!



More information about the rsync mailing list