sid_to_string(sid_string, &global_sam_sid);
if(sys_lseek(fd, (SMB_OFF_T)0, SEEK_SET) != 0) {
DEBUG(0,("unable to seek file file %s. Error was %s\n",
- sid_file, strerror(errno) ));
+ sid_file, strerror(errno) ));
close(fd);
return False;
- }
+ }
} else {
close(fd);
return True;
char *start, *end;
pstring dirpath;
pstring orig_path;
- int saved_errno;
BOOL component_was_mangled = False;
BOOL name_has_wildcard = False;
#if 0
return(True);
}
- saved_errno = errno;
-
DEBUG(5,("unix_convert begin: name = %s, dirpath = %s, start = %s\n",
name, dirpath, start));
*/
if (case_sensitive && !is_mangled(name) &&
- !lp_strip_dot() && !use_mangled_map && (saved_errno != ENOENT))
+ !lp_strip_dot() && !use_mangled_map)
return(False);
if(strchr(start,'?') || strchr(start,'*'))
}
+static void list_fn(file_info *finfo, const char *name)
+{
+
+}
+
+/*
+ test directory listing speed
+ */
+static void run_dirtest(int dummy)
+{
+ int i;
+ static struct cli_state cli;
+ int fnum;
+ double t1;
+
+ printf("starting directory test\n");
+
+ if (!open_connection(&cli)) {
+ return;
+ }
+
+ cli_sockopt(&cli, sockops);
+
+ srandom(0);
+ for (i=0;i<numops;i++) {
+ fstring fname;
+ slprintf(fname, sizeof(fname), "%x", random());
+ fnum = cli_open(&cli, fname, O_RDWR|O_CREAT, DENY_NONE);
+ if (fnum == -1) {
+ fprintf(stderr,"Failed to open %s\n", fname);
+ return;
+ }
+ cli_close(&cli, fnum);
+ }
+
+ t1 = end_timer();
+
+ printf("Matched %d\n", cli_list(&cli, "a*.*", 0, list_fn));
+ printf("Matched %d\n", cli_list(&cli, "b*.*", 0, list_fn));
+ printf("Matched %d\n", cli_list(&cli, "xyzabc", 0, list_fn));
+
+ printf("dirtest core %g seconds\n", end_timer() - t1);
+
+ srandom(0);
+ for (i=0;i<numops;i++) {
+ fstring fname;
+ slprintf(fname, sizeof(fname), "%x", random());
+ cli_unlink(&cli, fname);
+ }
+
+ close_connection(&cli);
+
+ printf("finished dirtest\n");
+}
+
+
static double create_procs(void (*fn)(int))
{
{"NBW95", run_nbw95, 0},
{"NBWNT", run_nbwnt, 0},
{"OPLOCK", run_oplock, 0},
+ {"DIR", run_dirtest, 0},
{NULL, NULL, 0}};