### BUG FIXES:
+ - Avoid a crash when a daemon module enables `transfer logging` without
+ setting a `log format` value.
+
- Fixed installing rsync-ssl script from an alternate build dir.
- Fixed the updating of configure.sh from an alternate build dir.
/* Expand %VAR% references. Any unknown vars or unrecognized
* syntax leaves the raw chars unchanged. */
-static char *expand_vars(char *str)
+static char *expand_vars(const char *str)
{
- char *buf, *t, *f;
+ char *buf, *t;
+ const char *f;
int bufsize;
if (!str || !strchr(str, '%'))
- return str;
+ return (char *)str; /* TODO change return value to const char* at some point. */
bufsize = strlen(str) + 2048;
buf = new_array(char, bufsize+1); /* +1 for trailing '\0' */
for (t = buf, f = str; bufsize && *f; ) {
- if (*f == '%' && *++f != '%') {
- char *percent = strchr(f, '%');
- if (percent) {
+ if (*f == '%' && isUpper(f+1)) {
+ char *percent = strchr(f+1, '%');
+ if (percent && percent - f < bufsize) {
char *val;
- *percent = '\0';
- val = getenv(f);
- *percent = '%';
+ strlcpy(t, f+1, percent - f);
+ val = getenv(t);
if (val) {
int len = strlcpy(t, val, bufsize+1);
if (len > bufsize)
continue;
}
}
- f--;
}
*t++ = *f++;
bufsize--;
munge symlinks = no
hosts allow = localhost 127.0.0.0/24 192.168.0.0/16 10.0.0.0/8 $hostname
log file = $logfile
-log format = %i %h [%a] %m (%u) %l %f%L
transfer logging = yes
+# We don't define log format here so that the test-hidden module will default
+# to the internal static string (since we had a crash trying to tweak it).
exclude = ? foobar.baz
max verbosity = 4
$uid_setting
[test-from]
path = $fromdir
+ log format = %i %h [%a] %m (%u) %l %f%L
read only = yes
comment = r/o
[test-to]
path = $todir
+ log format = %i %h [%a] %m (%u) %l %f%L
read only = no
comment = r/w
[test-scratch]
path = $scratchdir
+ log format = %i %h [%a] %m (%u) %l %f%L
read only = no
[test-hidden]