Skip to content

Commit cb9e527

Browse files
authored
Merge branch 'master' into master
2 parents 720f7b1 + 797e17f commit cb9e527

25 files changed

+119
-38
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ aclocal.m4
5858
/auto-build-save
5959
.deps
6060
/*.exe
61+
*.dSYM/

batch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int *flag_ptr[] = {
7575
NULL
7676
};
7777

78-
static char *flag_name[] = {
78+
static const char *const flag_name[] = {
7979
"--recurse (-r)",
8080
"--owner (-o)",
8181
"--group (-g)",

compat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ extern int need_messages_from_generator;
5252
extern int delete_mode, delete_before, delete_during, delete_after;
5353
extern int do_compression;
5454
extern int do_compression_level;
55+
extern int do_compression_threads;
5556
extern int saw_stderr_opt;
5657
extern int msgs2stderr;
5758
extern char *shell_cmd;

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,7 @@ else
13921392
AC_DEFINE(HAVE_LINUX_XATTRS, 1, [True if you have Linux xattrs (or equivalent)])
13931393
AC_DEFINE(SUPPORT_XATTRS, 1)
13941394
AC_DEFINE(NO_SYMLINK_USER_XATTRS, 1, [True if symlinks do not support user xattrs])
1395-
AC_CHECK_LIB(attr,getxattr)
1395+
AC_SEARCH_LIBS(getxattr,attr)
13961396
;;
13971397
darwin*)
13981398
AC_MSG_RESULT(Using OS X xattrs)

daemon-parm.awk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
BEGIN {
77
heading = "/* DO NOT EDIT THIS FILE! It is auto-generated from a list of values in " ARGV[1] "! */\n\n"
88
sect = psect = defines = accessors = prior_ptype = ""
9-
parms = "\nstatic struct parm_struct parm_table[] = {"
9+
parms = "\nstatic const struct parm_struct parm_table[] = {"
1010
comment_fmt = "\n/********** %s **********/\n"
1111
tdstruct = "typedef struct {"
1212
}

flist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,8 @@ static void output_flist(struct file_list *flist)
31673167
} else
31683168
*uidbuf = '\0';
31693169
if (gid_ndx) {
3170-
static char parens[] = "(\0)\0\0\0";
3171-
char *pp = parens + (file->flags & FLAG_SKIP_GROUP ? 0 : 3);
3170+
static const char parens[] = "(\0)\0\0\0";
3171+
const char *pp = parens + (file->flags & FLAG_SKIP_GROUP ? 0 : 3);
31723172
snprintf(gidbuf, sizeof gidbuf, " gid=%s%u%s",
31733173
pp, F_GROUP(file), pp + 2);
31743174
} else

io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int active_filecnt = 0;
117117
static OFF_T active_bytecnt = 0;
118118
static int first_message = 1;
119119

120-
static char int_byte_extra[64] = {
120+
static const char int_byte_extra[64] = {
121121
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* (00 - 3F)/4 */
122122
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* (40 - 7F)/4 */
123123
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* (80 - BF)/4 */
@@ -1158,7 +1158,7 @@ void set_io_timeout(int secs)
11581158

11591159
static void check_for_d_option_error(const char *msg)
11601160
{
1161-
static char rsync263_opts[] = "BCDHIKLPRSTWabceghlnopqrtuvxz";
1161+
static const char rsync263_opts[] = "BCDHIKLPRSTWabceghlnopqrtuvxz";
11621162
char *colon;
11631163
int saw_d = 0;
11641164

lib/md5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void md5_update(md_context *ctx, const uchar *input, uint32 length)
197197
memcpy(ctx->buffer + left, input, length);
198198
}
199199

200-
static uchar md5_padding[CSUM_CHUNK] = { 0x80 };
200+
static const uchar md5_padding[CSUM_CHUNK] = { 0x80 };
201201

202202
void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN])
203203
{

lib/sysxattrs.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,26 @@ ssize_t sys_llistxattr(const char *path, char *list, size_t size)
126126
unsigned char keylen;
127127
ssize_t off, len = extattr_list_link(path, EXTATTR_NAMESPACE_USER, list, size);
128128

129-
if (len <= 0 || (size_t)len > size)
129+
if (len <= 0 || size == 0)
130130
return len;
131131

132+
if ((size_t)len >= size) {
133+
/* FreeBSD extattr_list_xx() returns 'size' as 'len' in case there are
134+
more data available, truncating the output, we solve this by signalling
135+
ERANGE in case len == size so that the code in xattrs.c will retry with
136+
a bigger buffer */
137+
errno = ERANGE;
138+
return -1;
139+
}
140+
132141
/* FreeBSD puts a single-byte length before each string, with no '\0'
133142
* terminator. We need to change this into a series of null-terminted
134143
* strings. Since the size is the same, we can simply transform the
135144
* output in place. */
136145
for (off = 0; off < len; off += keylen + 1) {
137146
keylen = ((unsigned char*)list)[off];
138147
if (off + keylen >= len) {
139-
/* Should be impossible, but kernel bugs happen! */
148+
/* Should be impossible, but bugs happen! */
140149
errno = EINVAL;
141150
return -1;
142151
}

loadparm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ typedef enum {
6565

6666
struct enum_list {
6767
int value;
68-
char *name;
68+
const char *name;
6969
};
7070

7171
struct parm_struct {
7272
char *label;
7373
parm_type type;
7474
parm_class class;
7575
void *ptr;
76-
struct enum_list *enum_list;
76+
const struct enum_list *enum_list;
7777
unsigned flags;
7878
};
7979

@@ -95,7 +95,7 @@ static item_list section_list = EMPTY_ITEM_LIST;
9595
static int iSectionIndex = -1;
9696
static BOOL bInGlobalSection = True;
9797

98-
static struct enum_list enum_syslog_facility[] = {
98+
static const struct enum_list enum_syslog_facility[] = {
9999
#ifdef LOG_AUTH
100100
{ LOG_AUTH, "auth" },
101101
#endif

0 commit comments

Comments
 (0)