core/win32/os.c
/* opens the cache\ directory that should be modifed only by trusted users */
/* and is used by both ASLR and persistent cache trusted producers */
opens the cache\ directory that should be modifed only by trusted users
and is used by both ASLR and persistent cache trusted producers
opens the cache \ directory that should be modifed only by trusted users and is used by both ASLR and persistent cache trusted producers
HANDLE
open_trusted_cache_root_directory(void)
{
    char base_directory[MAXIMUM_PATH];
    wchar_t wbuf[MAXIMUM_PATH];
    HANDLE directory_handle;
    int retval;
    retval = get_parameter(PARAM_STR(DYNAMORIO_VAR_CACHE_ROOT),
                           base_directory, sizeof(base_directory));
    if (IS_GET_PARAMETER_FAILURE(retval) || 
        (strchr(base_directory, DIRSEP) == NULL &&
         strchr(base_directory, ALT_DIRSEP) == NULL)) {
        SYSLOG_INTERNAL_WARNING("%s not set!", DYNAMORIO_VAR_CACHE_ROOT);
        return INVALID_HANDLE_VALUE;
    }
    NULL_TERMINATE_BUFFER(base_directory);
    if (!convert_to_NT_file_path(wbuf, base_directory, BUFFER_SIZE_ELEMENTS(wbuf)))
        return INVALID_HANDLE_VALUE;
    directory_handle = create_file(wbuf, true , 
                                   READ_CONTROL ,
                                   FILE_SHARE_READ
                                   | FILE_SHARE_WRITE,
                                   FILE_OPEN, true);
    if (directory_handle == INVALID_HANDLE_VALUE) {
        SYSLOG_INTERNAL_ERROR("%s=%s is invalid!",
                              DYNAMORIO_VAR_CACHE_ROOT, base_directory);
    }
    return directory_handle;
}
HANDLE open_trusted_cache_root_directory ( void ) { char base_directory [ MAXIMUM_PATH ] ; wchar_t wbuf [ MAXIMUM_PATH ] ; HANDLE directory_handle ; int retval ; retval = get_parameter ( PARAM_STR ( DYNAMORIO_VAR_CACHE_ROOT ) , base_directory , sizeof ( base_directory ) ) ; if ( IS_GET_PARAMETER_FAILURE ( retval ) || ( strchr ( base_directory , DIRSEP ) == NULL && strchr ( base_directory , ALT_DIRSEP ) == NULL ) ) { SYSLOG_INTERNAL_WARNING ( " " , DYNAMORIO_VAR_CACHE_ROOT ) ; return INVALID_HANDLE_VALUE ; } NULL_TERMINATE_BUFFER ( base_directory ) ; if ( ! convert_to_NT_file_path ( wbuf , base_directory , BUFFER_SIZE_ELEMENTS ( wbuf ) ) ) return INVALID_HANDLE_VALUE ; directory_handle = create_file ( wbuf , true , READ_CONTROL , FILE_SHARE_READ | FILE_SHARE_WRITE , FILE_OPEN , true ) ; if ( directory_handle == INVALID_HANDLE_VALUE ) { SYSLOG_INTERNAL_ERROR ( " " , DYNAMORIO_VAR_CACHE_ROOT , base_directory ) ; } return directory_handle ; }
opens the cache\ directory that should be modifed only by trusted users
and is used by both ASLR and persistent cache trusted producers
opens the cache \ directory that should be modifed only by trusted users and is used by both ASLR and persistent cache trusted producers
/* the cache root directory is supposed to be created by nodemgr
     * and owned by Administrators, and the directory ACL should not
     * allow changes.  We should not create one if it doesn't exist,
     * even if we did we wouldn't have the correct ACLs for its
     * children.
     */ /* is_dir */ /* generic rights */ /* case 10255: allow persisted cache files
                                    * in same directory */