Lines Matching defs:dirname

160   char* dirname = NEW_C_HEAP_ARRAY(char, nbytes, mtInternal);
163 snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user);
165 return dirname;
378 static DIR *open_directory_secure(const char* dirname) {
390 RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result);
393 result = open_o_nofollow(dirname, O_RDONLY);
400 warning("directory %s is a symlink and is not secure\n", dirname);
402 warning("could not open directory %s: %s\n", dirname, os::strerror(errno));
417 dirp = ::opendir(dirname);
449 static DIR *open_directory_secure_cwd(const char* dirname, int *saved_cwd_fd) {
452 DIR* dirp = open_directory_secure(dirname);
468 // Set the current directory to dirname by using the fd of the directory and
473 warning("could not change to directory %s", dirname);
722 static char* get_sharedmem_filename(const char* dirname, int vmid) {
725 size_t nbytes = strlen(dirname) + UINT_CHARS + 2;
728 snprintf(name, nbytes, "%s/%d", dirname, vmid);
764 static void cleanup_sharedmem_resources(const char* dirname) {
768 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
782 char* dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(dirname), mtInternal);
831 static bool make_user_tmp_dir(const char* dirname) {
835 if (mkdir(dirname, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) == OS_ERR) {
840 if (!is_directory_secure(dirname)) {
843 warning("%s directory is insecure\n", dirname);
854 dirname, os::strerror(errno));
868 static int create_sharedmem_resources(const char* dirname, const char* filename, size_t size) {
871 if (!make_user_tmp_dir(dirname)) {
879 DIR* dirp = open_directory_secure_cwd(dirname, &saved_cwd_fd);
1012 char* dirname = get_user_tmp_dir(user_name);
1013 char* filename = get_sharedmem_filename(dirname, vmid);
1024 cleanup_sharedmem_resources(dirname);
1029 fd = create_sharedmem_resources(dirname, short_filename, size);
1032 FREE_C_HEAP_ARRAY(char, dirname);
1181 char* dirname = get_user_tmp_dir(luser);
1186 if (!is_directory_secure(dirname)) {
1187 FREE_C_HEAP_ARRAY(char, dirname);
1195 char* filename = get_sharedmem_filename(dirname, vmid);
1206 FREE_C_HEAP_ARRAY(char, dirname);