Ignore:
Timestamp:
Jul 1, 2011, 4:02:23 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.8

Location:
vendor/current/source3/modules
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/modules/onefs_open.c

    r414 r594  
    20952095        /* Get the file name if root_dir_fid was specified. */
    20962096        if (root_dir_fid != 0) {
     2097                struct smb_filename *smb_fname_out = NULL;
    20972098                status = get_relative_fid_filename(conn, req, root_dir_fid,
    2098                                                    smb_fname);
     2099                                                   smb_fname, &smb_fname_out);
    20992100                if (!NT_STATUS_IS_OK(status)) {
    21002101                        goto fail;
    21012102                }
     2103                smb_fname = smb_fname_out;
    21022104        }
    21032105
  • vendor/current/source3/modules/vfs_acl_common.c

    r587 r594  
    255255        struct security_descriptor *psd = NULL;
    256256        struct security_descriptor *pdesc_next = NULL;
     257        bool ignore_file_system_acl = lp_parm_bool(SNUM(handle->conn),
     258                                                ACL_MODULE_NAME,
     259                                                "ignore system acls",
     260                                                false);
    257261
    258262        if (fsp && name == NULL) {
     
    318322        }
    319323
     324        if (ignore_file_system_acl) {
     325                goto out;
     326        }
    320327
    321328        status = hash_sd_sha256(pdesc_next, hash_tmp);
     
    328335        if (memcmp(&hash[0], &hash_tmp[0], XATTR_SD_HASH_SIZE) == 0) {
    329336                /* Hash matches, return blob sd. */
     337                DEBUG(10, ("get_nt_acl_internal: blob hash "
     338                        "matches for file %s\n",
     339                        name ));
    330340                goto out;
    331341        }
     
    351361                 */
    352362                if (fsp) {
    353                         is_directory = fsp->is_directory;
     363                        status = vfs_stat_fsp(fsp);
     364                        if (!NT_STATUS_IS_OK(status)) {
     365                                return status;
     366                        }
    354367                        psbuf = &fsp->fsp_name->st;
    355368                } else {
    356                         if (vfs_stat_smb_fname(handle->conn,
     369                        int ret = vfs_stat_smb_fname(handle->conn,
    357370                                                name,
    358                                                 &sbuf) == 0) {
    359                                 is_directory = S_ISDIR(sbuf.st_ex_mode);
     371                                                &sbuf);
     372                        if (ret == -1) {
     373                                return map_nt_error_from_unix(errno);
    360374                        }
    361375                }
    362                 if (is_directory &&
     376                is_directory = S_ISDIR(sbuf.st_ex_mode);
     377
     378                if (ignore_file_system_acl) {
     379                        TALLOC_FREE(pdesc_next);
     380                        status = make_default_filesystem_acl(talloc_tos(),
     381                                                name,
     382                                                psbuf,
     383                                                &psd);
     384                        if (!NT_STATUS_IS_OK(status)) {
     385                                return status;
     386                        }
     387                } else {
     388                        if (is_directory &&
    363389                                !sd_has_inheritable_components(psd,
    364390                                                        true)) {
    365                         add_directory_inheritable_components(handle,
     391                                add_directory_inheritable_components(handle,
    366392                                                        name,
    367393                                                        psbuf,
    368394                                                        psd);
     395                        }
     396                        /* The underlying POSIX module always sets
     397                           the ~SEC_DESC_DACL_PROTECTED bit, as ACLs
     398                           can't be inherited in this way under POSIX.
     399                           Remove it for Windows-style ACLs. */
     400                        psd->type &= ~SEC_DESC_DACL_PROTECTED;
    369401                }
    370402        }
     
    385417        TALLOC_FREE(blob.data);
    386418        *ppdesc = psd;
     419
     420        if (DEBUGLEVEL >= 10) {
     421                DEBUG(10,("get_nt_acl_internal: returning acl for %s is:\n",
     422                        name ));
     423                NDR_PRINT_DEBUG(security_descriptor, psd);
     424        }
     425
    387426        return NT_STATUS_OK;
    388427}
     
    661700
    662701static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp,
    663         uint32_t security_info_sent, const struct security_descriptor *psd)
     702        uint32_t security_info_sent, const struct security_descriptor *orig_psd)
    664703{
    665704        NTSTATUS status;
    666705        DATA_BLOB blob;
    667706        struct security_descriptor *pdesc_next = NULL;
     707        struct security_descriptor *psd = NULL;
    668708        uint8_t hash[XATTR_SD_HASH_SIZE];
    669709
     
    672712                          fsp_str_dbg(fsp)));
    673713                NDR_PRINT_DEBUG(security_descriptor,
    674                         CONST_DISCARD(struct security_descriptor *,psd));
    675         }
    676 
    677         /* Ensure we have OWNER/GROUP/DACL set. */
    678 
    679         if ((security_info_sent & (OWNER_SECURITY_INFORMATION|
    680                                 GROUP_SECURITY_INFORMATION|
    681                                 DACL_SECURITY_INFORMATION)) !=
    682                                 (OWNER_SECURITY_INFORMATION|
    683                                  GROUP_SECURITY_INFORMATION|
    684                                  DACL_SECURITY_INFORMATION)) {
    685                 /* No we don't - read from the existing SD. */
    686                 struct security_descriptor *nc_psd = NULL;
    687 
    688                 status = get_nt_acl_internal(handle, fsp,
    689                                 NULL,
    690                                 (OWNER_SECURITY_INFORMATION|
    691                                  GROUP_SECURITY_INFORMATION|
    692                                  DACL_SECURITY_INFORMATION),
    693                                 &nc_psd);
    694 
    695                 if (!NT_STATUS_IS_OK(status)) {
    696                         return status;
    697                 }
    698 
    699                 /* This is safe as nc_psd is discarded at fn exit. */
    700                 if (security_info_sent & OWNER_SECURITY_INFORMATION) {
    701                         nc_psd->owner_sid = psd->owner_sid;
    702                 }
    703                 security_info_sent |= OWNER_SECURITY_INFORMATION;
    704 
    705                 if (security_info_sent & GROUP_SECURITY_INFORMATION) {
    706                         nc_psd->group_sid = psd->group_sid;
    707                 }
    708                 security_info_sent |= GROUP_SECURITY_INFORMATION;
    709 
    710                 if (security_info_sent & DACL_SECURITY_INFORMATION) {
    711                         nc_psd->dacl = dup_sec_acl(talloc_tos(), psd->dacl);
    712                         if (nc_psd->dacl == NULL) {
    713                                 return NT_STATUS_NO_MEMORY;
    714                         }
    715                 }
    716                 security_info_sent |= DACL_SECURITY_INFORMATION;
    717                 psd = nc_psd;
     714                        CONST_DISCARD(struct security_descriptor *,orig_psd));
     715        }
     716
     717        status = get_nt_acl_internal(handle, fsp,
     718                        NULL,
     719                        SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL,
     720                        &psd);
     721
     722        if (!NT_STATUS_IS_OK(status)) {
     723                return status;
     724        }
     725
     726        psd->revision = orig_psd->revision;
     727        /* All our SD's are self relative. */
     728        psd->type = orig_psd->type | SEC_DESC_SELF_RELATIVE;
     729
     730        if ((security_info_sent & SECINFO_OWNER) && (orig_psd->owner_sid != NULL)) {
     731                psd->owner_sid = orig_psd->owner_sid;
     732        }
     733        if ((security_info_sent & SECINFO_GROUP) && (orig_psd->group_sid != NULL)) {
     734                psd->group_sid = orig_psd->group_sid;
     735        }
     736        if (security_info_sent & SECINFO_DACL) {
     737                psd->dacl = orig_psd->dacl;
     738                psd->type |= SEC_DESC_DACL_PRESENT;
     739        }
     740        if (security_info_sent & SECINFO_SACL) {
     741                psd->sacl = orig_psd->sacl;
     742                psd->type |= SEC_DESC_SACL_PRESENT;
    718743        }
    719744
     
    902927                                        &info);
    903928
     929        if (!NT_STATUS_IS_OK(status)) {
     930                goto out;
     931        }
     932
    904933        if (info != FILE_WAS_CREATED) {
    905934                /* File/directory was opened, not created. */
     
    909938        fsp = *result;
    910939
    911         if (!NT_STATUS_IS_OK(status) || fsp == NULL) {
     940        if (fsp == NULL) {
    912941                /* Only handle success. */
    913942                goto out;
  • vendor/current/source3/modules/vfs_acl_tdb.c

    r427 r594  
    2929#define DBGC_CLASS DBGC_VFS
    3030
     31#define ACL_MODULE_NAME "acl_tdb"
    3132#include "modules/vfs_acl_common.c"
    3233
     
    315316        }
    316317
    317         /* Ensure we have "inherit acls = yes" if we're
     318        /* Ensure we have the parameters correct if we're
    318319         * using this module. */
    319320        DEBUG(2,("connect_acl_tdb: setting 'inherit acls = true' "
    320                 "and 'dos filemode = true' for service %s\n",
     321                "'dos filemode = true' and "
     322                "'force unknown acl user = true' for service %s\n",
    321323                service ));
     324
    322325        lp_do_parameter(SNUM(handle->conn), "inherit acls", "true");
    323326        lp_do_parameter(SNUM(handle->conn), "dos filemode", "true");
     327        lp_do_parameter(SNUM(handle->conn), "force unknown acl user", "true");
    324328
    325329        return 0;
  • vendor/current/source3/modules/vfs_acl_xattr.c

    r414 r594  
    3030
    3131/* Pull in the common functions. */
     32#define ACL_MODULE_NAME "acl_xattr"
     33
    3234#include "modules/vfs_acl_common.c"
    3335
     
    184186        }
    185187
    186         /* Ensure we have "inherit acls = yes" if we're
    187          * using this module. */
    188         DEBUG(2,("connect_acl_xattr: setting 'inherit acls = true' "
    189                 "and 'dos filemode = true' for service %s\n",
    190                 service ));
     188        /* Ensure we have the parameters correct if we're
     189         * using this module. */
     190        DEBUG(2,("connect_acl_xattr: setting 'inherit acls = true' "
     191                "'dos filemode = true' and "
     192                "'force unknown acl user = true' for service %s\n",
     193                service ));
    191194
    192195        lp_do_parameter(SNUM(handle->conn), "inherit acls", "true");
    193196        lp_do_parameter(SNUM(handle->conn), "dos filemode", "true");
     197        lp_do_parameter(SNUM(handle->conn), "force unknown acl user", "true");
    194198
    195199        return 0;
  • vendor/current/source3/modules/vfs_default.c

    r414 r594  
    218218            && parent_dirname(talloc_tos(), path, &parent, NULL)
    219219            && (has_dacl = directory_has_default_acl(handle->conn, parent)))
    220                 mode = 0777;
     220                mode = (0777 & lp_dir_mask(SNUM(handle->conn)));
    221221
    222222        TALLOC_FREE(parent);
     
    899899                result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0);
    900900        }
    901 #elif defined(HAVE_UTIMES)
     901        if (!((result == -1) && (errno == ENOSYS))) {
     902                goto out;
     903        }
     904#endif
     905#if defined(HAVE_UTIMES)
    902906        if (ft != NULL) {
    903907                struct timeval tv[2];
     
    908912                result = utimes(smb_fname->base_name, NULL);
    909913        }
    910 #elif defined(HAVE_UTIME)
     914        if (!((result == -1) && (errno == ENOSYS))) {
     915                goto out;
     916        }
     917#endif
     918#if defined(HAVE_UTIME)
    911919        if (ft != NULL) {
    912920                struct utimbuf times;
     
    917925                result = utime(smb_fname->base_name, NULL);
    918926        }
    919 #else
     927        if (!((result == -1) && (errno == ENOSYS))) {
     928                goto out;
     929        }
     930#endif
    920931        errno = ENOSYS;
    921932        result = -1;
    922 #endif
    923933
    924934 out:
  • vendor/current/source3/modules/vfs_gpfs.c

    r414 r594  
    940940                                GPFS_WINATTR_SET_ATTRS, &attrs);
    941941        if ( ret == -1){
     942                if (errno == ENOSYS) {
     943                        return SMB_VFS_NEXT_SETXATTR(handle, path, name, value,
     944                                                     size, flags);
     945                }
     946
    942947                DEBUG(1, ("gpfs_set_xattr:Set GPFS attributes failed %d\n",ret));
    943948                return -1;
     
    965970        ret = get_gpfs_winattrs(CONST_DISCARD(char *, path), &attrs);
    966971        if ( ret == -1){
     972                if (errno == ENOSYS) {
     973                        return SMB_VFS_NEXT_GETXATTR(handle, path, name, value,
     974                                                     size);
     975                }
     976
    967977                DEBUG(1, ("gpfs_get_xattr: Get GPFS attributes failed: %d\n",ret));
    968978                return -1;
     
    10961106        ret = set_gpfs_winattrs(CONST_DISCARD(char *, path),
    10971107                                GPFS_WINATTR_SET_CREATION_TIME, &attrs);
    1098         if(ret == -1){
     1108        if(ret == -1 && errno != ENOSYS){
    10991109                DEBUG(1,("vfs_gpfs_ntimes: set GPFS ntimes failed %d\n",ret));
    11001110                return -1;
  • vendor/current/source3/modules/vfs_scannedonly.c

    r478 r594  
    427427        }
    428428        if (retval == 0 && VALID_STAT(cache_smb_fname->st)) {
    429                 if (timespec_is_newer(&smb_fname->st.st_ex_mtime,
    430                                       &cache_smb_fname->st.st_ex_mtime)) {
     429                if (timespec_is_newer(&smb_fname->st.st_ex_ctime,
     430                                      &cache_smb_fname->st.st_ex_ctime)) {
    431431                        talloc_free(cache_smb_fname);
    432432                        return true;
     
    490490        /* still no cachefile, or still too old, return 0 */
    491491        if (retval != 0
    492             || !timespec_is_newer(&smb_fname->st.st_ex_mtime,
    493                                   &cache_smb_fname->st.st_ex_mtime)) {
     492            || !timespec_is_newer(&smb_fname->st.st_ex_ctime,
     493                                  &cache_smb_fname->st.st_ex_ctime)) {
    494494                DEBUG(SCANNEDONLY_DEBUG,
    495495                      ("retval=%d, return 0\n",retval));
Note: See TracChangeset for help on using the changeset viewer.