[netfilter-cvslog] r4343 - trunk/nfsim/core
rusty at netfilter.org
rusty at netfilter.org
Tue Oct 11 12:53:35 CEST 2005
Author: rusty at netfilter.org
Date: 2005-10-11 12:53:32 +0200 (Tue, 11 Oct 2005)
New Revision: 4343
Modified:
trunk/nfsim/core/core.c
trunk/nfsim/core/tui.c
Log:
Set nfsim path to include . and $PATH by default, unless $NFSIM_EXTPATH overrides
Modified: trunk/nfsim/core/core.c
===================================================================
--- trunk/nfsim/core/core.c 2005-10-09 16:37:12 UTC (rev 4342)
+++ trunk/nfsim/core/core.c 2005-10-11 10:53:32 UTC (rev 4343)
@@ -467,7 +467,8 @@
setenv("LD_LIBRARY_PATH", path, 1);
talloc_free(path);
module_path = talloc_asprintf(NULL, "%s/nfsim", LIBDIR);
- extension_path = module_path;
+ extension_path = talloc_asprintf(NULL, ".:%s/extensions:%s",
+ LIBDIR, getenv("PATH");
} else {
char *oldpath, *path;
@@ -480,8 +481,10 @@
talloc_free(path);
module_path = talloc_asprintf(NULL, "%.*s/netfilter/ipv4",
(int)(p - argv[0]), argv[0]);
- extension_path = talloc_asprintf(NULL, "%.*s/tools/extensions",
- (int)(p - argv[0]), argv[0]);
+ extension_path = talloc_asprintf(NULL,
+ ".:%.*s/tools/extensions:%s",
+ (int)(p - argv[0]), argv[0],
+ getenv("PATH"));
}
if (getenv("NFSIM_MODPATH"))
module_path = getenv("NFSIM_MODPATH");
Modified: trunk/nfsim/core/tui.c
===================================================================
--- trunk/nfsim/core/tui.c 2005-10-09 16:37:12 UTC (rev 4342)
+++ trunk/nfsim/core/tui.c 2005-10-11 10:53:32 UTC (rev 4343)
@@ -289,7 +289,7 @@
script_fail("no matching \"`\" found");
len = end - (line + *off);
- cmdstr = talloc_asprintf(line, "%s/%.*s",
+ cmdstr = talloc_asprintf(line, "PATH=%s; %.*s",
extension_path, len, line + *off);
cmdfile = popen(cmdstr, "r");
if (!cmdfile)
More information about the netfilter-cvslog
mailing list