Ignore:
Timestamp:
Jun 9, 2016, 2:17:22 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: apply latest security patches to vendor

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

Legend:

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

    r860 r919  
    2424#include "../libcli/security/security.h"
    2525#include "../librpc/gen_ndr/ndr_security.h"
     26#include "../lib/util/bitmap.h"
    2627
    2728static NTSTATUS create_acl_blob(const struct security_descriptor *psd,
  • vendor/current/source3/modules/vfs_full_audit.c

    r917 r919  
    6565#include "auth.h"
    6666#include "ntioctl.h"
     67#include "lib/util/bitmap.h"
    6768
    6869static int vfs_full_audit_debug_level = DBGC_VFS;
  • vendor/current/source3/modules/vfs_shadow_copy2.c

    r917 r919  
    2222#include "includes.h"
    2323#include "smbd/smbd.h"
     24#include "smbd/globals.h"
     25#include "../libcli/security/security.h"
    2426#include "system/filesys.h"
    2527#include "ntioctl.h"
     
    765767}
    766768
     769static bool check_access_snapdir(struct vfs_handle_struct *handle,
     770                                const char *path)
     771{
     772        struct smb_filename smb_fname;
     773        int ret;
     774        NTSTATUS status;
     775        uint32_t access_granted = 0;
     776
     777        ZERO_STRUCT(smb_fname);
     778        smb_fname.base_name = talloc_asprintf(talloc_tos(),
     779                                                "%s",
     780                                                path);
     781        if (smb_fname.base_name == NULL) {
     782                return false;
     783        }
     784
     785        ret = SMB_VFS_NEXT_STAT(handle, &smb_fname);
     786        if (ret != 0 || !S_ISDIR(smb_fname.st.st_ex_mode)) {
     787                TALLOC_FREE(smb_fname.base_name);
     788                return false;
     789        }
     790
     791        status = smbd_check_open_rights(handle->conn,
     792                                        &smb_fname,
     793                                        SEC_DIR_LIST,
     794                                        &access_granted);
     795        if (!NT_STATUS_IS_OK(status)) {
     796                DEBUG(0,("user does not have list permission "
     797                        "on snapdir %s\n",
     798                        smb_fname.base_name));
     799                TALLOC_FREE(smb_fname.base_name);
     800                return false;
     801        }
     802        TALLOC_FREE(smb_fname.base_name);
     803        return true;
     804}
     805
    767806static int shadow_copy2_rmdir(vfs_handle_struct *handle,  const char *fname)
    768807{
     
    878917        TALLOC_CTX *tmp_ctx = talloc_new(handle->data);
    879918        char *snapshot;
     919        bool ret;
    880920
    881921        snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle);
     
    884924                         handle->conn->connectpath));
    885925                errno = EINVAL;
     926                talloc_free(tmp_ctx);
     927                return -1;
     928        }
     929        ret = check_access_snapdir(handle, snapdir);
     930        if (!ret) {
     931                DEBUG(0,("access denied on listing snapdir %s\n", snapdir));
     932                errno = EACCES;
    886933                talloc_free(tmp_ctx);
    887934                return -1;
Note: See TracChangeset for help on using the changeset viewer.