passdb/passdb.c: Andrew's formatting changes.
authorJeremy Allison <jra@samba.org>
Mon, 1 Nov 1999 18:39:02 +0000 (18:39 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 1 Nov 1999 18:39:02 +0000 (18:39 +0000)
smbd/filename.c: Andrew's change to remove logic bug.
smbd/server.c: Re-seed the random number generator early on startup to prevent
slow-start icon problems with Windows clients.
utils/torture.c: Andrew's directory test.
Jeremy.

source/passdb/passdb.c
source/smbd/filename.c
source/smbd/server.c
source/utils/torture.c

index b205e792fab77c37b56e95815a9d2403e31ddc2e..c0a20f34204c3bc7b3814bd5fa1acc2fe445f89c 100644 (file)
@@ -893,10 +893,10 @@ detected - re-writing to be decimal 21 instead.\n" ));
                        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;
index 8f83accf8b44ee0ae07b9da7b71637c3e0b3f279..64f63805f3250dc32b74897f45aaed351599d59b 100644 (file)
@@ -340,7 +340,6 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
   char *start, *end;
   pstring dirpath;
   pstring orig_path;
-  int saved_errno;
   BOOL component_was_mangled = False;
   BOOL name_has_wildcard = False;
 #if 0
@@ -454,8 +453,6 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
     return(True);
   }
 
-  saved_errno = errno;
-
   DEBUG(5,("unix_convert begin: name = %s, dirpath = %s, start = %s\n",
         name, dirpath, start));
 
@@ -465,7 +462,7 @@ BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component,
    */
 
   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,'*'))
index 55a265b780d3a8c8ec992d949d712e00a9369ca3..9312ec7534eb6b831dc8a37bca95efefb1039c00 100644 (file)
@@ -609,6 +609,10 @@ static void usage(char *pname)
 
        charset_initialise();
 
+       /* we want to re-seed early to prevent time delays causing
+           client problems at a later date. (tridge) */
+       generate_random_buffer(NULL, 0, False);
+
        /* make absolutely sure we run as root - to handle cases where people
           are crazy enough to have it setuid */
 
index adea830998a64204c721e25a18ee64c4b9c9f3ad..9dc9d664b2cfa7494d22ca3fee1ef2e3f169597c 100644 (file)
@@ -1146,6 +1146,62 @@ static void run_oplock(int dummy)
 }
 
 
+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))
 {
@@ -1245,6 +1301,7 @@ static struct {
        {"NBW95",  run_nbw95, 0},
        {"NBWNT",  run_nbwnt, 0},
        {"OPLOCK",  run_oplock, 0},
+       {"DIR",  run_dirtest, 0},
        {NULL, NULL, 0}};