Changeset 693 for branches


Ignore:
Timestamp:
Mar 11, 2012, 6:19:02 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.0 with CVE-2012-0870 security patch

Location:
branches/samba-3.0/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/build.cmd

    r459 r693  
    11/* Samba build script for eCS (OS/2) */
     2
     3
     4
     5
     6
     7
     8
     9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
    223
    324'@echo off'
    425parse upper arg cmdline
    526
     27
     28
    629/* No parameter or HELP -> display usage */
    730if pos("HELP", cmdline) > 0 | cmdline = "" then do
    8     say "Samba for eCS (OS/2) build script"
    931    say
    1032    say "Valid commands are:"
    1133    say "      HELP  - this page"
    12     say "      063   - link against libc063.dll"
    13     say "      064x  - link against libc064x.dll"
    1434    say "      CONF  - run configure"
    1535    say "      CLEAN - clean up and recompile everything"
     
    2040    say "      ZIP   - create ZIP archive"
    2141    say "      ALL   - do just everything"
     42
     43
     44
     45
    2246    say
    2347    exit 255
     
    3054
    3155options = 'build.options'
     56
    3257
    3358/* defaults */
    3459make  = ""
    35 libc  = "064x"
    3660brand = "No"
    3761conf  = ""
     
    5276build_parms = ""
    5377
     78
     79
     80
     81
     82
     83
     84
     85
    5486if pos("MAKE", cmdline) > 0 then do
    5587    make = "MAKE"
     
    6193    build_parms = build_parms||' 'make
    6294end
    63 if pos("064X", cmdline) > 0 then do
    64     libc = "064X"
    65     build_parms = build_parms||' 'libc   
    66 end
    67 if pos("063", cmdline) > 0 then do
    68     libc = "063"
    69     build_parms = build_parms||' 'libc   
    70 end
     95
    7196if pos("BRAND", cmdline) > 0 then do
    7297    Brand = "YES"
     
    78103end
    79104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
    80115/* start working */
    81 if libc = "063" then do
    82     address cmd "call 063.cmd"
    83 end
    84 else do
    85     address cmd "call 064x.cmd"
    86 end
    87 
    88116if conf = "YES" then do
    89         address cmd 'SETLOCAL'
    90         address cmd 'SET CFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4'
    91         address cmd 'SET CXXFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4'
    92         address cmd 'SET LDFLAGS=-s -Zsym -Zmap -Zbin-files -Zomf -Zexe -Zargs-wild -Zargs-resp'
    93         address cmd 'SET AR=emxomfar'
    94         address cmd 'SET LIBS=-lsocket -lsyslog'
     117address cmd 'SETLOCAL'
     118address cmd 'SET CFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4'
     119address cmd 'SET CXXFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4'
     120address cmd 'SET LDFLAGS=-s -Zsym -Zmap -Zbin-files -Zomf -Zexe -Zargs-wild -Zargs-resp'
     121address cmd 'SET AR=emxomfar'
     122    address cmd 'SET LIBS=-lsocket -lsyslog' */
    95123    /* disabled options:
    96         --enable-developer --enable-socket-wrapper
     124    --enable-developer --enable-socket-wrapper
    97125     */
    98     address cmd 'ksh ./configure --enable-pie=no --prefix=/samba --enable-static --disable-shared --disable-cups --disable-ldap --with-acl-support 2>&1 | tee configure.log'
    99         address cmd 'ENDLOCAL'
     126
     127/* we need to delete the cache file and redo it afterwards */
     128    ok = SysFileDelete(cacheFile);
     129
     130/* is cups env set */
     131    sEnvVar = EnvGet('CUPS');
     132    if sEnvVar <> '' then do
     133        call lineout cacheFile, "ac_cv_path_CUPS_CONFIG='" || sEnvVar || "'";
     134    end
     135
     136/* is python env set */
     137    sEnvVar = EnvGet('PYTHONHOME');
     138    if sEnvVar <> '' then do
     139        sPythonVersion = PythonVersion(sEnvVar);
     140        if sPythonVersion <> '-1' then do
     141            call lineout cacheFile, "ac_cv_path_PYTHON_CONFIG='" || sEnvVar || "/config/" || sPythonVersion || "'";
     142            call lineout cacheFile, "ac_cv_path_PYTHON='" || sEnvVar || "'";
     143        end
     144    end
     145
     146    ok = stream(cacheFile, 'c', 'close');
     147
     148/* run configure */
     149    address cmd 'ksh ./configure --enable-pie=no --prefix=/samba --disable-shared --with-acl-support --cache-file=build.cache 2>&1 | tee configure.log'
     150    address cmd 'ENDLOCAL'
    100151end
    101152
     
    103154    address cmd "make clean"
    104155end
    105            
     156
    106157if brand = "YES" then do
    107158    svninfo = ".\svninfo"
     
    115166    say build_parms
    116167    address cmd 'make 2>&1 | tee build.log'
    117 end   
     168end
    118169
    119170if pos("ZIP", cmdline) > 0 then do
     
    143194    VerFile = "VERSION.ECS"
    144195
     196
     197
     198
     199
     200
     201
     202
    145203    /* Samba Version file */
    146204    Version = "VERSION"
     
    153211        eCSVer.I = linein(VerFile)
    154212        if left(eCSVer.I,28) = "SAMBA_VERSION_VENDOR_SUFFIX=" then do
    155                     parse var eCSver.I . '='vendor_suffix
    156                     vendor_suffix = strip(vendor_suffix,,'"')
    157                     parse var vendor_suffix vendor suffix
     213    parse var eCSver.I . '='vendor_suffix
     214    vendor_suffix = strip(vendor_suffix,,'"')
     215    parse var vendor_suffix vendor suffix
    158216        end
    159217    end
     
    193251    verstring = suffix'-'Major'.'minor'.'release'.'revision'-'vendor'-'date('S')
    194252    say "Samba "verstring
    195 return
     253return
     254
     255
     256/**
     257 * Gets the value of sEnvVar.
     258 */
     259EnvGet: procedure
     260    parse arg sEnvVar
     261    if ((translate(sEnvVar) = 'BEGINLIBPATH') | (translate(sEnvVar) = 'ENDLIBPATH')) then
     262        return SysQueryExtLibPath(substr(sEnvVar, 1, 1));
     263return value(sEnvVar,, 'OS2ENVIRONMENT');
     264
     265/**
     266 * try to find the pythonversion
     267 */
     268PythonVersion: procedure
     269    parse arg pdir
     270
     271    ok = SysFileTree(pdir||"\python*.dll",pydll.,"FO")
     272    rc = -1
     273    if pydll.0 = 1 then do
     274        dllpur = filespec("N",pydll.1)
     275        parse var dllpur 'python' ver '.dll'
     276        if datatype(ver) <> "NUM" then do
     277            say "no valid python dll found!"
     278        end
     279        else do
     280            major = left(ver,1)
     281            minor = substr(ver,2,)
     282            verstring = "python"||major||"."||minor
     283            rc = verstring
     284        end
     285    end
     286    else do
     287        say "no dll found!"
     288    end
     289return rc
  • branches/samba-3.0/source/smbd/process.c

    r468 r693  
    10261026        int msg_type = CVAL(inbuf,0);
    10271027        uint16_t mid = SVAL(inbuf, smb_mid);
     1028
    10281029
    10291030        chain_size = 0;
     
    10331034        if (msg_type != 0)
    10341035                return(reply_special(inbuf,outbuf)); 
     1036
     1037
     1038
     1039
     1040
     1041
     1042
     1043
     1044
     1045
     1046
     1047
     1048
     1049
     1050
     1051
     1052
    10351053
    10361054        construct_reply_common(inbuf, outbuf);
     
    11621180        static int orig_size;
    11631181        int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0);
    1164         unsigned smb_off2 = SVAL(inbuf,smb_vwv1);
     1182        ;
    11651183        char *inbuf2, *outbuf2;
    11661184        int outsize2;
     
    11811199                orig_outbuf = outbuf;
    11821200                orig_size = size;
    1183         }
     1201                smb_off2 = 0;
     1202        }
     1203
     1204        if (SVAL(inbuf,smb_vwv1) <= smb_off2) {
     1205                DEBUG(1, ("AndX offset not increasing\n"));
     1206                SCVAL(outbuf, smb_vwv0, 0xFF);
     1207                return outsize;
     1208        }
     1209        smb_off2 = SVAL(inbuf, smb_vwv1);
    11841210
    11851211        /* Validate smb_off2 */
Note: See TracChangeset for help on using the changeset viewer.