libsmb/clientgen.c: Fixed signed/unsigned compile warnings spotted by Herb.
authorJeremy Allison <jra@samba.org>
Wed, 30 Sep 1998 01:05:51 +0000 (01:05 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 30 Sep 1998 01:05:51 +0000 (01:05 +0000)
param/loadparm.c:
smbd/oplock.c: Allow kernel oplocks to be turned off in the smb.conf file.
smbd/server.c: Move init_structs() to after the smb.conf file is loaded - preparation
               for making a "max open files" parameter.
Jeremy.

source/libsmb/clientgen.c
source/param/loadparm.c
source/smbd/oplock.c
source/smbd/server.c

index d77c58e00a9a1218373f6c22670095f3c939a69c..0892714b393192b01a840c8d7faa3ebb5fa513eb 100644 (file)
@@ -1888,8 +1888,8 @@ BOOL cli_establish_connection(struct cli_state *cli,
        else
        {
                /* attempt encrypted session */
-               char nt_sess_pwd[24];
-               char lm_sess_pwd[24];
+               unsigned char nt_sess_pwd[24];
+               unsigned char lm_sess_pwd[24];
 
                /* creates (storing a copy of) and then obtains a 24 byte password OWF */
                pwd_make_lm_nt_owf(&(cli->pwd), cli->cryptkey);
index 05ed6484ac59d8dc140a59e287fa89f7c327e392..5cba2c95d567f6b0a198178d3bdfdfedbf122815 100644 (file)
@@ -915,10 +915,10 @@ static void init_globals(void)
   Globals.bDNSproxy = True;
 
   /*
-   * smbd will check after starting to see if this value
-   * should be set to "true" or not.
+   * smbd will check at runtime to see if this value
+   * will really be used or not.
    */
-  lp_set_kernel_oplocks(False);
+  Globals.bKernelOplocks = True;
 
   /*
    * This must be done last as it checks the value in 
@@ -1163,7 +1163,6 @@ FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug)
 FN_GLOBAL_BOOL(lp_ole_locking_compat,&Globals.bOleLockingCompat)
 FN_GLOBAL_BOOL(lp_nt_smb_support,&Globals.bNTSmbSupport)
 FN_GLOBAL_BOOL(lp_stat_cache,&Globals.bStatCache)
-FN_GLOBAL_BOOL(lp_kernel_oplocks,&Globals.bKernelOplocks)
 
 FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level)
 FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl)
@@ -2668,10 +2667,32 @@ void lp_set_name_resolve_order(char *new_order)
 }
 
 /***********************************************************
- Set the real value of kernel oplocks (called by smbd).
+ Set the flag that says if kernel oplocks are available 
+ (called by smbd).
 ************************************************************/
 
+static BOOL kernel_oplocks_available = False;
+
 void lp_set_kernel_oplocks(BOOL val)
 {
-  Globals.bKernelOplocks = val;
+  /*
+   * Only set this to True if kerenl
+   * oplocks are really available and were
+   * turned on in the smb.conf file.
+   */
+
+  if(Globals.bKernelOplocks && val)
+    kernel_oplocks_available = True;
+  else
+    kernel_oplocks_available = False;
+}
+
+/***********************************************************
+ Return True if kernel oplocks are available and were turned
+ on in smb.conf.
+************************************************************/
+
+BOOL lp_kernel_oplocks(void)
+{
+  return kernel_oplocks_available;
 }
index d5c06312f5fc583b533cb28a1a55fa66d71bd552..c5a19df0e9f979bd3c1fd59d45b828fa890036a8 100644 (file)
@@ -1077,9 +1077,11 @@ Disabling kernel oplock support.\n", strerror(errno) ));
     oplock_pipe_write = pfd[1];
     close(fd);
 
-    DEBUG(3,("check_kernel_oplocks: Kernel oplocks enabled.\n"));
-
     lp_set_kernel_oplocks(True);
+
+    DEBUG(3,("check_kernel_oplocks: Kernel oplocks available and set to %s.\n",
+          lp_kernel_oplocks() ? "True" : "False" ));
+
   }
 #endif /* HAVE_KERNEL_OPLOCKS */
 }
index fb97cf838003872ae976e4615921ecb35a0b0086..62f2bcea9fd064d3c03fb6def43cd2f4f332e2aa 100644 (file)
@@ -626,11 +626,11 @@ static void usage(char *pname)
                exit(1);
        }
 
-       init_structs();
-       
        if (!reload_services(False))
                return(-1);     
 
+       init_structs();
+       
 #ifdef WITH_SSL
        {
                extern BOOL sslEnabled;