Changeset 102

Show
Ignore:
Timestamp:
11/18/07 20:35:45 (13 months ago)
Author:
psmedley
Message:

Update to 3.0.27

Location:
trunk-3.0/source
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk-3.0/source/VERSION

    r71 r102  
    2626SAMBA_VERSION_MAJOR=3 
    2727SAMBA_VERSION_MINOR=0 
    28 SAMBA_VERSION_RELEASE=26 
     28SAMBA_VERSION_RELEASE=27 
    2929 
    3030######################################################## 
     
    3737#  ->  "2.2.8a"                                        # 
    3838######################################################## 
    39 SAMBA_VERSION_REVISION=a 
     39SAMBA_VERSION_REVISION= 
    4040 
    4141######################################################## 
  • trunk-3.0/source/include/version.h

    r71 r102  
    22#define SAMBA_VERSION_MAJOR 3 
    33#define SAMBA_VERSION_MINOR 0 
    4 #define SAMBA_VERSION_RELEASE 26 
    5 #define SAMBA_VERSION_REVISION "a" 
    6 #define SAMBA_VERSION_OFFICIAL_STRING "3.0.26a" 
     4#define SAMBA_VERSION_RELEASE 27 
     5#define SAMBA_VERSION_OFFICIAL_STRING "3.0.27" 
    76#define SAMBA_VERSION_STRING samba_version_string() 
  • trunk-3.0/source/lib/charcnv.c

    r63 r102  
    873873    pstring tmpbuf; 
    874874 
    875     /* treat a pstring as "unlimited" length */ 
    876     if (dest_len == (size_t)-1) 
    877         dest_len = sizeof(pstring); 
     875        /* No longer allow a length of -1 */ 
     876            if (dest_len == (size_t)-1) 
     877                smb_panic("push_ascii - dest_len == -1"); 
    878878 
    879879    if (flags & STR_UPPER) { 
  • trunk-3.0/source/libsmb/ntlmssp_parse.c

    r1 r102  
    153153                case 'C': 
    154154                        s = va_arg(ap, char *); 
    155                         head_ofs += push_string(NULL, blob->data+head_ofs, s, -1,  
     155                        n = str_charnum(s) + 1; 
     156                        head_ofs += push_string(NULL, blob->data+head_ofs, s, n, 
    156157                                                STR_ASCII|STR_TERMINATE); 
    157158                        break; 
  • trunk-3.0/source/nmbd/nmbd_packets.c

    r26 r102  
    964964   
    965965        if (data && len) { 
     966                if (len < 0 || len > sizeof(nmb->answers->rdata)) { 
     967                        DEBUG(5,("reply_netbios_packet: " 
     968                                "invalid packet len (%d)\n", 
     969                                len )); 
     970                        return; 
     971                } 
    966972                nmb->answers->rdlength = len; 
    967973                memcpy(nmb->answers->rdata, data, len); 
  • trunk-3.0/source/nmbd/nmbd_processlogon.c

    r26 r102  
    136136                                fstrcpy(reply_name, "\\\\"); 
    137137                                fstrcat(reply_name, my_name); 
    138                                 push_ascii_fstring(q, reply_name); 
     138                                push_ascii(q,reply_name, 
     139                                                sizeof(outbuf)-PTR_DIFF(q, outbuf), 
     140                                                STR_TERMINATE); 
    139141                                q = skip_string(outbuf,sizeof(outbuf),q); /* PDC name */ 
    140142 
     
    232234 
    233235                                fstrcpy(reply_name,my_name); 
    234                                 push_ascii_fstring(q, reply_name); 
     236                                push_ascii(q, reply_name, 
     237                                                sizeof(outbuf)-PTR_DIFF(q, outbuf), 
     238                                                STR_TERMINATE); 
    235239                                q = skip_string(outbuf,sizeof(outbuf),q); /* PDC name */ 
    236240 
     
    240244                                        q = ALIGN2(q, outbuf); 
    241245 
    242                                         q += dos_PutUniCode(q, my_name, sizeof(pstring), True); /* PDC name */ 
    243                                         q += dos_PutUniCode(q, lp_workgroup(),sizeof(pstring), True); /* Domain name*/ 
     246                                        q += dos_PutUniCode(q, my_name, 
     247                                                sizeof(outbuf) - PTR_DIFF(q, outbuf), 
     248                                                True); /* PDC name */ 
     249                                        q += dos_PutUniCode(q, lp_workgroup(), 
     250                                                sizeof(outbuf) - PTR_DIFF(q, outbuf), 
     251                                                True); /* Domain name*/ 
     252                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 8) { 
     253                                                return; 
     254                                        } 
    244255                                        SIVAL(q, 0, 1); /* our nt version */ 
    245256                                        SSVAL(q, 4, 0xffff); /* our lmnttoken */ 
     
    377388                                        q += 2; 
    378389 
    379                                         q += dos_PutUniCode(q, reply_name,sizeof(pstring), True); 
    380                                         q += dos_PutUniCode(q, ascuser, sizeof(pstring), True); 
    381                                         q += dos_PutUniCode(q, lp_workgroup(),sizeof(pstring), True); 
     390                                        q += dos_PutUniCode(q, reply_name, 
     391                                                sizeof(outbuf) - PTR_DIFF(q, outbuf), 
     392                                                True); 
     393                                        q += dos_PutUniCode(q, ascuser, 
     394                                                sizeof(outbuf) - PTR_DIFF(q, outbuf), 
     395                                                True); 
     396                                        q += dos_PutUniCode(q, lp_workgroup(), 
     397                                                sizeof(outbuf) - PTR_DIFF(q, outbuf), 
     398                                                True); 
    382399                                } 
    383400#ifdef HAVE_ADS 
     
    395412                                        get_myname(hostname); 
    396413         
     414                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 8) { 
     415                                                return; 
     416                                        } 
    397417                                        if (SVAL(uniuser, 0) == 0) { 
    398418                                                SIVAL(q, 0, SAMLOGON_AD_UNK_R); /* user unknown */ 
     
    407427 
    408428                                        /* Push Domain GUID */ 
     429                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < UUID_FLAT_SIZE) { 
     430                                                return; 
     431                                        } 
    409432                                        if (False == secrets_fetch_domain_guid(domain, &domain_guid)) { 
    410433                                                DEBUG(2, ("Could not fetch DomainGUID for %s\n", domain)); 
     
    422445                                        while ((component = strtok(dc, "."))) { 
    423446                                                dc = NULL; 
    424                                                 size = push_ascii(&q[1], component, -1, 0); 
     447                                                if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 1) { 
     448                                                        return; 
     449                                                } 
     450                                                size = push_ascii(&q[1], component, 
     451                                                        sizeof(outbuf) - PTR_DIFF(q+1, outbuf), 
     452                                                        0); 
    425453                                                SCVAL(q, 0, size); 
    426454                                                q += (size + 1); 
     
    428456 
    429457                                        /* Unk0 */ 
     458                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 4) { 
     459                                                return; 
     460                                        } 
    430461                                        SCVAL(q, 0, 0); 
    431462                                        q++; 
     
    437468 
    438469                                        /* Hostname */ 
    439                                         size = push_ascii(&q[1], hostname, -1, 0); 
     470                                        size = push_ascii(&q[1], hostname, 
     471                                                        sizeof(outbuf) - PTR_DIFF(q+1, outbuf), 
     472                                                        0); 
    440473                                        SCVAL(q, 0, size); 
    441474                                        q += (size + 1); 
     475 
     476                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 3) { 
     477                                                return; 
     478                                        } 
     479 
    442480                                        SCVAL(q, 0, 0xc0 | ((str_offset >> 8) & 0x3F)); 
    443481                                        SCVAL(q, 1, str_offset & 0xFF); 
     
    445483 
    446484                                        /* NETBIOS of domain */ 
    447                                         size = push_ascii(&q[1], lp_workgroup(), -1, STR_UPPER); 
     485                                        size = push_ascii(&q[1], lp_workgroup(), 
     486                                                        sizeof(outbuf) - PTR_DIFF(q+1, outbuf), 
     487                                                        STR_UPPER); 
    448488                                        SCVAL(q, 0, size); 
    449489                                        q += (size + 1); 
    450490 
    451491                                        /* Unk1 */ 
     492                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 2) { 
     493                                                return; 
     494                                        } 
    452495                                        SCVAL(q, 0, 0); 
    453496                                        q++; 
    454497 
    455498                                        /* NETBIOS of hostname */ 
    456                                         size = push_ascii(&q[1], my_name, -1, 0); 
     499                                        size = push_ascii(&q[1], my_name, 
     500                                                        sizeof(outbuf) - PTR_DIFF(q+1, outbuf), 
     501                                                        0); 
    457502                                        SCVAL(q, 0, size); 
    458503                                        q += (size + 1); 
    459504 
    460505                                        /* Unk2 */ 
     506                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 4) { 
     507                                                return; 
     508                                        } 
    461509                                        SCVAL(q, 0, 0); 
    462510                                        q++; 
     
    464512                                        /* User name */ 
    465513                                        if (SVAL(uniuser, 0) != 0) { 
    466                                                 size = push_ascii(&q[1], ascuser, -1, 0); 
     514                                                size = push_ascii(&q[1], ascuser, 
     515                                                        sizeof(outbuf) - PTR_DIFF(q+1, outbuf), 
     516                                                        0); 
    467517                                                SCVAL(q, 0, size); 
    468518                                                q += (size + 1); 
     
    471521                                        q_orig = q; 
    472522                                        /* Site name */ 
    473                                         size = push_ascii(&q[1], "Default-First-Site-Name", -1, 0); 
     523                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 1) { 
     524                                                return; 
     525                                        } 
     526                                        size = push_ascii(&q[1], "Default-First-Site-Name", 
     527                                                        sizeof(outbuf) - PTR_DIFF(q+1, outbuf), 
     528                                                        0); 
    474529                                        SCVAL(q, 0, size); 
    475530                                        q += (size + 1); 
     531 
     532                                        if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 18) { 
     533                                                return; 
     534                                        } 
    476535 
    477536                                        /* Site name (2) */ 
     
    495554#endif 
    496555 
     556                                if (sizeof(outbuf) - PTR_DIFF(q, outbuf) < 8) { 
     557                                        return; 
     558                                } 
     559 
    497560                                /* tell the client what version we are */ 
    498561                                SIVAL(q, 0, ((ntversion < 11) || (SEC_ADS != lp_security())) ? 1 : 13);  
  • trunk-3.0/source/smbd/lanman.c

    r39 r102  
    405405        SIVAL(drivdata,4,1000); /* lVersion */ 
    406406        memset(drivdata+8,0,32);        /* szDeviceName */ 
    407         push_ascii(drivdata+8,"NULL",-1, STR_TERMINATE); 
     407        push_ascii(drivdata+8,"NULL",32, STR_TERMINATE); 
    408408        PACKl(desc,"l",drivdata,sizeof drivdata); /* pDriverData */ 
    409409}