From f84d007c438dd43f2cd5a9b6ca583976c8e777fa Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sat, 4 Jun 2005 07:04:43 +0000 Subject: r7266: Split the different types of js function defines into separate files, as there are going to be a lot more of them. (This used to be commit b086768589ee27de6616945bbea42b18b40d25d5) --- source4/scripting/ejs/smbcalls_config.c | 149 ++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 source4/scripting/ejs/smbcalls_config.c (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c new file mode 100644 index 0000000000..cd0ecbd767 --- /dev/null +++ b/source4/scripting/ejs/smbcalls_config.c @@ -0,0 +1,149 @@ +/* + Unix SMB/CIFS implementation. + + provide hooks into smbd C calls from ejs scripts + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "scripting/ejs/smbcalls.h" +#include "lib/ejs/ejs.h" +#include "param/loadparm.h" + +/* + return a list of defined services +*/ +static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) +{ + int i; + const char **list = NULL; + if (argc != 0) return -1; + + for (i=0;iclass == P_GLOBAL) { + return -1; + } + parm_ptr = lp_parm_ptr(snum, parm); + } else if (strchr(argv[0], ':')) { + /* its a global parametric option */ + const char *type = talloc_strndup(mprMemCtx(), + argv[0], strcspn(argv[0], ":")); + const char *option = strchr(argv[0], ':') + 1; + const char *value; + if (type == NULL || option == NULL) return -1; + value = lp_get_parametric(-1, type, option); + if (value == NULL) return -1; + ejsSetReturnString(eid, value); + return 0; + } else { + /* its a global parameter */ + parm = lp_parm_struct(argv[0]); + if (parm == NULL) return -1; + parm_ptr = parm->ptr; + } + + if (parm == NULL || parm_ptr == NULL) { + return -1; + } + + /* construct and return the right type of ejs object */ + switch (parm->type) { + case P_STRING: + case P_USTRING: + ejsSetReturnString(eid, *(char **)parm_ptr); + break; + case P_BOOL: + ejsSetReturnValue(eid, mprCreateBoolVar(*(BOOL *)parm_ptr)); + break; + case P_INTEGER: + ejsSetReturnValue(eid, mprCreateIntegerVar(*(int *)parm_ptr)); + break; + case P_ENUM: + for (i=0; parm->enum_list[i].name; i++) { + if (*(int *)parm_ptr == parm->enum_list[i].value) { + ejsSetReturnString(eid, parm->enum_list[i].name); + return 0; + } + } + return -1; + case P_LIST: + ejs_returnlist(eid, parm->label, *(const char ***)parm_ptr); + break; + case P_SEP: + return -1; + } + return 0; +} + +/* + setup C functions that be called from ejs +*/ +void smb_setup_ejs_config(void) +{ + ejsDefineStringCFunction(-1, "lpGet", ejs_lpGet, NULL, MPR_VAR_SCRIPT_HANDLE); + ejsDefineStringCFunction(-1, "lpServices", ejs_lpServices, NULL, MPR_VAR_SCRIPT_HANDLE); +} -- cgit From 60ec75cbc7dccfceec9c57799e2af5be21a08609 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2005 02:37:50 +0000 Subject: r8276: fixed the remaining memory leaks in smbscript. We can now loop doing lots of rpc calls without memory usage increasing. (This used to be commit 9c885a7edb771486793eb287288158157b34e8f3) --- source4/scripting/ejs/smbcalls_config.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index cd0ecbd767..19e7a1c744 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -79,7 +79,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) if (type == NULL || option == NULL) return -1; value = lp_get_parametric(snum, type, option); if (value == NULL) return -1; - ejsSetReturnString(eid, value); + mpr_ReturnString(eid, value); return 0; } @@ -97,7 +97,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) if (type == NULL || option == NULL) return -1; value = lp_get_parametric(-1, type, option); if (value == NULL) return -1; - ejsSetReturnString(eid, value); + mpr_ReturnString(eid, value); return 0; } else { /* its a global parameter */ @@ -114,18 +114,18 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) switch (parm->type) { case P_STRING: case P_USTRING: - ejsSetReturnString(eid, *(char **)parm_ptr); + mpr_ReturnString(eid, *(char **)parm_ptr); break; case P_BOOL: - ejsSetReturnValue(eid, mprCreateBoolVar(*(BOOL *)parm_ptr)); + mpr_Return(eid, mprCreateBoolVar(*(BOOL *)parm_ptr)); break; case P_INTEGER: - ejsSetReturnValue(eid, mprCreateIntegerVar(*(int *)parm_ptr)); + mpr_Return(eid, mprCreateIntegerVar(*(int *)parm_ptr)); break; case P_ENUM: for (i=0; parm->enum_list[i].name; i++) { if (*(int *)parm_ptr == parm->enum_list[i].value) { - ejsSetReturnString(eid, parm->enum_list[i].name); + mpr_ReturnString(eid, parm->enum_list[i].name); return 0; } } -- cgit From b2f84fef133fb4c59e78fd0cf861f553efcbc1ef Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2005 23:25:42 +0000 Subject: r8296: - split out the ejs auth functions into a separate file - got rid of the one line ejs_returnlist() (This used to be commit 6961fe29058cffd8e69d9ce7e7d3902f973411c0) --- source4/scripting/ejs/smbcalls_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 19e7a1c744..97c90c8f5a 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -38,7 +38,7 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) list = str_list_add(list, lp_servicename(i)); } talloc_steal(mprMemCtx(), list); - ejs_returnlist(eid, "services", list); + mpr_Return(eid, mprList("services", list)); return 0; } @@ -131,7 +131,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) } return -1; case P_LIST: - ejs_returnlist(eid, parm->label, *(const char ***)parm_ptr); + mpr_Return(eid, mprList(parm->label, *(const char ***)parm_ptr)); break; case P_SEP: return -1; -- cgit From adbb1612c12d03fa94e4ee23fbc2fa96c09d9dcd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Jul 2005 00:06:38 +0000 Subject: r8399: move the ejs and esp code closer to the directory layout used by the upstream sources. This makes it much easier to keep it up to date. I will separate out the mpr code into lib/appweb/mpr next (This used to be commit 52db7a052baeb0f11361ed69b71cb790039e3cc9) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 97c90c8f5a..18bdd0547e 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -22,7 +22,7 @@ #include "includes.h" #include "scripting/ejs/smbcalls.h" -#include "lib/ejs/ejs.h" +#include "lib/appweb/ejs/ejs.h" #include "param/loadparm.h" /* -- cgit From 86d628a292a22973597e0c06d4a36e20c58ae31c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Jul 2005 07:20:03 +0000 Subject: r8639: moved loadparm calls into an ejs object (This used to be commit 2dc493eea6f9d87c40ad0dc755f528ce0b33ca47) --- source4/scripting/ejs/smbcalls_config.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 18bdd0547e..7fc58f237d 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -139,11 +139,22 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) return 0; } +/* + initialise loadparm ejs subsystem +*/ +static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) +{ + struct MprVar *obj = mprInitObject(eid, "loadparm", argc, argv); + + mprSetStringCFunction(obj, "get", ejs_lpGet); + mprSetStringCFunction(obj, "services", ejs_lpServices); + return 0; +} + /* setup C functions that be called from ejs */ void smb_setup_ejs_config(void) { - ejsDefineStringCFunction(-1, "lpGet", ejs_lpGet, NULL, MPR_VAR_SCRIPT_HANDLE); - ejsDefineStringCFunction(-1, "lpServices", ejs_lpServices, NULL, MPR_VAR_SCRIPT_HANDLE); + ejsDefineCFunction(-1, "loadparm_init", ejs_loadparm_init, NULL, MPR_VAR_SCRIPT_HANDLE); } -- cgit From 2f5f01567b4c30cd764843a1ca0c7ab6d9bc0882 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 20 Jul 2005 10:07:48 +0000 Subject: r8643: - make lp_configfile() work again - get rid of redundeny dyn_CONFIGFILE argument to lp_load() - fixed provisioning to work with completely pristine install, creating an initial smb.conf is none is present - added lp.set() and lp.reload() to loadparm ejs object interface (This used to be commit c2691ef7126ddcee5f95970b78759b40a049d0a7) --- source4/scripting/ejs/smbcalls_config.c | 45 ++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 7fc58f237d..ddb06aa7d7 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -24,6 +24,7 @@ #include "scripting/ejs/smbcalls.h" #include "lib/appweb/ejs/ejs.h" #include "param/loadparm.h" +#include "dynconfig.h" /* return a list of defined services @@ -48,10 +49,10 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) can be called in 4 ways: - v = lpGet("type:parm"); gets a parametric variable - v = lpGet("share", "type:parm"); gets a parametric variable on a share - v = lpGet("parm"); gets a global variable - v = lpGet("share", "parm"); gets a share variable + v = lp.get("type:parm"); gets a parametric variable + v = lp.get("share", "type:parm"); gets a parametric variable on a share + v = lp.get("parm"); gets a global variable + v = lp.get("share", "parm"); gets a share variable the returned variable is a ejs object. It is an array object for lists. */ @@ -139,6 +140,40 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) return 0; } + +/* + set a smb.conf parameter. Only sets in memory, not permanent + + can be called in 4 ways: + + ok = lp.set("parm", "value"); +*/ +static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) +{ + if (argc != 2) { + ejsSetErrorMsg(eid, "lp.set invalid arguments"); + return -1; + } + + mpr_Return(eid, mprCreateBoolVar(lp_set_cmdline(argv[0], argv[1]))); + return 0; +} + +/* + reload smb.conf + + ok = lp.reload(); +*/ +static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) +{ + BOOL ret = lp_load(); + if (ret) { + load_interfaces(); + } + mpr_Return(eid, mprCreateBoolVar(ret)); + return 0; +} + /* initialise loadparm ejs subsystem */ @@ -147,6 +182,8 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) struct MprVar *obj = mprInitObject(eid, "loadparm", argc, argv); mprSetStringCFunction(obj, "get", ejs_lpGet); + mprSetStringCFunction(obj, "set", ejs_lpSet); + mprSetStringCFunction(obj, "reload", ejs_lpReload); mprSetStringCFunction(obj, "services", ejs_lpServices); return 0; } -- cgit From beed5b8532400d79fd40fc53ebae1666adc9af34 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Aug 2005 15:30:33 +0000 Subject: r9119: added a lp.categories() call in the loadparm js object, to allow retrieval of the smb.conf parameter categories. This will make writing a smb.conf editor easier. (This used to be commit 8db549b1506b5260c9eb16f40bbdae6a7c006fa2) --- source4/scripting/ejs/smbcalls_config.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index ddb06aa7d7..a69c3d81f9 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -44,6 +44,27 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) } +/* + return a list of parameter categories +*/ +static int ejs_lpCategories(MprVarHandle eid, int argc, char **argv) +{ + struct parm_struct *parm_table = lp_parm_table(); + int i; + const char **list = NULL; + if (argc != 0) return -1; + + for (i=0;parm_table[i].label;i++) { + if (parm_table[i].class == P_SEPARATOR) { + list = str_list_add(list, parm_table[i].label); + } + } + talloc_steal(mprMemCtx(), list); + mpr_Return(eid, mprList("categories", list)); + return 0; +} + + /* allow access to loadparm variables from inside ejs scripts in swat @@ -185,6 +206,7 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) mprSetStringCFunction(obj, "set", ejs_lpSet); mprSetStringCFunction(obj, "reload", ejs_lpReload); mprSetStringCFunction(obj, "services", ejs_lpServices); + mprSetStringCFunction(obj, "categories", ejs_lpCategories); return 0; } -- cgit From d2a666acbe04f741387ff4351e3971b24f1c3b14 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 19 Sep 2005 13:26:07 +0000 Subject: r10316: More dynconfig fixes (This used to be commit 0963ab9c148772b961f17ec779213b0eb861e1dd) --- source4/scripting/ejs/smbcalls_config.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index a69c3d81f9..a64d57a359 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -24,7 +24,6 @@ #include "scripting/ejs/smbcalls.h" #include "lib/appweb/ejs/ejs.h" #include "param/loadparm.h" -#include "dynconfig.h" /* return a list of defined services -- cgit From e4dbcc0d5d6c9c68a7f3c437611b726f9f0211cf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 28 Dec 2005 03:04:40 +0000 Subject: r12531: 'make quicktest' was taking 15 minutes on my system due to failing DNS lookups in load_interfaces(). The reason was my eth0 interface was down, and it was being interpreted as a DNS name. This patch changes load_interfaces() to happening automatically when interfaces are first needed instead of on the startup of every samba binary. This means that (for example) ldbadd doesn't call load_interfaces(), which means no slow DNS lookups. I also reduced the number of static globals in interface.c to 1, and changed from malloc to talloc When you want to force a reload of the interfaces list, you now call unload_interfaces(), which means the next call that needs the interfaces list will reload it (This used to be commit f79d90bd1364b970adb2981b2572e77066431f1e) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index a64d57a359..b0b1420ba2 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -188,7 +188,7 @@ static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { BOOL ret = lp_load(); if (ret) { - load_interfaces(); + unload_interfaces(); } mpr_Return(eid, mprCreateBoolVar(ret)); return 0; -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/scripting/ejs/smbcalls_config.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index b0b1420ba2..949dd0321a 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -24,6 +24,8 @@ #include "scripting/ejs/smbcalls.h" #include "lib/appweb/ejs/ejs.h" #include "param/loadparm.h" +#include "system/network.h" +#include "netif/netif.h" /* return a list of defined services -- cgit From 9d9e5abdcee6581ff42d7bdcf7b236472cbec347 Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 24 Apr 2006 00:38:53 +0000 Subject: r15187: Introduce new param type P_BYTES. This lets config options which specify byte counts be given in convenient units. (This used to be commit 1b8891a2f389c1016c3cfcbe635ed86d015554d8) --- source4/scripting/ejs/smbcalls_config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 949dd0321a..fae497e2a5 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -126,7 +126,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) /* its a global parameter */ parm = lp_parm_struct(argv[0]); if (parm == NULL) return -1; - parm_ptr = parm->ptr; + parm_ptr = lp_parm_ptr(-1, parm); } if (parm == NULL || parm_ptr == NULL) { @@ -143,6 +143,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_Return(eid, mprCreateBoolVar(*(BOOL *)parm_ptr)); break; case P_INTEGER: + case P_BYTES: mpr_Return(eid, mprCreateIntegerVar(*(int *)parm_ptr)); break; case P_ENUM: -- cgit From 0dcecc314899b6f36e9215e0b3881220062ba4f9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 20 May 2006 03:08:44 +0000 Subject: r15731: module init functions should return NTSTATUS, not void (This used to be commit c6d20c22454b87b4dea3527f0efcecd373679848) --- source4/scripting/ejs/smbcalls_config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index fae497e2a5..2827920bd0 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -215,7 +215,8 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) /* setup C functions that be called from ejs */ -void smb_setup_ejs_config(void) +NTSTATUS smb_setup_ejs_config(void) { ejsDefineCFunction(-1, "loadparm_init", ejs_loadparm_init, NULL, MPR_VAR_SCRIPT_HANDLE); + return NT_STATUS_OK; } -- cgit From a2eca9174c7803732658a1e6f7e8ed873c4fb6fd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 17 Aug 2006 13:37:04 +0000 Subject: r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the configure check for the interfaces. should fix the build on some old sun boxes metze (This used to be commit f20e251bfd9f1eb7ce5c00739631b1625a2aa467) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 2827920bd0..5da0dd14f0 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -25,7 +25,7 @@ #include "lib/appweb/ejs/ejs.h" #include "param/loadparm.h" #include "system/network.h" -#include "netif/netif.h" +#include "lib/socket/netif.h" /* return a list of defined services -- cgit From 43470b5ec3d451aa75acf2cda40cf2dcc019efab Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Sun, 31 Dec 2006 20:05:29 +0000 Subject: r20444: WEB Application framework / SWAT. We're now at the stage where the web application framework should build and install automatically. Derrell (This used to be commit 0201baef46c1701007e0a4cdd95edee287939318) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 5da0dd14f0..6ee9c8305b 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -67,7 +67,7 @@ static int ejs_lpCategories(MprVarHandle eid, int argc, char **argv) /* - allow access to loadparm variables from inside ejs scripts in swat + allow access to loadparm variables from inside ejs scripts in web apps can be called in 4 ways: -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/scripting/ejs/smbcalls_config.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 6ee9c8305b..64310c08fd 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 10f6e1657303dabcf7dbbaed8547f0cb6e845a5d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 Jul 2007 08:01:36 +0000 Subject: r23859: Work to have Group Policy work 'out of the box' in Samba4. This involves creating the SYSVOL and NETLOGON shares at provision time, and creating the right subdirectories. This also changes the behaviour of lp.get("foo") in ejs - we now return undefined, rather than syntax error, if the parameter doesn't exist (perhaps because the share isn't defined). Andrew Bartlett (This used to be commit 45cadf3bc0d38f6600666511a392e1ce353adee7) --- source4/scripting/ejs/smbcalls_config.c | 41 +++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 64310c08fd..6f15ee5a4a 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -89,7 +89,8 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) /* its a share parameter */ int snum = lp_servicenumber(argv[0]); if (snum == -1) { - return -1; + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; } if (strchr(argv[1], ':')) { /* its a parametric option on a share */ @@ -98,16 +99,23 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) strcspn(argv[1], ":")); const char *option = strchr(argv[1], ':') + 1; const char *value; - if (type == NULL || option == NULL) return -1; + if (type == NULL || option == NULL) { + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; + } value = lp_get_parametric(snum, type, option); - if (value == NULL) return -1; + if (value == NULL) { + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; + } mpr_ReturnString(eid, value); return 0; } parm = lp_parm_struct(argv[1]); if (parm == NULL || parm->class == P_GLOBAL) { - return -1; + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; } parm_ptr = lp_parm_ptr(snum, parm); } else if (strchr(argv[0], ':')) { @@ -116,20 +124,30 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) argv[0], strcspn(argv[0], ":")); const char *option = strchr(argv[0], ':') + 1; const char *value; - if (type == NULL || option == NULL) return -1; + if (type == NULL || option == NULL) { + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; + } value = lp_get_parametric(-1, type, option); - if (value == NULL) return -1; + if (value == NULL) { + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; + } mpr_ReturnString(eid, value); return 0; } else { /* its a global parameter */ parm = lp_parm_struct(argv[0]); - if (parm == NULL) return -1; + if (parm == NULL) { + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; + } parm_ptr = lp_parm_ptr(-1, parm); } if (parm == NULL || parm_ptr == NULL) { - return -1; + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; } /* construct and return the right type of ejs object */ @@ -142,6 +160,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_Return(eid, mprCreateBoolVar(*(BOOL *)parm_ptr)); break; case P_INTEGER: + case P_OCTAL: case P_BYTES: mpr_Return(eid, mprCreateIntegerVar(*(int *)parm_ptr)); break; @@ -152,12 +171,14 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) return 0; } } - return -1; + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; case P_LIST: mpr_Return(eid, mprList(parm->label, *(const char ***)parm_ptr)); break; case P_SEP: - return -1; + mpr_Return(eid, mprCreateUndefinedVar()); + return 0; } return 0; } -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/scripting/ejs/smbcalls_config.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 6f15ee5a4a..b31b70bda8 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -25,6 +25,7 @@ #include "param/loadparm.h" #include "system/network.h" #include "lib/socket/netif.h" +#include "param/param.h" /* return a list of defined services -- cgit From 98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 16:46:30 +0000 Subject: r25035: Fix some more warnings, use service pointer rather than service number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f) --- source4/scripting/ejs/smbcalls_config.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index b31b70bda8..6da978663a 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -37,7 +37,7 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) if (argc != 0) return -1; for (i=0;i Date: Wed, 12 Sep 2007 09:26:57 +0000 Subject: r25113: fix compiler warning metze (This used to be commit d0ada02532d10e8b31c390ee191b94c2f2299cb0) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 6da978663a..7161ca49ad 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -87,7 +87,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) if (argc < 1) return -1; if (argc == 2) { - struct service *service; + struct loadparm_service *service; /* its a share parameter */ service = lp_service(argv[0]); if (service == NULL) { -- cgit From 5e2f9cd8e223368d38d49cf60f199bbd818b8732 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Sep 2007 19:49:53 +0000 Subject: r25379: Use loadparm context parameter in a lot more places. (This used to be commit 091961b13be665061c7e88ab4e2808c015bc403e) --- source4/scripting/ejs/smbcalls_config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 7161ca49ad..8f1339db34 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -36,8 +36,8 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) const char **list = NULL; if (argc != 0) return -1; - for (i=0;i Date: Thu, 27 Sep 2007 23:31:28 +0000 Subject: r25392: Add loadparm context as argument in a couple more places. (This used to be commit c62f51cc28a37959128e78a1f34cfd4c6d3ba069) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 8f1339db34..f488b0745f 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -200,7 +200,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) return -1; } - mpr_Return(eid, mprCreateBoolVar(lp_set_cmdline(argv[0], argv[1]))); + mpr_Return(eid, mprCreateBoolVar(lp_set_cmdline(global_loadparm, argv[0], argv[1]))); return 0; } -- cgit From 37d53832a4623653f706e77985a79d84bd7c6694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Sep 2007 01:17:46 +0000 Subject: r25398: Parse loadparm context to all lp_*() functions. (This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index f488b0745f..45c197834a 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -211,7 +211,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) */ static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { - BOOL ret = lp_load(); + BOOL ret = lp_load(lp_configfile(global_loadparm)); if (ret) { unload_interfaces(); } -- cgit From 60a1046c5c5783799bd64fe18e03534670f83d82 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 29 Sep 2007 18:00:19 +0000 Subject: r25430: Add the loadparm context to all parametric options. (This used to be commit fd697d77c9fe67a00939a1f04b35c451316fff58) --- source4/scripting/ejs/smbcalls_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 45c197834a..ae7dea6819 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -105,7 +105,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_Return(eid, mprCreateUndefinedVar()); return 0; } - value = lp_get_parametric(service, type, option); + value = lp_get_parametric(global_loadparm, service, type, option); if (value == NULL) { mpr_Return(eid, mprCreateUndefinedVar()); return 0; @@ -130,7 +130,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_Return(eid, mprCreateUndefinedVar()); return 0; } - value = lp_get_parametric(NULL, type, option); + value = lp_get_parametric(global_loadparm, NULL, type, option); if (value == NULL) { mpr_Return(eid, mprCreateUndefinedVar()); return 0; -- cgit From 8ffc4c1f97bf40cf19812b086cab2c48ff9aed9d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 2 Oct 2007 14:29:20 +0000 Subject: r25462: Remove refernece to categories from js as well. (This used to be commit 12d7cccd7c8c632e2d49e9c21e0e139366ffe2c3) --- source4/scripting/ejs/smbcalls_config.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index ae7dea6819..6b9c245e7e 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -45,27 +45,6 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) } -/* - return a list of parameter categories -*/ -static int ejs_lpCategories(MprVarHandle eid, int argc, char **argv) -{ - struct parm_struct *parm_table = lp_parm_table(); - int i; - const char **list = NULL; - if (argc != 0) return -1; - - for (i=0;parm_table[i].label;i++) { - if (parm_table[i].class == P_SEPARATOR) { - list = str_list_add(list, parm_table[i].label); - } - } - talloc_steal(mprMemCtx(), list); - mpr_Return(eid, mprList("categories", list)); - return 0; -} - - /* allow access to loadparm variables from inside ejs scripts in web apps @@ -178,9 +157,6 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) case P_LIST: mpr_Return(eid, mprList(parm->label, *(const char ***)parm_ptr)); break; - case P_SEP: - mpr_Return(eid, mprCreateUndefinedVar()); - return 0; } return 0; } @@ -230,7 +206,6 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) mprSetStringCFunction(obj, "set", ejs_lpSet); mprSetStringCFunction(obj, "reload", ejs_lpReload); mprSetStringCFunction(obj, "services", ejs_lpServices); - mprSetStringCFunction(obj, "categories", ejs_lpCategories); return 0; } -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/scripting/ejs/smbcalls_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 6b9c245e7e..1c76757659 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -138,7 +138,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_ReturnString(eid, *(char **)parm_ptr); break; case P_BOOL: - mpr_Return(eid, mprCreateBoolVar(*(BOOL *)parm_ptr)); + mpr_Return(eid, mprCreateBoolVar(*(bool *)parm_ptr)); break; case P_INTEGER: case P_OCTAL: @@ -187,7 +187,7 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) */ static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { - BOOL ret = lp_load(lp_configfile(global_loadparm)); + bool ret = lp_load(lp_configfile(global_loadparm)); if (ret) { unload_interfaces(); } -- cgit From b038240ac72fa34a132eb52bda28bbb80f82c29e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 4 Dec 2007 00:12:13 +0100 Subject: r26275: return loadparm context in lp_load. (This used to be commit d01f0f4c2037b531b3fd088060717f90e60471e9) --- source4/scripting/ejs/smbcalls_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 1c76757659..122d78ac20 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -187,7 +187,9 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) */ static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { - bool ret = lp_load(lp_configfile(global_loadparm)); + bool ret; + + ret = lp_load(lp_configfile(global_loadparm), NULL); if (ret) { unload_interfaces(); } -- cgit From 47554fd72e00911f05c1c16f1af4d06481d32882 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Dec 2007 23:56:53 +0100 Subject: r26338: Fix parameter, typo. (This used to be commit 2a005096dd41f66fd99577d6ca7eb3e0f1cb30f2) --- source4/scripting/ejs/smbcalls_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 122d78ac20..347cb758fe 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -98,7 +98,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_Return(eid, mprCreateUndefinedVar()); return 0; } - parm_ptr = lp_parm_ptr(service, parm); + parm_ptr = lp_parm_ptr(global_loadparm, service, parm); } else if (strchr(argv[0], ':')) { /* its a global parametric option */ const char *type = talloc_strndup(mprMemCtx(), @@ -123,7 +123,7 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) mpr_Return(eid, mprCreateUndefinedVar()); return 0; } - parm_ptr = lp_parm_ptr(NULL, parm); + parm_ptr = lp_parm_ptr(global_loadparm, NULL, parm); } if (parm == NULL || parm_ptr == NULL) { -- cgit From a48fdda5fec99649e29760c7a9c91246438c9579 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Dec 2007 23:31:41 +0100 Subject: r26339: Make loadparm talloc-allocated. (This used to be commit 1e02cd8db1d65ff72b747833904a10b47749b1fb) --- source4/scripting/ejs/smbcalls_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 347cb758fe..157587186c 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -189,7 +189,7 @@ static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { bool ret; - ret = lp_load(lp_configfile(global_loadparm), NULL); + ret = lp_load(talloc_autofree_context(), lp_configfile(global_loadparm), NULL); if (ret) { unload_interfaces(); } -- cgit From dd7e5ed88c48f4ee39e53be07c8839791e914e45 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Dec 2007 23:32:37 +0100 Subject: r26352: Don't make lp_load create a new context. (This used to be commit d0d5c1a823a6601292c061dba2b6f4bde2b9e3dd) --- source4/scripting/ejs/smbcalls_config.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 157587186c..88c153ead3 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -161,6 +161,14 @@ static int ejs_lpGet(MprVarHandle eid, int argc, char **argv) return 0; } +/* + v = lp.filename(); obtain filename +*/ +static int ejs_lpFilename(MprVarHandle eid, int argc, char **argv) +{ + mpr_ReturnString(eid, lp_configfile(global_loadparm)); + return 0; +} /* set a smb.conf parameter. Only sets in memory, not permanent @@ -188,8 +196,9 @@ static int ejs_lpSet(MprVarHandle eid, int argc, char **argv) static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) { bool ret; - - ret = lp_load(talloc_autofree_context(), lp_configfile(global_loadparm), NULL); + const char *filename = lp_configfile(global_loadparm); + + ret = lp_load(global_loadparm, filename); if (ret) { unload_interfaces(); } @@ -208,6 +217,7 @@ static int ejs_loadparm_init(MprVarHandle eid, int argc, struct MprVar **argv) mprSetStringCFunction(obj, "set", ejs_lpSet); mprSetStringCFunction(obj, "reload", ejs_lpReload); mprSetStringCFunction(obj, "services", ejs_lpServices); + mprSetStringCFunction(obj, "filename", ejs_lpFilename); return 0; } -- cgit From 6f2252dace1629d7b5c5637b103caa28d2c89b07 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 11 Dec 2007 22:23:14 +0100 Subject: r26401: Don't cache interfaces context in libnetif. (This used to be commit 9f975417cc66bfd4589da38bfd23731dbe0e6153) --- source4/scripting/ejs/smbcalls_config.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 88c153ead3..07e0f479da 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -199,9 +199,6 @@ static int ejs_lpReload(MprVarHandle eid, int argc, char **argv) const char *filename = lp_configfile(global_loadparm); ret = lp_load(global_loadparm, filename); - if (ret) { - unload_interfaces(); - } mpr_Return(eid, mprCreateBoolVar(ret)); return 0; } -- cgit From e11c61bc5cd487dce06fc38bb0ee8c4e24b04e8c Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 18:21:44 +0100 Subject: Introduce mprLpCtx() similar to mprMemCtx() for loadparm_context used by all EJS code. (This used to be commit 184988866fe8e740f58e3683eefcaa70f8b51d11) --- source4/scripting/ejs/smbcalls_config.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_config.c') diff --git a/source4/scripting/ejs/smbcalls_config.c b/source4/scripting/ejs/smbcalls_config.c index 07e0f479da..eb673b3a23 100644 --- a/source4/scripting/ejs/smbcalls_config.c +++ b/source4/scripting/ejs/smbcalls_config.c @@ -36,8 +36,8 @@ static int ejs_lpServices(MprVarHandle eid, int argc, char **argv) const char **list = NULL; if (argc != 0) return -1; - for (i=0;i