When "refuse options = compress" is set in rsyncd.conf, silently send files
authorDavid Dykstra <dwd@samba.org>
Tue, 24 Nov 1998 22:03:16 +0000 (22:03 +0000)
committerDavid Dykstra <dwd@samba.org>
Tue, 24 Nov 1998 22:03:16 +0000 (22:03 +0000)
at compression level 0 instead of printing an error and exitting.  This is
the same effect as "dont compress = *".

options.c
rsyncd.conf.yo
token.c

index ca1b018..71a08f5 100644 (file)
--- a/options.c
+++ b/options.c
@@ -238,6 +238,13 @@ static int check_refuse_options(char *ref, int opt)
        while ((p = strstr(ref,name))) {
                if ((p==ref || p[-1]==' ') &&
                    (p[len] == ' ' || p[len] == 0)) {
+                       if (opt == 'z') {
+                               /* don't actually refuse this one, just */
+                               /*  minimize the compression level for now */
+                               extern int default_compression_level;
+                               default_compression_level = 0;
+                               return 0;
+                       }
                        slprintf(err_buf,sizeof(err_buf),
                                 "The '%s' option is not supported by this server\n", name);
                        return 1;
index 2571f29..3dab4b8 100644 (file)
@@ -303,7 +303,8 @@ a 10 minute timeout).
 dit(bf(refuse options)) The "refuse options" option allows you to
 specify a space separated list of rsync command line options that will
 be refused by your rsync server. When an option is refused the server
-prints an error message and exits.
+prints an error message and exits, except for the "compress" option
+in which case the server silently sends all files uncompressed.
 
 The full names of the options must be used (ie. you must use
 "checksum" not "c" to disable checksumming).
diff --git a/token.c b/token.c
index e1039e2..3bd8d34 100644 (file)
--- a/token.c
+++ b/token.c
@@ -21,6 +21,7 @@
 #include "zlib/zlib.h"
 
 extern int do_compression;
+int default_compression_level = Z_DEFAULT_COMPRESSION;
 static int compression_level = Z_DEFAULT_COMPRESSION;
 
 /* determine the compression level based on a wildcard filename list */
@@ -32,7 +33,7 @@ void set_compression(char *fname)
 
        if (!do_compression) return;
 
-       compression_level = Z_DEFAULT_COMPRESSION;
+       compression_level = default_compression_level;
        dont = lp_dont_compress(module_id);
 
        if (!dont || !*dont) return;