Ignore:
Timestamp:
Jun 29, 2011, 7:36:41 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.6

Location:
vendor/current/source3/smbd
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/smbd/fileio.c

    r414 r587  
    313313
    314314                if (SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st) == 0) {
    315                         int dosmode;
    316315                        trigger_write_time_update(fsp);
    317                         dosmode = dos_mode(fsp->conn, fsp->fsp_name);
    318                         if ((lp_store_dos_attributes(SNUM(fsp->conn)) ||
    319                                         MAP_ARCHIVE(fsp->conn)) &&
    320                                         !IS_DOS_ARCHIVE(dosmode)) {
    321                                 file_set_dosmode(fsp->conn, fsp->fsp_name,
     316                        if (!fsp->posix_open &&
     317                                        (lp_store_dos_attributes(SNUM(fsp->conn)) ||
     318                                        MAP_ARCHIVE(fsp->conn))) {
     319                                int dosmode = dos_mode(fsp->conn, fsp->fsp_name);
     320                                if (!IS_DOS_ARCHIVE(dosmode)) {
     321                                        file_set_dosmode(fsp->conn, fsp->fsp_name,
    322322                                                 dosmode | aARCH, NULL, false);
     323                                }
    323324                        }
    324325
  • vendor/current/source3/smbd/notify.c

    r414 r587  
    7777                struct notify_change *c;
    7878                size_t namelen;
     79                int    rem = 0;
    7980                uint32 u32_tmp; /* Temp arg to prs_uint32 to avoid
    8081                                 * signed/unsigned issues */
     
    102103
    103104                u32_tmp = (i == num_changes-1) ? 0 : namelen + 12;
     105
     106                /* Align on 4-byte boundary according to MS-CIFS 2.2.7.4.2 */
     107                if ((rem = u32_tmp % 4 ) != 0)
     108                        u32_tmp += 4 - rem;
     109
    104110                if (!prs_uint32("offset", ps, 1, &u32_tmp)) goto fail;
    105111
     
    116122                 */
    117123                prs_set_offset(ps, prs_offset(ps)-2);
     124
     125                if (rem != 0) {
     126                        if (!prs_align_custom(ps, 4)) goto fail;
     127                }
    118128
    119129                TALLOC_FREE(uni_name.buffer);
  • vendor/current/source3/smbd/open.c

    r414 r587  
    5050****************************************************************************/
    5151
    52 NTSTATUS smb1_file_se_access_check(const struct security_descriptor *sd,
     52NTSTATUS smb1_file_se_access_check(connection_struct *conn,
     53                          const struct security_descriptor *sd,
    5354                          const NT_USER_TOKEN *token,
    5455                          uint32_t access_desired,
    5556                          uint32_t *access_granted)
    5657{
     58        *access_granted = 0;
     59
     60        if (conn->server_info->utok.uid == 0 || conn->admin_user) {
     61                /* I'm sorry sir, I didn't know you were root... */
     62                *access_granted = access_desired;
     63                if (access_desired & SEC_FLAG_MAXIMUM_ALLOWED) {
     64                        *access_granted |= FILE_GENERIC_ALL;
     65                }
     66                return NT_STATUS_OK;
     67        }
     68
    5769        return se_access_check(sd,
    5870                                token,
     
    7486        struct security_descriptor *sd = NULL;
    7587
    76         *access_granted = 0;
    77 
    78         if (conn->server_info->utok.uid == 0 || conn->admin_user) {
    79                 /* I'm sorry sir, I didn't know you were root... */
    80                 *access_granted = access_mask;
    81                 if (access_mask & SEC_FLAG_MAXIMUM_ALLOWED) {
    82                         *access_granted |= FILE_GENERIC_ALL;
    83                 }
    84                 return NT_STATUS_OK;
    85         }
    86 
    8788        status = SMB_VFS_GET_NT_ACL(conn, smb_fname->base_name,
    8889                        (OWNER_SECURITY_INFORMATION |
     
    9899        }
    99100
    100         status = smb1_file_se_access_check(sd,
     101        status = smb1_file_se_access_check(conn,
     102                                sd,
    101103                                conn->server_info->ptok,
    102104                                access_mask,
     
    14131415                        }
    14141416
    1415                         status = smb1_file_se_access_check(sd,
     1417                        status = smb1_file_se_access_check(conn,
     1418                                        sd,
    14161419                                        conn->server_info->ptok,
    14171420                                        access_mask,
  • vendor/current/source3/smbd/oplock.c

    r414 r587  
    119119
    120120        flush_write_cache(fsp, OPLOCK_RELEASE_FLUSH);
     121        delete_write_cache(fsp);
    121122
    122123        TALLOC_FREE(fsp->oplock_timeout);
  • vendor/current/source3/smbd/process.c

    r427 r587  
    14891489                 * NetBIOS session request, keepalive, etc.
    14901490                 */
    1491                 reply_special((char *)inbuf);
     1491                reply_special((char *)inbuf, nread);
    14921492                goto done;
    14931493        }
  • vendor/current/source3/smbd/reply.c

    r427 r587  
    496496****************************************************************************/
    497497
    498 void reply_special(char *inbuf)
     498void reply_special(char *inbuf, size_t inbuf_size)
    499499{
    500500        int msg_type = CVAL(inbuf,0);
    501501        int msg_flags = CVAL(inbuf,1);
    502         fstring name1,name2;
    503         char name_type1, name_type2;
    504502        struct smbd_server_connection *sconn = smbd_server_conn;
    505 
    506503        /*
    507504         * We only really use 4 bytes of the outbuf, but for the smb_setlen
     
    511508        char outbuf[smb_size];
    512509
    513         *name1 = *name2 = 0;
    514 
    515510        memset(outbuf, '\0', sizeof(outbuf));
    516511
     
    519514        switch (msg_type) {
    520515        case 0x81: /* session request */
     516        {
     517                /* inbuf_size is guarenteed to be at least 4. */
     518                fstring name1,name2;
     519                int name_type1, name_type2;
     520                int name_len1, name_len2;
     521
     522                *name1 = *name2 = 0;
    521523
    522524                if (sconn->nbt.got_session) {
     
    526528                SCVAL(outbuf,0,0x82);
    527529                SCVAL(outbuf,3,0);
    528                 if (name_len(inbuf+4) > 50 ||
    529                     name_len(inbuf+4 + name_len(inbuf + 4)) > 50) {
     530
     531                /* inbuf_size is guaranteed to be at least 4. */
     532                name_len1 = name_len((unsigned char *)(inbuf+4),inbuf_size - 4);
     533                if (name_len1 <= 0 || name_len1 > inbuf_size - 4) {
    530534                        DEBUG(0,("Invalid name length in session request\n"));
    531535                        return;
    532536                }
    533                 name_type1 = name_extract(inbuf,4,name1);
    534                 name_type2 = name_extract(inbuf,4 + name_len(inbuf + 4),name2);
     537                name_len2 = name_len((unsigned char *)(inbuf+4+name_len1),inbuf_size - 4 - name_len1);
     538                if (name_len2 <= 0 || name_len2 > inbuf_size - 4 - name_len1) {
     539                        DEBUG(0,("Invalid name length in session request\n"));
     540                        return;
     541                }
     542
     543                name_type1 = name_extract((unsigned char *)inbuf,
     544                                inbuf_size,(unsigned int)4,name1);
     545                name_type2 = name_extract((unsigned char *)inbuf,
     546                                inbuf_size,(unsigned int)(4 + name_len1),name2);
     547
     548                if (name_type1 == -1 || name_type2 == -1) {
     549                        DEBUG(0,("Invalid name type in session request\n"));
     550                        return;
     551                }
     552
    535553                DEBUG(2,("netbios connect: name1=%s0x%x name2=%s0x%x\n",
    536554                         name1, name_type1, name2, name_type2));
     
    566584                sconn->nbt.got_session = true;
    567585                break;
     586        }
    568587
    569588        case 0x89: /* session keepalive request
     
    58475866                          smb_fname_str_dbg(smb_fname_dst)));
    58485867
    5849                 if (lp_map_archive(SNUM(conn)) ||
    5850                     lp_store_dos_attributes(SNUM(conn))) {
     5868                if (!lp_posix_pathnames() &&
     5869                    (lp_map_archive(SNUM(conn)) ||
     5870                    lp_store_dos_attributes(SNUM(conn)))) {
    58515871                        /* We must set the archive bit on the newly
    58525872                           renamed file. */
  • vendor/current/source3/smbd/sesssetup.c

    r427 r587  
    726726
    727727        /* parse out the OIDs and the first sec blob */
    728         if (!parse_negTokenTarg(blob_in, OIDs, pblob_out)) {
     728        if (!parse_negTokenTarg(blob_in, OIDs, pblob_out) ||
     729                        OIDs[0] == NULL) {
    729730                return NT_STATUS_LOGON_FAILURE;
    730731        }
  • vendor/current/source3/smbd/trans2.c

    r478 r587  
    65956595        bool modify_mtime = true;
    65966596        struct file_id id;
     6597        struct smb_filename *smb_fname_tmp = NULL;
    65976598        SMB_STRUCT_STAT sbuf;
    65986599
     
    66476648
    66486649        if (!VALID_STAT(sbuf)) {
    6649                 struct smb_filename *smb_fname_tmp = NULL;
    66506650                /*
    66516651                 * The only valid use of this is to create character and block
     
    66766676
    66776677                sbuf = smb_fname_tmp->st;
    6678                 TALLOC_FREE(smb_fname_tmp);
     6678                smb_fname = smb_fname_tmp;
    66796679
    66806680                /* Ensure we don't try and change anything else. */
Note: See TracChangeset for help on using the changeset viewer.