Changeset 988 for vendor/current/source4/ntvfs/simple
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/ntvfs/simple
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/ntvfs/simple/svfs_util.c
r740 r988 39 39 struct svfs_private *p = ntvfs->private_data; 40 40 char *ret; 41 char *name_lower = strlower_talloc(p, name); 41 42 42 43 if (*name != '\\') { 43 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name );44 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name_lower); 44 45 } else { 45 ret = talloc_asprintf(req, "%s%s", p->connectpath, name );46 ret = talloc_asprintf(req, "%s%s", p->connectpath, name_lower); 46 47 } 47 48 all_string_sub(ret, "\\", "/", 0); 48 49 strlower(ret + strlen(p->connectpath)); 50 49 talloc_free(name_lower); 51 50 return ret; 52 51 } … … 83 82 mask = p+1; 84 83 85 low_mask = talloc_strdup(mem_ctx, mask);84 low_mask = strlower_talloc(mem_ctx, mask); 86 85 if (!low_mask) { return NULL; } 87 strlower(low_mask);88 86 89 87 odir = opendir(dir->unix_dir); … … 100 98 } 101 99 102 low_name = talloc_strdup(mem_ctx, dent->d_name);100 low_name = strlower_talloc(mem_ctx, dent->d_name); 103 101 if (!low_name) { continue; } 104 strlower(low_name);105 102 106 103 /* check it matches the wildcard pattern */ 107 if (ms_fnmatch (low_mask, low_name, PROTOCOL_NT1) != 0) {104 if (ms_fnmatch_protocol(low_mask, low_name, PROTOCOL_NT1) != 0) { 108 105 continue; 109 106 } -
vendor/current/source4/ntvfs/simple/vfs_simple.c
r740 r988 81 81 p->ntvfs = ntvfs; 82 82 p->next_search_handle = 0; 83 p->connectpath = talloc_strdup(p, share_string_option(scfg, SHARE_PATH, ""));83 p->connectpath = share_string_option(p, scfg, SHARE_PATH, ""); 84 84 p->open_files = NULL; 85 85 p->search = NULL; … … 148 148 /* ignoring wildcards ... */ 149 149 if (unlink(unix_path) == -1) { 150 return map_nt_error_from_unix (errno);150 return map_nt_error_from_unix_common(errno); 151 151 } 152 152 … … 177 177 178 178 if (stat(unix_path, &st) == -1) { 179 return map_nt_error_from_unix (errno);179 return map_nt_error_from_unix_common(errno); 180 180 } 181 181 … … 292 292 if (stat(unix_path, &st) == -1) { 293 293 DEBUG(19,("svfs_qpathinfo: file %s errno=%d\n", unix_path, errno)); 294 return map_nt_error_from_unix (errno);294 return map_nt_error_from_unix_common(errno); 295 295 } 296 296 DEBUG(19,("svfs_qpathinfo: file %s, stat done\n", unix_path)); … … 318 318 319 319 if (fstat(f->fd, &st) == -1) { 320 return map_nt_error_from_unix (errno);320 return map_nt_error_from_unix_common(errno); 321 321 } 322 322 … … 387 387 if (mkdir(unix_path, 0755) == -1) { 388 388 DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno)); 389 return map_nt_error_from_unix (errno);389 return map_nt_error_from_unix_common(errno); 390 390 } 391 391 break; … … 393 393 if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) { 394 394 DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno)); 395 return map_nt_error_from_unix (errno);395 return map_nt_error_from_unix_common(errno); 396 396 } 397 397 break; … … 402 402 fd = open(unix_path, flags, 0644); 403 403 if (fd == -1) { 404 return map_nt_error_from_unix (errno);404 return map_nt_error_from_unix_common(errno); 405 405 } 406 406 … … 408 408 DEBUG(9,("svfs_open: fstat errno=%d\n", errno)); 409 409 close(fd); 410 return map_nt_error_from_unix (errno);410 return map_nt_error_from_unix_common(errno); 411 411 } 412 412 … … 415 415 416 416 f = talloc(handle, struct svfs_file); 417 NT_STATUS_HAVE_NO_MEMORY(f); 417 if (f == NULL) { 418 close(fd); 419 return NT_STATUS_NO_MEMORY; 420 } 418 421 f->fd = fd; 419 422 f->name = talloc_strdup(f, unix_path); … … 457 460 458 461 if (mkdir(unix_path, 0777) == -1) { 459 return map_nt_error_from_unix (errno);462 return map_nt_error_from_unix_common(errno); 460 463 } 461 464 … … 476 479 477 480 if (rmdir(unix_path) == -1) { 478 return map_nt_error_from_unix (errno);481 return map_nt_error_from_unix_common(errno); 479 482 } 480 483 … … 500 503 501 504 if (rename(unix_path1, unix_path2) == -1) { 502 return map_nt_error_from_unix (errno);505 return map_nt_error_from_unix_common(errno); 503 506 } 504 507 … … 539 542 rd->readx.in.offset); 540 543 if (ret == -1) { 541 return map_nt_error_from_unix (errno);544 return map_nt_error_from_unix_common(errno); 542 545 } 543 546 … … 575 578 wr->writex.in.offset); 576 579 if (ret == -1) { 577 return map_nt_error_from_unix (errno);580 return map_nt_error_from_unix_common(errno); 578 581 } 579 582 … … 646 649 647 650 if (close(f->fd) == -1) { 648 return map_nt_error_from_unix (errno);651 return map_nt_error_from_unix_common(errno); 649 652 } 650 653 … … 736 739 if (ftruncate(f->fd, 737 740 info->end_of_file_info.in.size) == -1) { 738 return map_nt_error_from_unix (errno);741 return map_nt_error_from_unix_common(errno); 739 742 } 740 743 break; … … 782 785 &fs->generic.out.blocks_free, 783 786 &fs->generic.out.blocks_total) == -1) { 784 return map_nt_error_from_unix (errno);787 return map_nt_error_from_unix_common(errno); 785 788 } 786 789 … … 822 825 823 826 if (stat(p->connectpath, &st) == -1) { 824 return map_nt_error_from_unix (errno);827 return map_nt_error_from_unix_common(errno); 825 828 } 826 829 … … 1059 1062 1060 1063 /* fill in all the operations */ 1061 ops.connect = svfs_connect;1062 ops.disconnect = svfs_disconnect;1063 ops.unlink = svfs_unlink;1064 ops.chkpath = svfs_chkpath;1065 ops.qpathinfo = svfs_qpathinfo;1066 ops.setpathinfo = svfs_setpathinfo;1067 ops.open = svfs_open;1068 ops.mkdir = svfs_mkdir;1069 ops.rmdir = svfs_rmdir;1070 ops.rename = svfs_rename;1071 ops.copy = svfs_copy;1072 ops.ioctl = svfs_ioctl;1073 ops.read = svfs_read;1074 ops.write = svfs_write;1075 ops.seek = svfs_seek;1076 ops.flush = svfs_flush;1077 ops.close = svfs_close;1078 ops.exit = svfs_exit;1079 ops.lock = svfs_lock;1080 ops.setfileinfo = svfs_setfileinfo;1081 ops.qfileinfo = svfs_qfileinfo;1082 ops.fsinfo = svfs_fsinfo;1083 ops.lpq = svfs_lpq;1084 ops.search_first = svfs_search_first;1085 ops.search_next = svfs_search_next;1086 ops.search_close = svfs_search_close;1087 ops.trans = svfs_trans;1088 ops.logoff = svfs_logoff;1089 ops.async_setup = svfs_async_setup;1090 ops.cancel = svfs_cancel;1064 ops.connect_fn = svfs_connect; 1065 ops.disconnect_fn = svfs_disconnect; 1066 ops.unlink_fn = svfs_unlink; 1067 ops.chkpath_fn = svfs_chkpath; 1068 ops.qpathinfo_fn = svfs_qpathinfo; 1069 ops.setpathinfo_fn = svfs_setpathinfo; 1070 ops.open_fn = svfs_open; 1071 ops.mkdir_fn = svfs_mkdir; 1072 ops.rmdir_fn = svfs_rmdir; 1073 ops.rename_fn = svfs_rename; 1074 ops.copy_fn = svfs_copy; 1075 ops.ioctl_fn = svfs_ioctl; 1076 ops.read_fn = svfs_read; 1077 ops.write_fn = svfs_write; 1078 ops.seek_fn = svfs_seek; 1079 ops.flush_fn = svfs_flush; 1080 ops.close_fn = svfs_close; 1081 ops.exit_fn = svfs_exit; 1082 ops.lock_fn = svfs_lock; 1083 ops.setfileinfo_fn = svfs_setfileinfo; 1084 ops.qfileinfo_fn = svfs_qfileinfo; 1085 ops.fsinfo_fn = svfs_fsinfo; 1086 ops.lpq_fn = svfs_lpq; 1087 ops.search_first_fn = svfs_search_first; 1088 ops.search_next_fn = svfs_search_next; 1089 ops.search_close_fn = svfs_search_close; 1090 ops.trans_fn = svfs_trans; 1091 ops.logoff_fn = svfs_logoff; 1092 ops.async_setup_fn = svfs_async_setup; 1093 ops.cancel_fn = svfs_cancel; 1091 1094 1092 1095 /* register ourselves with the NTVFS subsystem. We register
Note:
See TracChangeset
for help on using the changeset viewer.