Lines Matching defs: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);
311 warning("directory %s is a symlink and is not secure\n", dirname);
313 warning("could not open directory %s: %s\n", dirname, os::strerror(errno));
328 dirp = ::opendir(dirname);
360 static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) {
363 DIR* dirp = open_directory_secure(dirname);
379 // Set the current directory to dirname by using the fd of the directory and
384 warning("could not change to directory %s", dirname);
627 static char* get_sharedmem_filename(const char* dirname, int vmid) {
630 size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
633 snprintf(name, nbytes, "%s/%d", dirname, vmid);
671 static void cleanup_sharedmem_resources(const char* dirname) {
675 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
690 char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
741 static bool make_user_tmp_dir(const char* dirname) {
746 if (mkdir(dirname, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) == OS_ERR) {
752 if (!is_directory_secure(dirname)) {
755 warning("%s directory is insecure\n", dirname);
766 dirname, os::strerror(errno));
780 static int create_sharedmem_resources(const char* dirname, const char* filename, size_t size) {
783 if (!make_user_tmp_dir(dirname)) {
791 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
932 char* dirname = get_user_tmp_dir(user_name);
933 char* filename = get_sharedmem_filename(dirname, vmid);
944 cleanup_sharedmem_resources(dirname);
949 fd = create_sharedmem_resources(dirname, short_filename, size);
952 FREE_C_HEAP_ARRAY(char, dirname);
1092 char* dirname = get_user_tmp_dir(luser);
1097 if (!is_directory_secure(dirname)) {
1098 FREE_C_HEAP_ARRAY(char, dirname);
1106 char* filename = get_sharedmem_filename(dirname, vmid);
1117 FREE_C_HEAP_ARRAY(char, dirname);