Lines Matching refs:dirname

158   char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
161 snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
163 return dirname;
298 static DIR *open_directory_secure(const char* dirname) {
306 RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result);
310 warning("directory %s is a symlink and is not secure\n", dirname);
312 warning("could not open directory %s: %s\n", dirname, os::strerror(errno));
327 dirp = ::opendir(dirname);
359 static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) {
362 DIR* dirp = open_directory_secure(dirname);
378 // Set the current directory to dirname by using the fd of the directory and
383 warning("could not change to directory %s", dirname);
639 static char* get_sharedmem_filename(const char* dirname, int vmid) {
642 size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
645 snprintf(name, nbytes, "%s/%d", dirname, vmid);
683 static void cleanup_sharedmem_resources(const char* dirname) {
687 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
702 char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
751 static bool make_user_tmp_dir(const char* dirname) {
756 if (mkdir(dirname, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) == OS_ERR) {
762 if (!is_directory_secure(dirname)) {
765 warning("%s directory is insecure\n", dirname);
776 dirname, os::strerror(errno));
790 static int create_sharedmem_resources(const char* dirname, const char* filename, size_t size) {
793 if (!make_user_tmp_dir(dirname)) {
801 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
942 char* dirname = get_user_tmp_dir(user_name);
943 char* filename = get_sharedmem_filename(dirname, vmid);
954 cleanup_sharedmem_resources(dirname);
959 fd = create_sharedmem_resources(dirname, short_filename, size);
962 FREE_C_HEAP_ARRAY(char, dirname);
1102 char* dirname = get_user_tmp_dir(luser);
1107 if (!is_directory_secure(dirname)) {
1108 FREE_C_HEAP_ARRAY(char, dirname);
1116 char* filename = get_sharedmem_filename(dirname, vmid);
1127 FREE_C_HEAP_ARRAY(char, dirname);