OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 21-May-2004 18:05:45
Branch: OPENPKG_2_0_SOLID Handle: 2004052117054300
Modified files: (Branch: OPENPKG_2_0_SOLID)
openpkg-src/rsync rsync.patch rsync.spec
Log:
SA-2004.025-rsync; CAN-2004-0426
Summary:
Revision Changes Path
1.5.2.1 +100 -0 openpkg-src/rsync/rsync.patch
1.58.2.2 +1 -1 openpkg-src/rsync/rsync.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/rsync/rsync.patch
============================================================================
$ cvs diff -u -r1.5 -r1.5.2.1 rsync.patch
--- openpkg-src/rsync/rsync.patch 1 Jan 2004 19:17:57 -0000 1.5
+++ openpkg-src/rsync/rsync.patch 21 May 2004 16:05:43 -0000 1.5.2.1
@@ -55,3 +55,103 @@
while (c->len)
{
NEEDOUT
+
+http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0426
+ rsync before 2.6.1 does not properly sanitize paths when running
+ a read/write daemon without using chroot, which allows remote
+ attackers to write files outside of the module's path.
+
+Index: options.c
+--- options.c.260 2003-12-30 19:16:25.000000000 +0100
++++ options.c 2004-05-21 14:23:31.000000000 +0200
+@@ -21,6 +21,8 @@
+ #include "rsync.h"
+ #include "popt.h"
+
++extern int sanitize_paths;
++extern char curr_dir[MAXPATHLEN];
+ extern struct exclude_struct **exclude_list;
+
+ int make_backups = 0;
+@@ -460,6 +462,7 @@
+ {
+ int opt;
+ char *ref = lp_refuse_options(module_id);
++ char *arg;
+ poptContext pc;
+
+ /* TODO: Call poptReadDefaultConfig; handle errors. */
+@@ -507,14 +507,20 @@
+ add_exclude(&exclude_list, poptGetOptArg(pc),
+ ADD_INCLUDE);
+
+- case OPT_EXCLUDE_FROM:
+- add_exclude_file(&exclude_list, poptGetOptArg(pc),
+- MISSING_FATAL, ADD_EXCLUDE);
++ case OPT_EXCLUDE_FROM:
++ arg = (char *)poptGetOptArg(pc);
++ if (sanitize_paths)
++ sanitize_path(arg, curr_dir);
++ add_exclude_file(&exclude_list, arg,
++ MISSING_FATAL, ADD_EXCLUDE);
+ break;
+
+- case OPT_INCLUDE_FROM:
+- add_exclude_file(&exclude_list, poptGetOptArg(pc),
+- MISSING_FATAL, ADD_INCLUDE);
++ case OPT_INCLUDE_FROM:
++ arg = (char *)poptGetOptArg(pc);
++ if (sanitize_paths)
++ sanitize_path(arg, curr_dir);
++ add_exclude_file(&exclude_list, arg,
++ MISSING_FATAL, ADD_INCLUDE);
+ break;
+
+ case 'h':
+@@ -625,6 +634,23 @@
+ if (relative_paths < 0)
+ relative_paths = files_from? 1 : 0;
+
++ *argv = poptGetArgs(pc);
++ if (*argv)
++ *argc = count_args(*argv);
++ else
++ *argc = 0;
++
++ if (sanitize_paths) {
++ if (tmpdir)
++ sanitize_path(tmpdir, curr_dir);
++ if (compare_dest)
++ sanitize_path(compare_dest, curr_dir);
++ if (backup_dir)
++ sanitize_path(backup_dir, curr_dir);
++ if (files_from)
++ sanitize_path(files_from, curr_dir);
++ }
++
+ if (!backup_suffix)
+ backup_suffix = backup_dir? "" : BACKUP_SUFFIX;
+ backup_suffix_len = strlen(backup_suffix);
+@@ -644,12 +679,6 @@
+ if (do_progress && !verbose)
+ verbose = 1;
+
+- *argv = poptGetArgs(pc);
+- if (*argv)
+- *argc = count_args(*argv);
+- else
+- *argc = 0;
+-
+ if (files_from) {
+ char *colon;
+ if (*argc != 2) {
+@@ -672,9 +701,6 @@
+ exit_cleanup(RERR_SYNTAX);
+ }
+ } else {
+- extern int sanitize_paths;
+- if (sanitize_paths)
+- sanitize_path(strdup(files_from), NULL);
+ filesfrom_fd = open(files_from, O_RDONLY|O_BINARY);
+ if (filesfrom_fd < 0) {
+ rsyserr(FERROR, errno,
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/rsync/rsync.spec
============================================================================
$ cvs diff -u -r1.58.2.1 -r1.58.2.2 rsync.spec
--- openpkg-src/rsync/rsync.spec 18 Feb 2004 14:51:29 -0000 1.58.2.1
+++ openpkg-src/rsync/rsync.spec 21 May 2004 16:05:43 -0000 1.58.2.2
@@ -34,7 +34,7 @@
Group: Filesystem
License: GPL
Version: 2.6.0
-Release: 2.0.0
+Release: 2.0.1
# list of sources
Source0: http://rsync.samba.org/ftp/rsync/rsync-%{version}.tar.gz
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]