Matt McCutchen's Web Site
/
rsync
/
rsync-patches.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6292693
)
Added a sanity check to the xattr-reading code so that some crafty
author
Wayne Davison
<wayned@samba.org>
Fri, 21 Apr 2006 00:04:16 +0000
(
00:04
+0000)
committer
Wayne Davison
<wayned@samba.org>
Fri, 21 Apr 2006 00:04:16 +0000
(
00:04
+0000)
size values cannot cause a buffer overflow.
xattrs.diff
patch
|
blob
|
blame
|
history
diff --git
a/xattrs.diff
b/xattrs.diff
index
fe696d0
..
998ff8c
100644
(file)
--- a/
xattrs.diff
+++ b/
xattrs.diff
@@
-69,7
+69,7
@@
After applying this patch, run these commands for a successful build:
if (verbose > 1) {
--- old/configure.in
+++ new/configure.in
if (verbose > 1) {
--- old/configure.in
+++ new/configure.in
-@@ -8
14,6 +814
,30 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
+@@ -8
23,6 +823
,30 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_
AC_MSG_RESULT(no)
)
AC_MSG_RESULT(no)
)
@@
-230,7
+230,7
@@
After applying this patch, run these commands for a successful build:
int preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_perms = 0;
int preserve_executability = 0;
int preserve_devices = 0;
-@@ -19
6,6 +197
,7 @@ static void print_rsync_version(enum log
+@@ -19
4,6 +195
,7 @@ static void print_rsync_version(enum log
char const *have_inplace = "no ";
char const *hardlinks = "no ";
char const *acls = "no ";
char const *have_inplace = "no ";
char const *hardlinks = "no ";
char const *acls = "no ";
@@
-238,7
+238,7
@@
After applying this patch, run these commands for a successful build:
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
char const *links = "no ";
char const *ipv6 = "no ";
STRUCT_STAT *dumstat;
-@@ -21
5,7 +217
,9 @@ static void print_rsync_version(enum log
+@@ -21
3,7 +215
,9 @@ static void print_rsync_version(enum log
#ifdef SUPPORT_ACLS
acls = "";
#endif
#ifdef SUPPORT_ACLS
acls = "";
#endif
@@
-249,7
+249,7
@@
After applying this patch, run these commands for a successful build:
#ifdef SUPPORT_LINKS
links = "";
#endif
#ifdef SUPPORT_LINKS
links = "";
#endif
-@@ -22
9,9 +233
,9 @@ static void print_rsync_version(enum log
+@@ -22
7,9 +231
,9 @@ static void print_rsync_version(enum log
rprintf(f, "Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
rprintf(f, "<http://rsync.samba.org/>\n");
rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
rprintf(f, "Copyright (C) 1996-2006 by Andrew Tridgell, Wayne Davison, and others.\n");
rprintf(f, "<http://rsync.samba.org/>\n");
rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
@@
-261,7
+261,7
@@
After applying this patch, run these commands for a successful build:
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
/* Note that this field may not have type ino_t. It depends
* on the complicated interaction between largefile feature
-@@ -30
4,6 +308
,9 @@ void usage(enum logcode F)
+@@ -30
2,6 +306
,9 @@ void usage(enum logcode F)
#ifdef SUPPORT_ACLS
rprintf(F," -A, --acls preserve ACLs (implies --perms)\n");
#endif
#ifdef SUPPORT_ACLS
rprintf(F," -A, --acls preserve ACLs (implies --perms)\n");
#endif
@@
-271,7
+271,7
@@
After applying this patch, run these commands for a successful build:
rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -o, --owner preserve owner (super-user only)\n");
rprintf(F," -g, --group preserve group\n");
-@@ -42
2,6 +429
,9 @@ static struct poptOption long_options[]
+@@ -42
0,6 +427
,9 @@ static struct poptOption long_options[]
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
{"no-A", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
{"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 },
{"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
{"no-A", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 },
@@
-281,7
+281,7
@@
After applying this patch, run these commands for a successful build:
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"times", 't', POPT_ARG_VAL, &preserve_times, 1, 0, 0 },
{"no-times", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
{"no-t", 0, POPT_ARG_VAL, &preserve_times, 0, 0, 0 },
-@@ -109
6,6 +1106
,17 @@ int parse_arguments(int *argc, const cha
+@@ -109
5,6 +1105
,17 @@ int parse_arguments(int *argc, const cha
return 0;
#endif
return 0;
#endif
@@
-299,7
+299,7
@@
After applying this patch, run these commands for a successful build:
default:
/* A large opt value means that set_refuse_options()
default:
/* A large opt value means that set_refuse_options()
-@@ -154
4,6 +1565
,10 @@ void server_options(char **args,int *arg
+@@ -154
2,6 +1563
,10 @@ void server_options(char **args,int *arg
if (preserve_acls)
argstr[x++] = 'A';
#endif
if (preserve_acls)
argstr[x++] = 'A';
#endif
@@
-333,7
+333,7
@@
After applying this patch, run these commands for a successful build:
if ((st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
--- old/rsync.h
+++ new/rsync.h
if ((st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
--- old/rsync.h
+++ new/rsync.h
-@@ -67
2,6 +672
,14 @@ struct chmod_mode_struct;
+@@ -67
4,6 +674
,14 @@ struct chmod_mode_struct;
#endif
#include "smb_acls.h"
#endif
#include "smb_acls.h"
@@
-358,9
+358,9
@@
After applying this patch, run these commands for a successful build:
--chmod=CHMOD change destination permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
--chmod=CHMOD change destination permissions
-o, --owner preserve owner (super-user only)
-g, --group preserve group
-@@ -80
2,6 +803,11 @@ dit(bf(-A, --acls)) This option causes r
- ACLs to be the same as the source ACLs. This nonstandard option only
-
works if the remote rsync also supports it. bf(--acls) implies bf(--perms)
.
+@@ -80
7,6 +808,11 @@ version makes it incompatible with sendi
+ rsync unless you double the bf(--acls) option (e.g. bf(-AA)). This
+
doubling is not needed when pulling files from an older rsync
.
+dit(bf(-X, --xattrs)) This option causes rsync to update the remote
+extended attributes to be the same as the local ones. This will work
+dit(bf(-X, --xattrs)) This option causes rsync to update the remote
+extended attributes to be the same as the local ones. This will work
@@
-372,7
+372,7
@@
After applying this patch, run these commands for a successful build:
transfer. The resulting value is treated as though it was the permissions
--- old/xattr.c
+++ new/xattr.c
transfer. The resulting value is treated as though it was the permissions
--- old/xattr.c
+++ new/xattr.c
-@@ -0,0 +1,52
1
@@
+@@ -0,0 +1,52
3
@@
+/* Extended Attribute support for rsync */
+/* Copyright (C) 2004 Red Hat, Inc */
+/* Written by Jay Fenlason, vaguely based on the ACLs patch */
+/* Extended Attribute support for rsync */
+/* Copyright (C) 2004 Red Hat, Inc */
+/* Written by Jay Fenlason, vaguely based on the ACLs patch */
@@
-750,6
+750,8
@@
After applying this patch, run these commands for a successful build:
+
+ name_len = read_int(f);
+ datum_len = read_int(f);
+
+ name_len = read_int(f);
+ datum_len = read_int(f);
++ if (name_len + datum_len < name_len)
++ out_of_memory("receive_xattr"); /* overflow */
+ ptr = new_array(char, name_len + datum_len);
+ if (!ptr)
+ out_of_memory("receive_xattr");
+ ptr = new_array(char, name_len + datum_len);
+ if (!ptr)
+ out_of_memory("receive_xattr");