~ubuntu-branches/ubuntu/raring/rssh/raring

« back to all changes in this revision

Viewing changes to debian/patches/features/subversion.diff

  • Committer: Package Import Robot
  • Author(s): Russ Allbery
  • Date: 2012-08-10 22:14:34 UTC
  • Revision ID: package-import@ubuntu.com-20120810221434-kc3lj18l5zhebag4
Tags: 2.3.3-5
Apply upstream patch to close security vulnerability that permitted
clever manipulation of environment variables on the ssh command line
to bypass rssh checking.  (CVE-2012-3478)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 rssh.h               |   13 +++++++------
25
25
 rssh_chroot_helper.c |    3 +++
26
26
 rsshconf.c           |   47 +++++++++++++++++++++++++++++++++++++++++++----
27
 
 util.c               |   34 +++++++++++++++++++++++++---------
 
27
 util.c               |   35 ++++++++++++++++++++++++++---------
28
28
 util.h               |    3 ++-
29
 
 13 files changed, 190 insertions(+), 93 deletions(-)
 
29
 13 files changed, 191 insertions(+), 93 deletions(-)
30
30
 
31
31
diff --git a/conf_convert b/conf_convert
32
32
new file mode 100755
181
181
 AC_SUBST(sysconfdir)
182
182
 AC_SUBST(libexecdir)
183
183
diff --git a/main.c.in b/main.c.in
184
 
index 02a3085..c278c5c 100644
 
184
index 7d1695c..b3228e5 100644
185
185
--- a/main.c.in
186
186
+++ b/main.c.in
187
187
@@ -217,6 +217,8 @@ char **build_shell_args( struct passwd uinfo,
193
193
                else {
194
194
                        log_set_priority(LOG_ERR);
195
195
                        log_msg("fatal error identifying the correct command "
196
 
@@ -265,7 +267,8 @@ void vers_info( void )
 
196
@@ -267,7 +269,8 @@ void vers_info( void )
197
197
        printf("%20s = %s\n", "sftp server binary", PATH_SFTP_SERVER);
198
198
        printf("%20s = %s\n", "cvs binary path", PATH_CVS);
199
199
        printf("%20s = %s\n", "rdist binary path", PATH_RDIST);
517
517
                if (log) log_msg("chrooting %s to %s", user, path);
518
518
                opts->shell_flags |= RSSH_USE_CHROOT;
519
519
diff --git a/util.c b/util.c
520
 
index 50a63e2..628607c 100644
 
520
index a3e9829..74b22f0 100644
521
521
--- a/util.c
522
522
+++ b/util.c
523
523
@@ -80,7 +80,8 @@ void fail( int flags, int argc, char **argv )
541
541
        }
542
542
 
543
543
        /* print error message to user and log attempt */
544
 
@@ -273,6 +276,17 @@ char *check_command_line( char *cl, ShellOptions_t *opts )
 
544
@@ -280,6 +283,16 @@ char *check_command_line( char **cl, ShellOptions_t *opts )
 
545
                }
545
546
                return PATH_RSYNC;
546
547
        }
547
 
 
548
 
+       if ( check_command(cl, opts, PATH_SVNSERVE, RSSH_ALLOW_SVNSERVE) ){
 
548
+       if ( check_command(*cl, opts, PATH_SVNSERVE, RSSH_ALLOW_SVNSERVE) ){
549
549
+               /* check command line */
550
 
+               if( strlen(cl) != 11 || strcmp(cl, "svnserve -t") ) {
 
550
+               if( cl[1] == NULL || strcmp(cl[1], "-t") != 0 || cl[2] != NULL){
551
551
+                       fprintf(stderr, "\nextra svnserver parameter(s) not allowed.");
552
552
+                       log_msg("unallowed option(s) in svnserver command line!");
553
553
+                       return NULL;
555
555
+
556
556
+               return PATH_SVNSERVE;
557
557
+       }
558
 
+
 
558
        /* No match, return NULL */
 
559
        return NULL;
 
560
 }
 
561
@@ -304,6 +317,8 @@ char *get_command( char *cl, ShellOptions_t *opts )
 
562
                return PATH_RDIST;
 
563
        if ( check_command(cl, opts, PATH_RSYNC, RSSH_ALLOW_RSYNC) )
 
564
                return PATH_RSYNC;
 
565
+       if ( check_command(cl, opts, PATH_SVNSERVE, RSSH_ALLOW_SVNSERVE) )
 
566
+               return PATH_SVNSERVE;
559
567
        return NULL;
560
568
 }
561
569
 
562
 
@@ -337,22 +351,24 @@ int validate_umask( const char *temp, int *mask )
 
570
@@ -369,22 +384,24 @@ int validate_umask( const char *temp, int *mask )
563
571
  *                     same name, and returns FALSE if the bits are not valid
564
572
  */
565
573
 int validate_access( const char *temp, bool *allow_sftp, bool *allow_scp,
566
 
-                    bool *allow_cvs, bool *allow_rdist, bool *allow_rsync )
 
574
-                    bool *allow_cvs, bool *allow_rdist, bool *allow_rsync )
567
575
+                    bool *allow_cvs, bool *allow_rdist, bool *allow_rsync,
568
576
+                    bool *allow_svnserve )
569
577
 {
592
600
 }
593
601
 
594
602
diff --git a/util.h b/util.h
595
 
index 2882c74..220150e 100644
 
603
index 8b81201..a67eb32 100644
596
604
--- a/util.h
597
605
+++ b/util.h
598
 
@@ -37,7 +37,8 @@ char *check_command_line( char *cl, ShellOptions_t *opts );
 
606
@@ -38,7 +38,8 @@ char *get_command( char *cl, ShellOptions_t *opts);
599
607
 char *extract_root( char *root, char *path );
600
608
 int  validate_umask( const char *temp, int *mask );
601
609
 int validate_access( const char *temp, bool *allow_sftp, bool *allow_scp,
606
614
 char *get_username( void );
607
615
 
608
616
-- 
609
 
tg: (8ab2298..) features/subversion (depends on: fixes/info-to-debug fixes/rsync-protocol)
 
617
tg: (7579edb..) features/subversion (depends on: fixes/info-to-debug fixes/rsync-protocol fixes/command-line-checking)