Hi!

This patch adds lp_modules() and loads all modules in lp_load() - any
comments on it ? 

I'm not too sure about the place smb_load_modules(lp_modules()) is
called - do we really want to load all those modules when loading a
configuration file ?

Comments, please! :-)

Jelmer

-- 
Jelmer Vernooij                                      <[EMAIL PROTECTED]>
Pending (unfinished) patches                         http://samba.org/~jelmer/diffs.php
Index: param/loadparm.c
===================================================================
RCS file: /home/cvs/samba/source/param/loadparm.c,v
retrieving revision 1.465
diff -u -3 -p -r1.465 loadparm.c
--- param/loadparm.c    2 Nov 2002 07:09:17 -0000       1.465
+++ param/loadparm.c    2 Nov 2002 17:41:26 -0000
@@ -113,6 +113,7 @@ typedef struct
        char *szPrivateDir;
        char **szPassdbBackend;
        char **szSamBackend;
+       char **szModules;
        char *szPasswordServer;
        char *szSocketOptions;
        char *szWorkGroup;
@@ -797,6 +798,7 @@ static struct parm_struct parm_table[] =
        {"allow hosts", P_LIST, P_LOCAL, &sDefault.szHostsallow, NULL, NULL, 
FLAG_HIDE},
        {"hosts deny", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_GLOBAL 
| FLAG_BASIC | FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT | FLAG_DEVELOPER},
        {"deny hosts", P_LIST, P_LOCAL, &sDefault.szHostsdeny, NULL, NULL, FLAG_HIDE},
+       {"modules", P_LIST, P_GLOBAL, &Globals.szModules, NULL, NULL, FLAG_BASIC | 
+FLAG_GLOBAL},
 
        {"Logging Options", P_SEP, P_SEPARATOR},
 
@@ -1495,6 +1497,8 @@ static char *lp_string(const char *s)
  const char *fn_name(void) {return(*(const char **)(ptr) ? *(const char **)(ptr) : 
"");}
 #define FN_GLOBAL_LIST(fn_name,ptr) \
  char **fn_name(void) {return(*(char ***)(ptr));}
+#define FN_GLOBAL_CONST_LIST(fn_name,ptr) \
+ const char **fn_name(void) {return(*(const char ***)(ptr));}
 #define FN_GLOBAL_BOOL(fn_name,ptr) \
  BOOL fn_name(void) {return(*(BOOL *)(ptr));}
 #define FN_GLOBAL_CHAR(fn_name,ptr) \
@@ -1567,6 +1571,7 @@ static FN_GLOBAL_STRING(lp_announce_vers
 FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases)
 FN_GLOBAL_LIST(lp_passdb_backend, &Globals.szPassdbBackend)
 FN_GLOBAL_LIST(lp_sam_backend, &Globals.szSamBackend)
+FN_GLOBAL_CONST_LIST(lp_modules, &Globals.szModules)
 FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction)
 FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript)
 FN_GLOBAL_STRING(lp_deluser_script, &Globals.szDelUserScript)
@@ -3682,6 +3687,10 @@ BOOL lp_load(const char *pszFname, BOOL 
        }
 
        init_iconv();
+
+       if(lp_modules()) {
+               smb_load_modules(lp_modules());
+       }
 
        return (bRetval);
 }
Index: utils/testparm.c
===================================================================
RCS file: /home/cvs/samba/source/utils/testparm.c,v
retrieving revision 1.53
diff -u -3 -p -r1.53 testparm.c
--- utils/testparm.c    30 Sep 2002 15:18:59 -0000      1.53
+++ utils/testparm.c    2 Nov 2002 17:41:26 -0000
@@ -168,6 +168,12 @@ via the %%o substitution. With encrypted
                printf("'winbind separator = +' might cause problems with group 
membership.\n");
        }
 
+#ifndef HAVE_DLOPEN
+       if (lp_modules() != NULL) {
+               printf("'modules = ' specified in configuration file, but this samba 
+build does not support plugins!\n");
+       }
+#endif
+
        return ret;
 }   
 

Attachment: msg04227/pgp00000.pgp
Description: PGP signature

Reply via email to