OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   22-Jul-2004 10:40:46
  Branch: OPENPKG_2_1_SOLID                Handle: 2004072209404500

  Modified files:           (Branch: OPENPKG_2_1_SOLID)
    openpkg-src/samba       samba.patch samba.spec

  Log:
    apply security fix (OpenPKG-SA-2004-033-samba; CAN-2004-0600;
    CAN-2004-0686)

  Summary:
    Revision    Changes     Path
    1.3.2.2     +178 -0     openpkg-src/samba/samba.patch
    1.68.2.3    +1  -1      openpkg-src/samba/samba.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/samba/samba.patch
  ============================================================================
  $ cvs diff -u -r1.3.2.1 -r1.3.2.2 samba.patch
  --- openpkg-src/samba/samba.patch     5 Jul 2004 08:38:42 -0000       1.3.2.1
  +++ openpkg-src/samba/samba.patch     22 Jul 2004 08:40:45 -0000      1.3.2.2
  @@ -226,3 +226,181 @@
                return False;
        }
    
  +------------------------------------------------------------------------------
  +
  +Security Fixed
  +(OpenPKG-SA-2004-033-samba; CAN-2004-0600; CAN-2004-0686)
  +
  +Index: source/include/mangle.h
  +--- source/include/mangle.h.orig     2004-04-04 09:37:24 +0200
  ++++ source/include/mangle.h  2004-07-22 10:26:11 +0200
  +@@ -8,7 +8,7 @@
  +     BOOL (*is_mangled)(const char *s);
  +     BOOL (*is_8_3)(const char *fname, BOOL check_case, BOOL allow_wildcards);
  +     void (*reset)(void);
  +-    BOOL (*check_cache)(char *s);
  ++    BOOL (*check_cache)(char *s, size_t maxlen);
  +     void (*name_map)(char *OutName, BOOL need83, BOOL cache83);
  + };
  + #endif /* _MANGLE_H_ */
  +Index: source/lib/util_str.c
  +--- source/lib/util_str.c.orig       2004-04-20 22:42:55 +0200
  ++++ source/lib/util_str.c    2004-07-22 10:26:11 +0200
  +@@ -1951,7 +1951,9 @@
  +             s++; i++;
  +     }
  + 
  +-    if (*s == '=') n -= 1;
  ++    if ((n > 0) && (*s == '=')) {
  ++            n -= 1;
  ++    }
  + 
  +     /* fix up length */
  +     decoded.length = n;
  +@@ -1964,9 +1966,15 @@
  + void base64_decode_inplace(char *s)
  + {
  +     DATA_BLOB decoded = base64_decode_data_blob(s);
  +-    memcpy(s, decoded.data, decoded.length);
  +-    /* null terminate */
  +-    s[decoded.length] = '\0';
  ++
  ++    if ( decoded.length != 0 ) {
  ++            memcpy(s, decoded.data, decoded.length);
  ++
  ++            /* null terminate */
  ++            s[decoded.length] = '\0';
  ++    } else {
  ++            *s = '\0';
  ++    }
  + 
  +     data_blob_free(&decoded);
  + }
  +Index: source/smbd/filename.c
  +--- source/smbd/filename.c.orig      2004-04-04 09:37:31 +0200
  ++++ source/smbd/filename.c   2004-07-22 10:26:11 +0200
  +@@ -306,7 +306,7 @@
  +                              */
  + 
  +                             if (mangle_is_mangled(start)) {
  +-                                    mangle_check_cache( start );
  ++                                    mangle_check_cache( start, sizeof(pstring) - 1 
- (start - name) );
  +                             }
  + 
  +                             DEBUG(5,("New file %s\n",start));
  +@@ -455,7 +455,7 @@
  +      * (JRA).
  +      */
  +     if (mangled)
  +-            mangled = !mangle_check_cache( name );
  ++            mangled = !mangle_check_cache( name, maxlength );
  + 
  +     /* open the directory */
  +     if (!(cur_dir = OpenDir(conn, path, True))) {
  +Index: source/smbd/mangle.c
  +--- source/smbd/mangle.c.orig        2004-04-04 09:37:30 +0200
  ++++ source/smbd/mangle.c     2004-07-22 10:26:11 +0200
  +@@ -98,9 +98,9 @@
  +   looking for a matching name if it doesn't. It should succeed most of the time
  +   or there will be a huge performance penalty
  + */
  +-BOOL mangle_check_cache(char *s)
  ++BOOL mangle_check_cache(char *s, size_t maxlen)
  + {
  +-    return mangle_fns->check_cache(s);
  ++    return mangle_fns->check_cache(s, maxlen);
  + }
  + 
  + /* 
  +Index: source/smbd/mangle_hash.c
  +--- source/smbd/mangle_hash.c.orig   2004-04-04 09:37:29 +0200
  ++++ source/smbd/mangle_hash.c        2004-07-22 10:27:01 +0200
  +@@ -580,7 +580,7 @@
  +  * ************************************************************************** **
  +  */
  + 
  +-static BOOL check_cache( char *s )
  ++static BOOL check_cache( char *s, size_t maxlen )
  + {
  +     ubi_cacheEntryPtr FoundPtr;
  +     char             *ext_start = NULL;
  +@@ -614,7 +614,7 @@
  +     if( !FoundPtr ) {
  +             if(saved_ext) {
  +                     /* Replace the saved_ext as it was truncated. */
  +-                    (void)pstrcat( s, saved_ext );
  ++                    (void)safe_strcat( s, saved_ext, maxlen );
  +                     SAFE_FREE(saved_ext);
  +             }
  +             return( False );
  +@@ -624,10 +624,10 @@
  +     found_name = (char *)(FoundPtr + 1);
  +     found_name += (strlen( found_name ) + 1);
  + 
  +-    (void)pstrcpy( s, found_name );
  ++    (void)safe_strcpy( s, found_name, maxlen );
  +     if( saved_ext ) {
  +             /* Replace the saved_ext as it was truncated. */
  +-            (void)pstrcat( s, saved_ext );
  ++            (void)safe_strcat( s, saved_ext, maxlen );
  +             SAFE_FREE(saved_ext);
  +     }
  + 
  +Index: source/smbd/mangle_hash2.c
  +--- source/smbd/mangle_hash2.c.orig  2004-04-04 09:37:30 +0200
  ++++ source/smbd/mangle_hash2.c       2004-07-22 10:26:11 +0200
  +@@ -362,10 +362,8 @@
  + /*
  +   try to find a 8.3 name in the cache, and if found then
  +   replace the string with the original long name. 
  +-
  +-  The filename must be able to hold at least sizeof(fstring) 
  + */
  +-static BOOL check_cache(char *name)
  ++static BOOL check_cache(char *name, size_t maxlen)
  + {
  +     u32 hash, multiplier;
  +     unsigned int i;
  +@@ -403,10 +401,10 @@
  + 
  +     if (extension[0]) {
  +             M_DEBUG(10,("check_cache: %s -> %s.%s\n", name, prefix, extension));
  +-            slprintf(name, sizeof(fstring), "%s.%s", prefix, extension);
  ++            slprintf(name, maxlen, "%s.%s", prefix, extension);
  +     } else {
  +             M_DEBUG(10,("check_cache: %s -> %s\n", name, prefix));
  +-            fstrcpy(name, prefix);
  ++            safe_strcpy(name, prefix, maxlen);
  +     }
  + 
  +     return True;
  +Index: source/smbd/reply.c
  +--- source/smbd/reply.c.orig 2004-04-04 09:37:30 +0200
  ++++ source/smbd/reply.c      2004-07-22 10:26:11 +0200
  +@@ -1524,7 +1524,7 @@
  +      */
  +     
  +     if (!rc && mangle_is_mangled(mask))
  +-            mangle_check_cache( mask );
  ++            mangle_check_cache( mask, sizeof(pstring)-1 );
  +     
  +     if (!has_wild) {
  +             pstrcat(directory,"/");
  +@@ -3664,7 +3664,7 @@
  +      */
  + 
  +     if (!rc && mangle_is_mangled(mask))
  +-            mangle_check_cache( mask );
  ++            mangle_check_cache( mask, sizeof(pstring)-1 );
  + 
  +     has_wild = ms_has_wild(mask);
  + 
  +@@ -4136,7 +4136,7 @@
  +      */
  + 
  +     if (!rc && mangle_is_mangled(mask))
  +-            mangle_check_cache( mask );
  ++            mangle_check_cache( mask, sizeof(pstring)-1 );
  + 
  +     has_wild = ms_has_wild(mask);
  + 
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/samba/samba.spec
  ============================================================================
  $ cvs diff -u -r1.68.2.2 -r1.68.2.3 samba.spec
  --- openpkg-src/samba/samba.spec      5 Jul 2004 08:38:43 -0000       1.68.2.2
  +++ openpkg-src/samba/samba.spec      22 Jul 2004 08:40:45 -0000      1.68.2.3
  @@ -34,7 +34,7 @@
   Group:        Filesystem
   License:      GPL
   Version:      3.0.4
  -Release:      2.1.0
  +Release:      2.1.1
   
   #   package options
   %option       with_pam  no
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to