Ignore:
Timestamp:
Nov 12, 2012, 5:09:31 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.13

Location:
branches/samba-3.5.x/source3/smbd
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source3/smbd/file_access.c

    r620 r733  
    3838        if (conn->server_info->utok.uid == 0 || conn->admin_user) {
    3939                /* I'm sorry sir, I didn't know you were root... */
     40                return true;
     41        }
     42
     43        if (access_mask == DELETE_ACCESS &&
     44                        VALID_STAT(smb_fname->st) &&
     45                        S_ISLNK(smb_fname->st.st_ex_mode)) {
     46                /* We can always delete a symlink. */
    4047                return true;
    4148        }
     
    116123         * by owner of directory. */
    117124        if (smb_fname_parent->st.st_ex_mode & S_ISVTX) {
    118                 if(SMB_VFS_STAT(conn, smb_fname) != 0) {
    119                         if (errno == ENOENT) {
    120                                 /* If the file doesn't already exist then
    121                                  * yes we'll be able to delete it. */
    122                                 ret = true;
    123                                 goto out;
    124                         }
    125                         DEBUG(10,("can_delete_file_in_directory: can't "
    126                                   "stat file %s (%s)",
    127                                   smb_fname_str_dbg(smb_fname),
    128                                   strerror(errno) ));
    129                         ret = false;
     125                if (!VALID_STAT(smb_fname->st)) {
     126                        /* If the file doesn't already exist then
     127                         * yes we'll be able to delete it. */
     128                        ret = true;
    130129                        goto out;
    131130                }
  • branches/samba-3.5.x/source3/smbd/nttrans.c

    r732 r733  
    18841884        }
    18851885        if (!(security_info_wanted & SECINFO_DACL)) {
     1886                psd->type &= ~SEC_DESC_DACL_PRESENT;
    18861887                psd->dacl = NULL;
    18871888        }
    18881889        if (!(security_info_wanted & SECINFO_SACL)) {
     1890                psd->type &= ~SEC_DESC_SACL_PRESENT;
    18891891                psd->sacl = NULL;
    18901892        }
  • branches/samba-3.5.x/source3/smbd/open.c

    r732 r733  
    9494                        smb_fname_str_dbg(smb_fname),
    9595                        (unsigned int)*access_granted ));
     96                return NT_STATUS_OK;
     97        }
     98
     99        if (access_mask == DELETE_ACCESS &&
     100                        VALID_STAT(smb_fname->st) &&
     101                        S_ISLNK(smb_fname->st.st_ex_mode)) {
     102                /* We can always delete a symlink. */
     103                DEBUG(10,("smbd_check_open_rights: not checking ACL "
     104                        "on DELETE_ACCESS on symlink %s.\n",
     105                        smb_fname_str_dbg(smb_fname) ));
    96106                return NT_STATUS_OK;
    97107        }
     
    14321442        }
    14331443
    1434         status = check_name(conn, smb_fname->base_name);
    1435         if (!NT_STATUS_IS_OK(status)) {
    1436                 return status;
    1437         }
    1438 
    14391444        if (!posix_open) {
    14401445                new_dos_attributes &= SAMBA_ATTRIBUTES_MASK;
     
    33093314        }
    33103315
    3311         /* All file access must go through check_name() */
    3312 
    3313         status = check_name(conn, smb_fname->base_name);
    3314         if (!NT_STATUS_IS_OK(status)) {
    3315                 goto fail;
    3316         }
    3317 
    33183316        status = create_file_unixpath(
    33193317                conn, req, smb_fname, access_mask, share_access,
  • branches/samba-3.5.x/source3/smbd/posix_acls.c

    r732 r733  
    11241124****************************************************************************/
    11251125
    1126 #define FILE_SPECIFIC_READ_BITS (FILE_READ_DATA|FILE_READ_EA|FILE_READ_ATTRIBUTES)
    1127 #define FILE_SPECIFIC_WRITE_BITS (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_EA|FILE_WRITE_ATTRIBUTES)
     1126#define FILE_SPECIFIC_READ_BITS (FILE_READ_DATA|FILE_READ_EA)
     1127#define FILE_SPECIFIC_WRITE_BITS (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_EA)
    11281128#define FILE_SPECIFIC_EXECUTE_BITS (FILE_EXECUTE)
    11291129
  • branches/samba-3.5.x/source3/smbd/process.c

    r732 r733  
    12741274        /* Make sure this is an SMB packet. smb_size contains NetBIOS header
    12751275         * so subtract 4 from it. */
    1276         if (!valid_smb_header(req->inbuf)
    1277             || (size < (smb_size - 4))) {
     1276        if ((size < (smb_size - 4)) ||
     1277            !valid_smb_header(req->inbuf)) {
    12781278                DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",
    12791279                         smb_len(req->inbuf)));
  • branches/samba-3.5.x/source3/smbd/reply.c

    r732 r733  
    44304430        SSVAL(req->outbuf,smb_vwv4,nwritten>>16);
    44314431
    4432         if (nwritten < (ssize_t)numtowrite) {
    4433                 SCVAL(req->outbuf,smb_rcls,ERRHRD);
    4434                 SSVAL(req->outbuf,smb_err,ERRdiskfull);
    4435         }
    4436 
    44374432        DEBUG(3,("writeX fnum=%d num=%d wrote=%d\n",
    44384433                fsp->fnum, (int)numtowrite, (int)nwritten));
     
    62916286        struct smb_filename *smb_fname_src = NULL;
    62926287        struct smb_filename *smb_fname_dst = NULL;
     6288        uint32_t src_ucf_flags = lp_posix_pathnames() ? UCF_UNIX_NAME_LOOKUP : UCF_COND_ALLOW_WCARD_LCOMP;
     6289        uint32_t dst_ucf_flags = UCF_SAVE_LCOMP | (lp_posix_pathnames() ? 0 : UCF_COND_ALLOW_WCARD_LCOMP);
    62936290
    62946291        START_PROFILE(SMBmv);
     
    63206317                                  req->flags2 & FLAGS2_DFS_PATHNAMES,
    63216318                                  name,
    6322                                   UCF_COND_ALLOW_WCARD_LCOMP,
     6319                                  src_ucf_flags,
    63236320                                  &src_has_wcard,
    63246321                                  &smb_fname_src);
     
    63386335                                  req->flags2 & FLAGS2_DFS_PATHNAMES,
    63396336                                  newname,
    6340                                   UCF_COND_ALLOW_WCARD_LCOMP | UCF_SAVE_LCOMP,
     6337                                  dst_ucf_flags,
    63416338                                  &dest_has_wcard,
    63426339                                  &smb_fname_dst);
  • branches/samba-3.5.x/source3/smbd/trans2.c

    r732 r733  
    77367736        } else {
    77377737                char *fname = NULL;
     7738                uint32_t ucf_flags = 0;
    77387739
    77397740                /* set path info */
     
    77527753                }
    77537754
     7755                if (info_level == SMB_SET_FILE_UNIX_BASIC ||
     7756                                info_level == SMB_SET_FILE_UNIX_INFO2 ||
     7757                                info_level == SMB_FILE_RENAME_INFORMATION ||
     7758                                info_level == SMB_POSIX_PATH_UNLINK) {
     7759                        ucf_flags |= UCF_UNIX_NAME_LOOKUP;
     7760                }
     7761
    77547762                status = filename_convert(req, conn,
    77557763                                         req->flags2 & FLAGS2_DFS_PATHNAMES,
    77567764                                         fname,
    7757                                          0,
     7765                                         ucf_flags,
    77587766                                         NULL,
    77597767                                         &smb_fname);
Note: See TracChangeset for help on using the changeset viewer.